|
![]() MCU User Forum
![]() OSCICN|=0x20 does not work for 411
|
| next newest topic | next oldest topic |
| Author | Topic: OSCICN|=0x20 does not work for 411 |
|
aaa1982 Member |
Hi: The program can not enter supsend mode by OSCICN|=0x20; The structure of the program is like below; } I found that if the RTC peripheral is not initilized or the RTC interrupt is not enabled,the OSCICN|=0x20 dose not work. (I determine whether the supsed mode is enter by the current consumption) I know the RTC can wake up mcu from suspend mode,but if it has any relationship about the effect of suspend mode? aaa1982
[This message has been edited by aaa1982 (edited August 10, 2010).] IP: Logged |
|
Scotty Member |
Hi aaa1982, I found that if the RTC peripheral is not initilized or the RTC interrupt is not enabled,the OSCICN|=0x20 does not work. When the smaRTClock Missing Clock Detector is enabled, OSCFAIL (RTC0CN.5) is set by hardware if RTCCLK remains high or low for more than 50 µs. Regards, Scotty IP: Logged |
|
aaa1982 Member |
Hi Scotty: If I initilized the RTC(settings in RTC0XCN correctly) But donot enable the RTC interrupt, it also does not work. I remember I once use 410 and it could enter suspend mode only by OSCICN|=0x20,nothing extra operation is required. For smaller size, I change to 411 and use the suspend+RTC wakeup mode which silabs provided in his example F41x_RTC_Suspend.c. It also work correctly.
IP: Logged |
|
aaa1982 Member |
The real code is as below
RTC0KEY = 0xA5; // unlock the RTC interface RTC_Write (RTC0CN, 0x80); // enable RTC RTC_ClearCapture(); // clear CAPTUREn registers RTC_SetBits (RTC0XCN, 0x40); // set crystal mode // wait for clock valid RTC_SetBits (RTC0CN, 0x40); // enable missing clock detector RTC_SetBits (RTC0CN, 0x02); // transfer capture to clock OSCICN = 0x87; IP: Logged |
|
aaa1982 Member |
Is there anyone may give me some advise? OSCICN|=0x20 still not work. I have already spent four days to try to fix the problem but it still there. Is there any official ways to inform this problem in china? I was afraid of using 410 or 411 in my new project now IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() |
|
Have you seen our MCU Knowledge Base?