- 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
Chapter 5 Excercises
The exercises assigned in Chapter 5 are actually quite advanced and are mostly meant to give you ideas of the kind of powerful things you can do in C using interrupts (and simple state machines). The following chapters, in particular in the third part of the book, will cover several such examples. The NTSC composite video generator (Exercise 5.3) is well described in Chapter 12, but you will be able to find the solution to the other two exercises in other (perhaps unexpected) places.
Excercise 5.2 is perhaps my favourite as you will find an example of (interrupt based) radio receiving routines (for a very special protocol) in the code attached to application note AN745, available for download as part of the vast collection of application notes available on Microchip’s web site.
Check the “rxi.c” module in particular. The code was written to be compatible with the HiTech C compiler and the CCS compiler for the PIC16 architecture, but you should find it easy to port for the PIC24 and compile it with MPLAB C30.
The solution to Exercise 5.1 is not going to be very dissimilar…
Leave a Reply
You must be logged in to post a comment.