Temperature controlled Dry block heater for cuvette

Published by Mani Thundiyil in the blog Mani Thundiyil's blog. Views: 374


Introduction
A cuvette is a small tube-like container with straight sides and a circular or square cross section. It is sealed at one end, and made of a clear material such as plastic, glass, or fused quartz. Cuvettes are designed to hold samples for spectroscopic measurement, where a beam of light is passed through the sample within the cuvette to measure the absorbance. This measurement is done with a colorimeter.

Colorimeters are highly sensitive devices that can measure the concentration and intensity of a particular color that is used in a product. The color photometers are used for measuring the reflectance of a color as well as the transmission.

The working of colorimeters is mainly based on the Beer-Lambert’s Law. This law states that the light absorption when passes through a medium are directly proportional to the concentration of the medium. When a colorimeter is used, there is a ray of light with a certain wavelength is directed towards a solution. The colorimeter analyzes the reflected/transmitted light and compares with a predetermined standard. A processing circuit is used for calculation of the absorbance of the light by the solution. If the absorption of the solution is higher, then there will be more light absorbed by the solution and if the concentration of the solution is low then more lights will be transmitted through the solution.

Test samples are prepared and kept in a cuvette.

Colorimeters can be used for measuring the color concentration and intensity of a variety of materials such as: Food ingredients, Building materials, Textile products, Biological samples and so on.

Our new project is a colorimeter for the use in a biological clinical lab where the concentration of sodium, glucose etc. in blood and urine.

Sample preparation includes serum extraction, treating the serum with reagents, keeping the treated samples at constant temperature for a predetermined time before actual test using the colorimeter.

For temperature control of samples kept in cuvette a heated Aluminum block is used where there are cavities to place a number of Cuvettes at the same time. Two methods of heating available; wet bath heater and dry block heater. In wet bath the heater block is heated using hot oil or water. In dry block heater the aluminum block is directly heated using electrical heating element.

This part of our project is to design a dry block heater controller. The heated block is made of solid aluminum (see Figure 1). This block is designed for heating 12 Cuvettes at a time as shown in the figure and the thermal simulation study reveals that a maximum of 15 watts of electrical power is sufficient. The Cuvettes are to be kept for predetermined period at a constant temperate say 37.1 degree C, otherwise accuracy will be affected. Since the temperature is to be kept accurately and precisely, an accurate heater control circuit is needed. The block diagram of dry block heater control is shown in the figure 5.

Accurate temperature control of cuvette with samples is achieved by maintaining the temperature of dry heater Aluminum block. Cuvettes are inserted to slots in the aluminum block and this block is electrically heated and temperature is set by the desired value by closed loop temperature control. Precise measurement of temperature demands a temperature transducer and signal processing. Since the temperature control is to be achieved by a microcontroller, digital output from the temperature transducer is needed. MAX31856 is an integrated circuit that contains all the functionality Precision thermo couple amplifier, like automatic Linearization correction for different types of thermocouples, minimum error %, higher resolution, and input protection against ±45V, minimum component count, built in fault detection and management, noise rejection, with digital output easily communicated to the host microcontroller using SPI communication.

BOM
BOM IS UPLOADED


