You are currently browsing the Pilot’s Logbook weblog archives for the day 31. January 2008.
- AV16/32 (6)
- builtin (1)
- Chapter 1 (2)
- Chapter 12 (3)
- Chapter 14 (1)
- chapter 2 (1)
- Chapter 3 (1)
- Chapter 4 (1)
- Chapter 5 (4)
- Configuration (1)
- Events (2)
- Flying (4)
- I2C (5)
- Linux (2)
- MPLAB 8.00 (5)
- mplab c30 v3.02 (11)
- PIC24 (2)
- PIC32 (11)
- Tips and Tricks (15)
- Tools (11)
- Warnings (2)
- 5. January 2009: Tremor
- 27. December 2008: Merry Christmas and Happy New Year
- 19. November 2008: Bending the laws of physics
- 13. November 2008: Electronica 2008
- 6. November 2008: Deep Blue PIC32
- 4. November 2008: MIPS DSP Libraries
- 1. November 2008: Inexplicably Working Errata
- 26. October 2008: PIC32, Harvard or Von Neumann
- 22. October 2008: Back online, Excuses and the Blues Brothers
- 28. July 2008: Not a dsPIC!
Blogroll
PIC24
PIC32
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, Chapter 5, mplab c30 v3.02 | No Comments »