Forum: Mikrocontroller und Digitale Elektronik RTC 32 zählt bei Spannungsausfall nicht weiter?


von M. E. (edbey)


Angehängte Dateien:

Lesenswert?

Hallo,

ich habe eine RTC 32 Routine für ein ATXMEGA programmiert, die Routine 
funktioniert an sich ganz gut und löst jede 1s einen Interrupt aus.

Ich habe aber das Problem nachdem der Versorgungsstrom abgeschaltet 
wird, da zählt die Routine nicht mehr weiter obwohl am Vbat-Pin der µC 
die 5V vom Battary liegen!, nachdem der Versorgungsstrom nochmal anlegt 
wird, zählt das RTC von neu und fäng bei der Anfangswert wieder an!

Hat jemand von euch diesen Fall erlebt, weiss bzw. woran das liegen 
könnte?.

im Anhang findet ihr die RTC32 Code.txt

vielen Danke

von Ich (Gast)


Lesenswert?

Ein Auszug aus 
http://www.atmel.com/Images/Atmel-8331-8-and-16-bit-AVR-Microcontroller-XMEGA-AU_Manual.pdf

Main Power Restore and Start-up Sequence
At every startup after main power is restored, the software should:
1.     Control the main reset source to determine that a POR or BOD took 
place.
2.     Check for power on the VBAT pin by reading the BBPWR flag.
3.     Read the power supervisor flags to determine further software 
action:
121
1.    If all power supervision flags are cleared, the battery
backup system runs as normal. The software should
enable access to the battery backup system and check the crystal 
oscillator failure flag. If the flag is set, the
software should assume that the RTC32 counter value is invalid and take 
appropriate action.
2.    If any power supervision flags are set, it indicates the battery 
backup system has lost power sometime dur-
ing the period when the rest of the device was unpowerer
d. Software should assume that the configuration
and RTC32 value are invalid and take appropriate action.

das hast du ja sicher eingehalten oder? Beim Überfliegen ist mir 
aufgefallen, dass das Count Register immer in der init zurückgesetzt 
wird. Führst du diese init immer aus?
1
  /* Reset CNT register */
2
  SetCount_v(0);

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.