This demo shows how to use the complex version of the system tick. It can also be used an example of how to overwrite the default netcruzer tick with a custom implementation. It is enabled by adding the following line to the projdefs.h file:
The system tick uses Timer 1, and has a period of 1ms. Each 1ms an interrupt is triggered, and the 32-bit system tick is incremented. To make code smaller and more efficient, various functions are available for using 8, 16 and 32-bit variables for implementing timers and delays. The 16-bit variants are the most efficient, and create the smallest code, seeing that the native data size for this CPU is 16-bits. The 8-bit variants use the least RAM. The 32-bit variables can create the longest delays.
This project can be run on any of our SBC66 Netcruzer boards. For prototyping, we recommend combining this board with a Prototyping Board, like the PT66ECI for example. This low cost prototyping board makes all the I/O ports of the SBC66 board available via marked labels on the PCB. It also provides a reset and firmware button that simplifies prototyping.
This project is located in the "src/demos/general/tick_demo1_complex" folder of the Netcruzer Download. To compile for Netcruzer Board, open this project in MPLAB X, and select the "Project Configuration" for desired board. For example "SBC66ECL_R2" for the SBC66ECL Revision 2 board. For details click here.
A common error is "The system cannot find the path specified". This generally means you don't have the required XC16 compiler version installed. Go to "Project Properties", and select your installed XC16 compiler in the "Project Configuration" section.
After compiling (build), the board can be programmed via the USB Bootloader or a PIC Programmer. USB Programming is simplified when using the SBC board together with a Prototype Board.
2012-08-08, David H. (DH):