Author Topic: M5221X RTC  (Read 8530 times)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
M5221X RTC
« on: June 07, 2008, 04:36:53 PM »
Hi All

A feature of the M5221X devices is that they have a battery backup for the RTC (can use a 32kHz crystal) and the internal SRAM. This means that SRAM data content and also the time (date) can be retained during power down.

The documentation about the use of these and their characteristics are not that clear so I though it would be interesting to do some tests. The support is being added to the uTasker project to enable simple configuration where required.

1. It was possible to activate the 32kHz RTC oscillator. This requires the external 32kHz crystal to be connected to the pins normally used for UART0 RX/TX, where the secondary functions are RTC_EXTAL and  RTC_XTAL respectively.
This seems rather unfortunate since there are no alternative pins for the UART0 RX/TX lines, although the corresponding RTS/CTS lines are not affected. UART0 doesn't no seem to be usable of the external RTC crystal is used.
Furthermore it was found that it was not necessary to program the configuration of the pins in the PUAPAR register, but only necessary to configure the source of the oscillator in MCF_CLOCK_RTCCR. Reading PUAPAR back doesn't reflect this configuration so it must be controlled parallel to this.

2. The M52210DEMO board was used to test current consumption. This has a large "Super"Capacitor of 1.5F on the board which is charge via a resistor from the 5V supply when the board is powered.
It takes about 40 minutes for the empty capacitor to be charged to about 3.3V since the current is limited via an equivalent resistance of about 280R.
When the RTC crystal is not configured, the current consumption in power down state (Vstby) was measured to be about 2uA.
When the RTC crystal was configured it remained in operation during the power down state, drawing about 15uA current.

3. It has been found that the RTC registers can be viewed and modified using the register viewer with the CodeWarrior debugger but not in the memory area when they exist (eg. 0x400003c0). The reason for this is presently not known!

4. At the time of writing the actual use of the RTC has not been successful since it has not yet been possible to starts its counting operation. This difficulty has also been experienced by other users and it is hoped that the cause for this can be identified shortly: http://forums.freescale.com/freescale/board/message?board.id=CWCFCOMM&message.id=1871&jump=true#M1871

Regards

Mark

Update: the correct operation was achieved, whereby difficulties were mainly due to the register access RTCGOCL which must be as long access, although its contents are onle 16 bits wide. 16 bit writes are not accepted. (full details can be found in the linked thread).

Further information concerning the current consumption of Vbatt in operating and standby states can be found here: http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=6407&query.id=118275#M6407
« Last Edit: September 24, 2009, 07:20:38 PM by mark »