View previous topic :: View next topic |
Author |
Message |
/dev/human
Joined: 01 Sep 2008 Posts: 19 Location: Earth / Europe / Germany
|
Cant get into idle mode |
Posted: Fri Sep 12, 2008 5:32 am |
|
|
Meanwhile I'm feeling really stupid running in every possible trap setup (especially for me).
This time I can't enter the idle mode on a 18F4523. Trying to modify the osccon register, the idle bit always reads 0 for sleep mode and not 1 for idle. What the heck can prevent osccon bit 7 to be set?
Thanks again (and sorry)
/dev/human |
|
|
Ttelmah Guest
|
|
Posted: Fri Sep 12, 2008 8:48 am |
|
|
What are you actually trying to do?. It sounds as if you are trying to set the OSCCON register directly?. If so, look instead at using the setup_oscillator function. The OSC_IDLE_MODE constant, enables the IDLEN bit. OR this with the required oscillator mode, and then call sleep, to enter idle mode.
If you don't set this bit first, calling sleep puts the chip to sleep, but if you call this first, then the sleep instruction, triggers 'idle'.
Best Wishes |
|
|
/dev/human
Joined: 01 Sep 2008 Posts: 19 Location: Earth / Europe / Germany
|
|
Posted: Sat Sep 13, 2008 10:26 am |
|
|
... I'm trying to power the PIC down as much as I can but keeping timer 1 alive for periodical wake-up interrupts. Clock source is the internal RC osc.
The question why I'm asking is that neither setup_oscillator () nor direct writing to OSCCON seems to set the IDLEN flag. Currently the only proof for that matter is MPSIM and observation that the PIC actually does not wake up. What else seems so strange to me is that even modifying the flag using "register watches" of MPSIM is not working. Hence my conclusion, some other setting is prohibiting the idle mode and I can't figure out which one. On the other side I may be totally wrong with this assumption.
/dev/human
Addendum:
I found here: http://www.ccsinfo.com/forum/viewtopic.php?t=26114&highlight=idle+mode
that power modes are not supported by PSIM and with ICD2. So I need to look for the 18F4523 and ICD-U40. Could be that I found the helping hint... |
|
|
|