CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Cant get into idle mode

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
/dev/human



Joined: 01 Sep 2008
Posts: 19
Location: Earth / Europe / Germany

View user's profile Send private message

Cant get into idle mode
PostPosted: Fri Sep 12, 2008 5:32 am     Reply with quote

Meanwhile I'm feeling really stupid running in every possible trap setup (especially for me). Embarassed

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







PostPosted: Fri Sep 12, 2008 8:48 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 13, 2008 10:26 am     Reply with quote

... 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...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group