I have an R8C/33T application that involves occasional writing (at user request, to change settings) to data flash ROM (using the Renesas Virtual EEPROM code). Because flash operations are only guaranteed down to a supply voltage of 2V7, I want to block flash writing operations when the battery voltage falls below that level. This MCU has three voltage monitors: Vdet0 to Vdet2. I've disabled Vdet2, and use Vdet0 to reset the MCU when Vcc reaches about 1V9. I've set Vdet1 threshold to 2V8, disabled its interrupts but enabled the Vdet1 detector. The register flag vw1c3 should signal whether Vcc is above 2V8 (vw1c3 = 1) or below that voltage (vw1c3 = 0). But it's not doing that! To debug this issue, I've placed in the Main() loop temporary code that lights a green LED when vw1c3 = 1 or an orange LED when vw1c3 = 0. As I wind the supply voltage down, the green LED stays on until the Vdet0 reset occurs (around 1V9, as programmed). When I then wind the supply voltage back up slowly, when it comes out of reset the orange LED is lit, but switches to green around 2V1, well below the Vdet1 set-point. So there are two problems: the flag's non-operating when the supply voltage falls, and the grossly inaccurate detection voltage when the voltage is rising. Does anyone have experience with these issues, and able to offer any advice? Thanks, Daniel
↧