Schematics
SCHEMATICS ARE UPLOADED
Instructions
Simulation study reveals that 15 watts of heater power is sufficient for the cuvette heater to maintain temperature up to 45 degree C. Since the calorimeter is for biomedical application, 37 degree C is the standard temperature to be set and maintain. Please refer the results of the simulation study results attached.
Heating the aluminum block: In conventional design resistive wires are used as heating element. An alternate method of heating with POWER MOSFETs is tried in this design. The advantages being reduced cost compared to the cost of resistive wire heating element. I purchased a 25 W heater (the one shown in the figure of the Al. block) costs around 4 USD where as the two MOSFETS used for the same purpose was purchased for less than 2 USD! MOSFETs are driven with a low gate voltage so as to bias it to operate in the linear region (ohmic region). So a considerable amount of power is dissipated across the MOSFET which causes heating that will be effectively “conducted” to the aluminum block by suitable heat conducting mounting.
It has been experimetnaly determined that a voltage in between 0 to 4 volts as VGs, the MOSFETS will be operating in the linear region, producing heat.
Temperature measurement: The most important part of this project is to sense the temperature precisely an accurately. By referring to the datasheet of MAX31856, it is highly suitable for this application. The chip contains a total solution to all temperature sensing problems that is commonly encountered by the designer. It uses thermo couple as the sensor that has very high accuracy. Since thermocouples output voltage/ degree C is of the order of few micro volts, a high gain amplifier is essential that is available in the chip.

The MAX31856 performs cold-junction compensation and digitizes the signal from any type of thermocouple. The output data is formatted in degrees Celsius. This converter resolves temperatures to 0.0078125°C, with an accuracy of ±0.15%. Also no need to worry about the stray voltages picked up by the thermo couple element. It can accept different types of thermo couples (K, J, N, R, S, T, E, and B) and also provides good rejection of power supply hum. The chip can easily interface into a low cost Micro controller having SPI Bus. Built in cold junction compensation, fault detection are additional features of this chip.All these features are used in the proposed design.

Microcontroller: PIC Microcontroller 16F15344 is selected for this application as the chip is very familiar to me. Also it has a built in DAC; the output from this DAC is used to bias the MOSFETs for controlled heating. Details about the controller can be had from the microchip web site (www.microchip.com).

Schematic Diagram: The entire schematic is attached. The hardware design is straight forward except the MOSFET based heater. 12V DC is used to power the heater so as to facilitate operation of the heater from 12 V batteries and at the same time avoids AC power supply interference. 16ch X 2 line LCD display is used to display the temperature reading and statuses. It is also easy to set and the read the temperature using 4 push buttons provided. Some I/O lines of the MCU are multiplexed for display and push button keys.

K type thermo couple is firmly inserted into the aluminum block y drilling a hole into the block from one face of the block. The thermo couple was positioned various locations on the block to find an optimum place where it can be attached to get correct reading and came to know that there is not much effect on the sensing point on the temperature settled.
PID Control: PID ( proportional, integral and derivative) control algorithm is used for temperature control. This control loop will calculate the PID parameters and the control value to control the heater is executed every 100 milli seconds that is sufficient due to the bulk volume of the heater block.
Fine tuning of PID values: Due to time limitations tuning of the PID parameters and the Loop tine has not yet completed.

Programming:
Program is written in C and compiled by the CCS C compiler. For details about the Compiler refer www.csinfo.com The source code written is attached. PID control is used to control the temperature of the cuvette. The source code is self explanatory.
Major portion of the program code is written for user interface. 4 Keys are designed for the purpose namely ( MENU key, UP key Down key and ENTER key ) LCD display shows the the various menus based on the Key Press.
By using these for keys, navigation through the menus and setting of temperature are possible. 37 degree C is the normal setting for the Menu.

Video

Project is nearing completion. Video will be updated after final testing.

