Skip to content

Commit 83a87db

Browse files
Update PIC12F1840_libdemo.c
1 parent 4dad494 commit 83a87db

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

PIC12F1840_libdemo.c

+1-21
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,6 @@ uint8_t ldgZeroB = 0; // If set true blanks leading zeros
7070
uint8_t rightShift = 0; // Right shifts displayed digits, discarding values on right, use after rounding
7171
const uint8_t brightness = 2; // Brightness, max 7, 0 is off
7272

73-
74-
// MAX31865 definitions:
75-
#define HIGH_THRESH_MSB 0x87 // High fault threshold is 0x87B6, low fault 0x196C, configuration values are ADC RTD output in 16 bit format
76-
#define HIGH_THRESH_LSB 0xB6 // Fault will be flagged if RTD resistance > 212.05R, equivalent to approx 300C or if < 39.72R, -150C
77-
#define LOW_THRESH_MSB 0x19
78-
#define LOW_THRESH_LSB 0x6C
79-
#define CONFIG_WRITE_ADDR 0x80 // Note reg address has b7 set for writes
80-
#define CONFIG_READ_ADDR 0x00
81-
#define RTDLSB 0x02 // RTD read data address LSB
82-
#define RTDMSB 0x01 // RTD read data address MSB
83-
#define FAULT_ADDR 0x07 // Fault register
84-
#define RTDFAULTBIT 0x01 // Fault bit is bit 0 of rtd LSB
85-
#define FAULTCLEAR 0b00000010 // Bit D1 of config clears faults when set, autoclear
86-
#define BIAS_ON 0b10000000 // Mask to set D7 of config register, turns on RTD bias current
87-
#define CONVERSION_ON 0b00100000 // Mask to set config D5, starts a one shot conversion
88-
#define CONFIG3WIRE 0b00110001 // Config register for MAX31865 set up with bias current off(D7) initially, 3 wire(D4),1 shot conversion
89-
#define CONFIG24WIRE 0b00100001 // Config setup for 2/4 wire sensors.Base configs do *not* clear faults, random initial data on read fault reg.
90-
#define TEMPMULTIPLIER 100 // Temperature is returned as an integer, for n decimal places multiply float result by 10^n
91-
#define MAXDRDY 0x08 // MAX31865 DRDY o/p connected to RA3, active low
92-
9373
// Global variables:
9474
const uint8_t portDefault = 0; // PORT A will be set to outputs, all low
9575

@@ -141,4 +121,4 @@ void initialise12F1840()
141121
OPTION_REG = 0b10001000; // Set bit 7, disable pullups, plus bit 3, prescaler not assigned Timer0
142122
ANSELA = 0; // Disable analogue inputs, all are digital
143123
ADCON0 = 0; // ADC disabled/unused
144-
}
124+
}

0 commit comments

Comments
 (0)