CW7.0 for MCF52211 RTC, can't access MCF_RTC_GOCU and MCF_RTC_GOCL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CW7.0 for MCF52211 RTC, can't access MCF_RTC_GOCU and MCF_RTC_GOCL

1,660 Views
oldmee
Contributor I
.1. In CW 7.0 IDE, after create a project for M52210. In MCF52210_RTC.h file , missing declaration for registers
   RTCGOCU and RTCGOCL. so I add following lines to that file.
 
  #define MCF_RTC_GOCU                         (*(vuint16*)(&__IPSBAR[0x3F4]))
  #define MCF_RTC_GOCL                         (*(vuint16*)(&__IPSBAR[0x3F8]))
 
2. So far , I have no a good idea to init both registers(ABOVE).
    Have tried  very hard to init MCF_RTC_GOCU and MCF_RTC_GOCL, but from IDE register view funcaton,  that two always 0000.
    I also check their memory  , it also is 0000, 0000. but other registers are ok to access. such as DAYS, CCR...
  
3. Here is some code what I tried init RTC,

     MCF_CLOCK_RTCCR = 0x10;
   
    
     MCF_RTC_RTCCTL = 0x80;
    
     MCF_RTC_DAYS =     MCF_RTC_DAYS_DAYS(30);
     MCF_RTC_HOURMIN =  MCF_RTC_HOURMIN_MINUTES(30);
     MCF_RTC_HOURMIN =  MCF_RTC_HOURMIN_HOURS(5);
     MCF_RTC_SECONDS =  MCF_RTC_SECONDS_SECONDS(20);
    
     MCF_RTC_ALRM_DAY = MCF_RTC_ALRM_DAY_DAYSAL(30);
     MCF_RTC_ALRM_HM =  MCF_RTC_ALRM_HM_MINUTES(30);
     MCF_RTC_ALRM_HM =  MCF_RTC_ALRM_HM_HOURS(5);
     MCF_RTC_ALRM_SEC = MCF_RTC_ALRM_SEC_SECONDS(45);   // 5 seconds after the RTC enabled
    
    
     MCF_RTC_GOCU = 0x40;
     MCF_RTC_GOCL = 0x08;
    
     temple1=MCF_RTC_GOCU;
     temple2=MCF_RTC_GOCL;
    
     MCF_RTC_RTCIENR =0x0f;
    // MCF_RTC_RTCCTL = MCF_RTC_RTCCTL_EN;
 
4 here is some assembler code
     MCF_CLOCK_RTCCR = 0x00;
2000090A: 423940120012    clr.b    0x40120012 (0x40120012)
     MCF_RTC_RTCCTL = 0x00;
20000910: 42B9400003D0    clr.l    0x400003D0 (0x400003d0)
    
     MCF_RTC_GOCU = 0x0000;
20000916: 4279400003F4    clr.w    0x400003F4 (0x400003f4)
     MCF_RTC_GOCL = 0x8000;
2000091C: 303C8000        move.w   #-32768,d0
20000920: 33C0400003F8    move.w   d0,0x400003F8 (0x400003f8)
    
     in there, I can see 0x8000(#-32768)  loaded to D0. then step to next
     in IDE  MCF_RTC_GOCL or memory of 0x400003F8  is 0000
   
    after excaution, it shoud be 0x8000.
 
 
????  something wrong ?
 
 
OLdme
Labels (1)
0 Kudos
1 Reply

323 Views
mjbcswitzerland
Specialist V
Hi OLdme

Have you managed to solve this problem in the meantime?

I confirm the same difficulties on my M52210DEMO board - I can't get the RTC counting since the divider always remains at 0x0000. I have tried bus clock source and 32k RTC clock source with no difference. The 32k crystal does oscillate, the contents of the RTC can be written and these also remain valid after power down (and the RTC crystal continues to oscillate in power down, with battery backup).

Strange is that I can not see the register values when using memory debugger - the RTC block is displayed as all 0xffffffff. The following DMA timer blocks can however be seen normally in the memory window. I have never experience this before (??)

See the following thread where I will add more details:
http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&thread.id=4605

Regards

Mark

www.uTasker.com

0 Kudos