Source Code
Code (Text):
  1.  
  2. // Temperature controller code written for PIC 16F15344 with MAX31856
  3. #include <heater.h>
  4. #use spi (MASTER, CLK=PIN_B4, DI=PIN_B5, DO=PIN_C0, MODE=0, BITS=8, STREAM=SPI_1)
  5. #use spi (MASTER, MODE=0, BITS=8, STREAM=SPI_2)
  6. #use spi (MASTER, MODE=0, BITS=8, STREAM=SPI_3)
  7.  
  8. #include <LCD.C>
  9. #include <float.h>
  10. #include <math.h>
  11. #include <string.h>
  12. #include <stdio.h>
  13. #include <stdint.h>
  14. #include <MAX31856.h>
  15.  
  16. uint8_t switchTime = 0;
  17. uint8_t pidTime = 0;
  18.  
  19. #INT_TIMER1
  20. void  TIMER1_isr(void)
  21. {
  22.    switchTime ^= 1;    pidTime = 1;}
  23.  
  24. //LCD Pin Defenitions
  25. #define LCD_ENABLE_PIN     PIN_A4
  26. #define LCD_RS_PIN         PIN_A5
  27. #define LCD_DATA4          PIN_C4
  28. #define LCD_DATA5          PIN_C5
  29. #define LCD_DATA6          PIN_C6
  30. #define LCD_DATA7          PIN_C7
  31.  
  32. // Keyboard pin definition
  33.  
  34. #define MENU               PIN_C7
  35. #define UP                 PIN_C6
  36. #define DOWN               PIN_C5
  37. #define ENTER              PIN_C4
  38. #define top_limit          600
  39. #define middle_val         300
  40. uint8_t menuSelect = 1;
  41. uint8_t select = 1;
  42. uint8_t heater_status = 0;
  43.  
  44. // PID paraiables
  45. int16 _fixed(1) kp = 5;
  46. int16 _fixed(1) ki = 1;
  47. int16 _fixed(1) kd = 0;
  48.  
  49. int16 _fixed(1) setpoint = 35.0;
  50. int16 _fixed(1) CurrentTemp;
  51. signed int16 _fixed(1) error;
  52. signed int16 _fixed(1) integral = 0;
  53. signed int16 _fixed(1) derivative = 0;
  54. signed int16 control_var;
  55. signed int16 _fixed(1) last_error;
  56. float currentValue;
  57.  
  58. // Prototype defentions
  59. void welcome_message(uint16_t delay);
  60. void Buttons_Init(void);
  61. void Output_Pin_Init(void);
  62. void Alert(uint8_t time);
  63. void menu_1(void);
  64. void menu_2(void);
  65. void menu_3(void);
  66. void menu_4(void);
  67. void menu_temp_edit(void);
  68. void MAX31856_Init(void);
  69. void WriteRegister(uint8_t reg_address, uint8_t data);
  70. float ReadThermocouple(void);
  71. void PID(void);
  72. void dac_heater_on(int16 _fixed(1) controlData);
  73. void check_error();
  74.  
  75. void eeprom_read_object(unsigned int ee_addr, void *obj_p, size_t obj_size);
  76. void eeprom_write_object(unsigned int ee_addr, void *obj_p, size_t obj_size);
  77.  
  78. // Main program starts from here
  79. void main() {
  80.  
  81.    setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);      //104 ms overflow
  82.    setup_dac(DAC_VSS_VDD|DAC_OUTPUT);
  83.    setup_spi(SPI_MASTER|SPI_CLK_DIV_4|SPI_XMIT_L_TO_H|SPI_SAMPLE_AT_END);
  84.  
  85.    lcd_init();
  86.    Output_Pin_Init();
  87.    welcome_message(2000);
  88.  
  89.    eeprom_read_object(0x0ff0, &setpoint, sizeof setpoint);
  90.    if(setpoint >45 || setpoint < 35) {
  91.       setpoint= 40;
  92.    }
  93.    enable_interrupts(INT_TIMER1);
  94.    enable_interrupts(GLOBAL);
  95.  
  96.    while(TRUE) {
  97.  
  98.       if(pidTime == 1 && heater_status == 1) {          PID();         dac_heater_on(control_var);      }
  99.    
  100.       if(switchTime == 1) {
  101.          Buttons_Init();
  102.          if(input_state(MENU) == 0 && switchTime == 1) {
  103.          
  104.                Alert(100);
  105.                switch(menuSelect) {
  106.                   case 1:
  107.                      menuSelect = 2;
  108.                      select = 1;
  109.                      menu_1();
  110.                      break;
  111.                   case 2:
  112.                      menuSelect = 3;
  113.                      select = 2;
  114.                      menu_2();
  115.                      break;
  116.                   case 3:
  117.                      menuSelect = 4;
  118.                      select = 3;
  119.                      menu_3();
  120.                      break;
  121.                   case 4:
  122.                      menuSelect = 1;
  123.                      select = 4;
  124.                      menu_4();
  125.                      break;
  126.              
  127.             }
  128.        }
  129.          else if(input_state(ENTER) == 0 && switchTime == 1) {
  130.        
  131.             Alert(100);
  132.             switch(select) {
  133.                case 1:
  134.                   heater_status = 1;
  135.                   break;
  136.                case 2:
  137.                   menu_temp_edit();
  138.                   break;
  139.                case 3:
  140.                   break;
  141.                case 4:
  142.                   heater_status ^= 1;
  143.                  if (heater_status==0) dac_write(0);
  144.                   break;
  145.                case 5:
  146.                   heater_status = 1;
  147.                   eeprom_write_object(0x0ff0, &setpoint, sizeof setpoint);
  148.             }
  149.        
  150.          }
  151.          else if(input_state(UP) == 0 && switchTime == 1) {
  152.        
  153.             Alert(100);
  154.             menu_temp_edit();
  155.             setpoint++;
  156.             check_error();
  157.             select = 5;
  158.        
  159.          }
  160.          else if(input_state(DOWN) == 0 && switchTime == 1) {
  161.        
  162.             Alert(100);
  163.             menu_temp_edit();
  164.             setpoint--;
  165.             check_error();
  166.             select = 5;
  167.        
  168.          }
  169.       }
  170.    }
  171. }
  172.  
  173. void Buttons_Init(void) {
  174.    set_tris_c(0b11110000);
  175.    port_c_pullups(0xF0);
  176. }
  177. // Initialize Pin C2 and Pin c3 as outputs
  178. // Pin c2: Buzzer
  179. // Pin c3: Switches_pin
  180.  
  181. void Output_Pin_Init(void) {
  182.    set_tris_c(0b00000000);
  183. }
  184.  
  185. void welcome_message(uint16_t delay) {
  186.    lcd_send_byte(0,0x01);
  187.    lcd_send_byte(0,0x28);
  188.    lcd_send_byte(0,0x80);
  189.    lcd_putc("   Welcome to   ");
  190.    lcd_send_byte(0,0xC0);
  191.    lcd_putc(" Heater Control ");
  192.    delay_ms(delay);
  193.    lcd_send_byte(0,0x01);
  194. }
  195.  
  196. void menu_1(void) {
  197.    lcd_init();
  198.    lcd_send_byte(0,0x01);
  199.    lcd_send_byte(0,0x80);
  200.    lcd_putc(" Set Temperature");
  201.    delay_ms(100);
  202.    lcd_gotoxy(6,2);
  203.    //if(Temp_eeprom != )
  204.    printf(lcd_putc,"%w",setpoint);
  205.    delay_ms(500);
  206. }
  207.  
  208. void menu_2(void) {
  209.    lcd_init();
  210.    lcd_send_byte(0,0x01);
  211.    lcd_send_byte(0,0x80);
  212.    lcd_putc(" Enter new Temp ");
  213.    lcd_gotoxy(6,2);
  214.    printf(lcd_putc,"%w",setpoint);
  215.    delay_ms(500);
  216. }
  217.  
  218. void menu_3(void) {
  219.  
  220.    lcd_init();
  221.    uint8_t status = 1;
  222.    if(heater_status == 0) {
  223.       lcd_send_byte(0,0x01);
  224.       lcd_send_byte(0,0x80);
  225.       lcd_putc("     PID off    ");
  226.       lcd_send_byte(0,0xC0);
  227.       lcd_putc("   Heater Off   ");
  228.    }
  229.  
  230.    while(heater_status == 1 && status == 1) {
  231.       lcd_send_byte(0,0x01);
  232.       lcd_send_byte(0,0x80);
  233.       lcd_putc("Set point: ");
  234.       lcd_gotoxy(12,1);
  235.       printf(lcd_putc,"%w",setpoint);
  236.       lcd_send_byte(0,0xC0);
  237.       lcd_putc("Reading : ");
  238.       lcd_gotoxy(11,2);
  239.       CurrentTemp = (int16 _fixed(1))currentValue;
  240.       printf(lcd_putc,"%w",CurrentTemp);
  241.    
  242.       if(input_state(MENU) == 0) {
  243.          delay_ms(10);
  244.          if(input_state(MENU) == 0) {
  245.          status = 0;
  246.          }
  247.       }
  248.    }
  249.    delay_ms(500);
  250. }
  251.  
  252. void menu_4(void) {
  253.  
  254.    lcd_init();
  255.    lcd_send_byte(0,0x01);
  256.    lcd_send_byte(0,0x80);
  257.    if(heater_status == 1) {
  258.       lcd_putc("  Heater is On  ");
  259.       lcd_send_byte(0,0xC0);
  260.       lcd_putc("Press Enter: OFF");
  261.    }
  262.    else {
  263.       lcd_putc(" Heater is  Off ");
  264.       lcd_send_byte(0,0xC0);
  265.       lcd_putc("Press Enter: ON ");
  266.    }
  267.    delay_ms(50);
  268. }
  269.  
  270. void menu_temp_edit(void) {
  271.    lcd_init();
  272.    lcd_send_byte(0,0x01);
  273.    lcd_send_byte(0,0x80);
  274.    lcd_putc("Use UP/DOWN Key");
  275.    lcd_gotoxy(7,2);
  276.    printf(lcd_putc,"%w",setpoint);
  277.    delay_ms(50);
  278. }
  279.  
  280. // Buzzer output
  281.  
  282. void Alert(uint8_t time) {
  283.    output_high(PIN_C2);
  284.    delay_ms(time);
  285.    output_low(PIN_C2);
  286.    delay_ms(time);
  287. }
  288.  
  289. // Initialization of MAX31856(Thermocouple amplifier to digital converter
  290. // with linearization IC)
  291. // input: none
  292. // output: none
  293.  
  294. void MAX31856_Init(void) {
  295.    WriteRegister(REG_CR0_W,CR0_INIT);
  296.    WriteRegister(REG_CR1_W,CR1_INIT);
  297. }
  298.  
  299. // Communication between uC and Max31856
  300. // inputs: Max31856 register address and curresponding bits
  301. // output: none
  302.  
  303. void WriteRegister(uint8_t reg_address, uint8_t data) {
  304.    spi_write(reg_address);
  305.    spi_write(data);
  306. }
  307.  
  308. // Thermocouple sensor to celcius converter
  309. // It will read linearized thermocouple temperature equavalent 24 bit digital
  310. // number and convert it into degree celcius
  311. // Input :  none
  312. // output:  degree celcius value(signed)
  313.  
  314. float ReadThermocouple(void) {   float temperature;   int32_t temp=0;   uint8_t byte_number = 3;  
  315. while(byte_number) {
  316.       temp = temp | spi_read();
  317.       temp <<= 8;
  318.       byte_number--;
  319.    }
  320.    temp >>= 13;
  321.    temperature = (float)temp* 0.0078125;
  322.    return temperature;
  323. }
  324.  
  325. // PID Function
  326. // Evaluates error and produce a control variable
  327. // Control variable will controlls the voltage that gives to the heater
  328. // This Function will work on every 100ms
  329.  
  330.  
  331. void PID(void) {  
  332.    pidTime = 0;
  333.    currentValue = ReadThermocouple();
  334.    error = setpoint - currentValue;
  335.    integral = integral + ki*error;
  336.    derivative = error - last_error;
  337.    control_var = (kp * error) + integral + (derivative * kd);
  338.    last_error = error;
  339. }
  340. void check_error() {
  341.    if(setpoint > 45) {
  342.       setpoint = 45;
  343.       lcd_init();
  344.       lcd_send_byte(0,0x01);
  345.       lcd_send_byte(0,0x80);
  346.       lcd_putc("     WARNING    ");
  347.       lcd_send_byte(0,0xC0);
  348.       lcd_putc(" MAX TEM REACHED");
  349.       delay_ms(1000);
  350.       Alert(200);
  351.       Alert(200);
  352.    }
  353.    else if(setpoint< 35) {
  354.       setpoint = 35;
  355.       lcd_init();
  356.       lcd_send_byte(0,0x01);
  357.       lcd_send_byte(0,0x80);
  358.       lcd_putc("     WARNING    ");
  359.       lcd_send_byte(0,0xC0);
  360.       lcd_putc(" MIN TEM REACHED");
  361.       delay_ms(1000);
  362.       Alert(200);
  363.       Alert(200);
  364.    }
  365.  
  366.  
  367. }
  368. // Heater control ======================
  369. void dac_heater_on(unsigned int16 control_var) {
  370.  
  371. if (heater_status ==1)
  372.    {control_var = (control_var*10+middle_val);
  373.    if (control_var >Top_limit) control_var=top_limit;
  374.    dac_write(control_var);
  375.    }
  376. else dac_write(0);  // heater switched off in case of error
  377.  
  378. }
  379. void eeprom_read_object(unsigned int ee_addr, void *obj_p, size_t obj_size)
  380. {
  381.      unsigned char *p = obj_p;
  382.      while (obj_size--) {         *p++ = read_program_eeprom(ee_addr++);     }
  383. }
  384.  
  385. void eeprom_write_object(unsigned int ee_addr, void *obj_p, size_t obj_size)
  386. {
  387.      unsigned char *p = obj_p;
  388.  
  389.      while (obj_size--) {         write_program_eeprom(ee_addr++, *p++);     }
  390. }
  391. ==============================================================================================
  392. max31856.h
  393. /-------------------------------------------------------------------------------------------------------------
  394. // MAX31856 header file
  395. // Created 20/1/2018
  396. // Created by Muneer KM
  397.  
  398. //------------------Registers-----------------------------------------------------------------------------------
  399.      
  400. #define REG_CR0_R               0x00       // CR0 Configuration register 0 Read Address
  401. #define REG_CR0_W               0x80      // CR0 Configuration register 0 Write Address
  402.  
  403. #define REG_CR1_R               0x01      // CR1 Configuration register 1 Read Address
  404. #define REG_CR1_W               0x81      // CR1 Configuration register 1 Write Address
  405.  
  406. #define REG_FAULTMASK_R         0x02      // FAULT MASK Register Read
  407. #define REG_FAULTMASK_W         0x82      // FAULT MASK Register write
  408.  
  409. #define REG_CJHF_THRESHOLD_R    0x03      // Cold Junction High Fault Threshold Register Read
  410. #define REG_CJHF_THRESHOLD_W    0x83      // Cold Junction High Fault Threshold Register Write
  411.  
  412. #define REG_CJLF_THRESHOLD_R    0x04h      // Cold Junction Low Fault Threshold Register Read
  413. #define REG_CJLF_THRESHOLD_W    0x84h      // Cold Junction Low Fault Threshold Register Write
  414.  
  415. #define REG_LTHFT_MSB_R         0x05      // Linearized Temperature High Fault Threshold MSB Register Read
  416. #define REG_LTHFT_MSB_W         0x85      // Linearized Temperature High Fault Threshold MSB Register write
  417.  
  418. #define REG_LTHFT_LSB_R         0x06      // Linearized Temperature High Fault Threshold LSB Register Read
  419. #define REG_LTHFT_LSB_W         0x86      // Linearized Temperature High Fault Threshold LSB Register Write
  420.  
  421. #define REG_LTLFT_MSB_R         0x07      // Linearized Temperature Low Fault Threshold MSB Register Read
  422. #define REG_LTLFT_MSB_W         0x87      // Linearized Temperature Low Fault Threshold MSB Register Write
  423.  
  424. #define REG_LTLFT_LSB_R         0x08      // Linearized Temperature Low Fault Threshold lSB Register Read
  425. #define REG_LTLFT_LSB_W         0x88      // Linearized Temperature Low Fault Threshold lSB Register Write
  426.  
  427. #define REG_CJT_OFFSET_R        0x09      // Cold Junction Temperature Offset Register Read
  428. #define REG_CJT_OFFSET_W        0x89      // Cold Junction Temperature Offset Register Write
  429.  
  430. #define   REG_CJ_TEMP_MSB_R     0x0A      // Cold junction Temperature Register MSB Read
  431. #define   REG_CJ_TEMP_MSB_W     0x8A      // Cold junction Temperature Register MSB Write
  432.  
  433. #define   REG_CJ_TEMP_LSB_R     0x0B      // Cold junction Temperature Register lSB Read
  434. #define   REG_CJ_TEMP_LSB_W     0x8B      // Cold junction Temperature Register lSB Write
  435.  
  436. #define REG_LT_THERMOCOUPLE_B2  0x0C      // Linearized Thermocouple Temperature Byte 2
  437. #define REG_LT_THERMOCOUPLE_B1  0x0D      // Linearized Thermocouple Temperature Byte 1
  438. #define REG_LT_THERMOCOUPLE_B0  0x0E      // Linearized Thermocouple Temperature Byte 0
  439.  
  440. #define REG_FAULT_STATUS        0x0F      // Fault Status Register
  441.  
  442. //-----------------------------------------------------------------------------------------------------------------
  443. // CR0 Bits
  444.  
  445. #define CR0_AUTOMATIC_CONVERSION  0x80
  446. #define   CR0_1SHOT               0x04
  447. #define CR0_OPENCIRCUIT_FAULT     0x10
  448. #define   CR0_CJ_SENSOR_DISABLE   0x08
  449. #define CR0_FAULT_INT             0x04
  450. #define CR0_FAULT_CLEAR           0x02
  451. #define   CR0_FILTER_50HZ         0x01
  452.  
  453.  
  454. // CR1 Bits
  455.  
  456. #define CR1_1SAMPLE               0x00
  457. #define CR1_2SAMPLE               0x10
  458. #define CR1_4SAMPLE               0x20
  459. #define CR1_8SAMPLE               0x30
  460. #define CR1_16SAMPLE              0x40
  461.  
  462. #define CR1_TC_B                  0x00
  463. #define CR1_TC_E                  0x01
  464. #define CR1_TC_J                  0x02
  465. #define CR1_TC_K                  0x03
  466. #define CR1_TC_N                  0x04
  467. #define CR1_TC_R                  0x05
  468. #define CR1_TC_S                  0x06
  469. #define CR1_TC_T                  0x07
  470. #define CR1_VOLATAGE_GAIN8        0x08
  471. #define CR1_VOLATAGE_GAIN32       0x0C
  472.  
  473. // FAULT MASK Bits
  474.  
  475. #define MASK_CJHF                0x20
  476. #define MASK_CJLF                0x10
  477. #define MASK_TC_HF               0x08
  478. #define MASK_TC_LF               0x04
  479. #define MASK_OVorUV              0x02
  480. #define MASK_TC_OC               0x01
  481.  
  482. #define CR0_INIT   (CR0_AUTOMATIC_CONVERSION + CR0_OPENCIRCUIT_FAULT)
  483. #define CR1_INIT   (CR1_2SAMPLE + CR1_TC_K)
  484. //------------------------------------------------------
  485.  
CAD Files
Attach or link to any CAD files if relevant to your project.
You need to be logged in to comment