PicCore User's Guide
30 Second Overview
PicCore is a collection of C modules which exist in a single direcotry called (surprise) /piccore
. A single #include
is added to your code which links in all the various PicCore routines and datastructures. PicCore is highly configurable using a single configuration file which uses #defines to include or exclude portions of the code (a la the eCos RTOS). Also, peripherals are included or not based on the type of processor you have (for example, the CAN functions are included for the PIC18Fxx8 micros but not the PIC18FXX2 micros). Features currently include:
- Application code (that's your code) doesn't touch the PicCore directory, so multiple projects can use the same PicCore folder.
- CAN initialize, transmit and receive drivers and queues (circular FIFO's)
- UART initialize, transmit and receive drivers and queues (circular FIFO's)
- Application and PicCore error handling routines
- Pretty tight and expansive interrupt routines, with hooks for user code.
- ADC initialize and run
- TIMER1 and TIMER2 initialize and interrupt routines
More In-Depth Overview
Why #defines and not some single library, you might ask? Becuase the #defines are way, way faster when running on PIC. We could compile PicCore as a library, but then there's a ton of overhead choosing what to run and when, and in particular, the interrupt routines slow way down as you have to check every interupt to see if it's enabled. Since PIC applications usually need to be run fast (you've only got 10MIPS, you know!) we were willing to give up the nice single library approach for speed and small code size.
...more coming...
Getting Started
- Get the PicCore directory from CVS.
- Setup your MPLAB IDE to include the PicCore files.
- Get the pic_config.h template and customize it for your application.
- Include
#include "\piccore\pic_include.h"
in your modules which need it. - Go nuts.
...more details soon...