I think I understand what you guys mean, this would be the metacode
set BODEN config bit to 1
set BOD bit to 1
set POR bit to 1
read level from eeprom / set level
mainloop
check for BOD/POR bits at PCON register
if BOD=0 then wait for POR=0 and change to next level and write it to eeprom.
goto mainloop
end
Is this correct?
I have some questions:
What would happen if power is lost while writing to eeprom?
Can this be handled with PBP without using interrupts?
Regarding the cap, I don't have a oscilloscope to see the discharge curve, it seems to last around 1seg to fall below 2v but this measurement was done by the eyemeter.
Bookmarks