Thanks Melanie, you are a star worked first time, love you to bits.
Thanks Melanie, you are a star worked first time, love you to bits.
Would like to add some sort of Auto calibration to the system if possible, to iron out any variation is resistor tolerances across different PCB boards. The PIC I am using has some on-chip EEPROM memory. I was thinking of something on the lines of, at first power up, as part of the manufacturing process, the board is connected to a known set voltage (lets say 90.0 volts for example) and the firmware calculates the required divison/multiplication to get the display to read bang on 90.0 Volts. Any suggestions would be very appreciated.
Mark in Spain.
That's quite simple... say on power-up a Button is held for 5 Seconds... the LCD Displays...
"Adjust for 90v"
"And Press SET"
When the Button is pressed, the ADC WORD value (containing the 90.0v reading) is then saved as a HighBYTE and LowBYTE component into two seperate EEPROM locations (since each EEPROM location can only save a BYTE).
When you power-up normally, rather than jumping into the Calibration routine (described above), your program instead loads the CAL value from EEPROM, and you would use the CAL value in your math with a modified routine, rather than the 1023 value routine previously exampled earlier in this thread...
0.1% Resistors are probably cheaper than paying the Labour to run through a CAL routine at manufacture. One of your divider Resistors could instead be a multi-turn high-stab precision POT (so you could also Calibrate for 90.0v using that method instead).
Bookmarks