summaryrefslogtreecommitdiff
path: root/PicCoreDocs.mdwn
blob: 499c1871060963f60ef54ff32e8da356bbabe85d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# <a name="PicCore User&#39;s Guide"></a><a name="_PicCore User&#39;s Guide"></a> PicCore User's Guide

## <a name="30 Second Overview"></a> 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](http://sources.redhat.com) 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:

1. Application code (that's your code) doesn't touch the [[PicCore]] directory, so multiple projects can use the same [[PicCore]] folder.
2. CAN initialize, transmit and receive drivers and queues (circular FIFO's)
3. UART initialize, transmit and receive drivers and queues (circular FIFO's)
4. Application and [[PicCore]] error handling routines
5. Pretty tight and expansive interrupt routines, with hooks for user code.
6. ADC initialize and run
7. TIMER1 and TIMER2 initialize and interrupt routines

## <a name="More In-Depth Overview"></a> 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...

## <a name="Getting Started"></a> Getting Started

1. Get the [[PicCore]] directory from CVS.
2. Setup your MPLAB IDE to include the [[PicCore]] files.
3. Get the pic\_config.h template and customize it for your application.
4. Include `#include "\piccore\pic_include.h"` in your modules which need it.
5. Go nuts.

...more details soon...

## <a name="PicCore Modules:"></a> [[PicCore]] Modules:

- [[pic_can.c: CAN (Controller Area Network) routines|PicCoreDocsCan]]
- [[pic_error.c: Error handling routines|PicCoreDocsErrors]]
- [[pic_serial.c: Serial (UART) routines|PicCoreDocsSerial]]