You are currently browsing the Pilot’s Logbook weblog archives for the day 31. January 2008.
- 1. March 2010: Solve this!
- 29. January 2010: PIC32 Starter Kits Software v2.0
- 27. January 2010: Animation on the MikroE PIC32MX4 Multimedia Board
- 26. December 2009: Merry Christmas and Happy New Year
- 18. November 2009: MikroE MX4 Multimedia Board
- 30. September 2009: Good old printf() (continued)
- 26. August 2009: Changing habits... and dreaming a bit
- 24. July 2009: Where is my RAM?
- 15. July 2009: Olimex PIC-P32MX board
- 28. June 2009: A Great New Board from mikroElektronika
Archive for 31. January 2008
More on Chapter 5 Tips and Tricks and builtin functions
31. January 2008 by pilot.
If after yesterday’s posting you though things were getting ugly (I agree), you will be pleased to learn that since the introduction of MPLAB C30 v3.02 things have improved considerably. After all, performing the unlock sequences should not be an “impossible” task in C requiring super advanced inline assembly programming skills!
Four new builtin functions of the compiler come to our rescue:
- __builtin_write_RTCWEN( void)
- __builtin_write_NVM( void);
- __builtin_write_OSCCONL( unsigned char value);
- __builtin_write_OSCCONH( unsigned char value);
[Note: a double underscore preceeds each function name]
They give us complete access to the RCFGCAL, NVM and OSCCON control registers by performing the proper unlock sequences.
You will find a complete (long) list of builtin functions well documented in Appendix B of the MPLAB C30 compiler.
Posted in Builtin, Tips and Tricks, Interrupts, MPLAB C30 | No Comments »