I'm trying to use a Load cell with the INA 125P amplifier with my FRDM KL-43Z board. Currently, I have it connected like so with the Arduino being replaced with the KL43Z analog input (
Port B bit 0
), 5V
and ground
pins.
What I have decided to do is use the ADC module of the KL43Z code (MCU Expresso):
SIM->SCGC5|= SIM_SCGC5_PORTB_MASK;
PORTB->PCR[0]=0x000;
SIM->SCGC6|= SIM_SCGC6_ADC0_MASK;
ADC0->CFG1=0x40|0x10|0x04|0x00;
ADC0->SC2 &= ~0x40;
ADC0->SC1[0]=0b001000;
volatile static int i = 0 ;
while(1) {
i++ ;
while(!(ADC0->SC1[0]&0x80)){
}
result= ADC0->R[0];
printf("res: %d\n", result);
ADC0->SC1[0]=0b001000;
}
The result of the ADC register
value fluctuates greatly. Sometimes it will sit at around an average of 64 but will then change values significantly and decrease. Applying a force to the load cell seems to have no effect.
If anyone could provide some tips or shed some light on my situation it would be greatly appreciated as I am new to working with this kind of equipment.
Additionally, what would be the ideal gain resistance. I have tried using a 75 Ohm
resistance, (20 kg
load cell 1mV/V
) but have also seen a video that uses one around 33 Ohms
, so I'm not certain what value is ideal. Load cell data sheet is available here.