Procedures to write to OSCCON register

Post your requests and ideas on the future development of mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
OT
Posts: 581
Joined: 19 May 2005 05:08
Location: Fairbanks, Alaska

Procedures to write to OSCCON register

#1 Post by OT » 12 Dec 2007 08:20

The register that controls the oscillators, OSCCON can only be written to with a special write unprotect sequence that requires use of assembly due to tight timing according to the reference manual. :evil: The microchip C compiler provides macros to carry out a write unprotect of this register. It would be natural that this was supported in ME compilers as well.

As it is now, without knowledge of Assembly language, it is for instance not possible to use the alternate external 32kHz oscillator to wake the dsPIC up from sleep, which is the only way to provide timed wake-up with really low power consumption (WDT will be on the size of order 100x as much current, so don't tell me to use that).
Control of this register could be important for other power management as well as safeguarding in case of oscillator failure.

There is a request for this in mikroC for dsPIC forum as well:
http://www.mikroe.com/forum/viewtopic.php?t=10364

I posted a request for a temporary solution to activate the 32kHz oscillator in the main dsPIC pacal forum:
http://www.mikroe.com/forum/viewtopic.php?t=12712

rmteo
Posts: 1330
Joined: 19 Oct 2006 17:46
Location: Colorado, USA

#2 Post by rmteo » 28 Dec 2007 02:53


Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 Wish List”