dsPIC Development
Recently I have done some firmware programming using various flavors of the
Microchip dsPIC family of 16-bit microcontrollers with digital signal processing (DSP) engines. Below I share a couple of C libraries I have written that were originally used on DC brushless motor control projects.
dsPIC Helper Library
The dsPIC Helper Library is a small collection of macros and functions
written in C that I have found useful while developing and prototyping
Microchip dsPIC-based embedded software. It includes a 16-bit
CRC-CCITT implementation, a stand-in for the missing
<stdint.h>
C99 standard header file for defining types like
int16_t
, a stand-in for the missing
<stdbool.h>
C99 standard header file for defining the Boolean type, and various low-level
macros for emitting special instructions, and for manipulating the interrupt priority level (IPL) of the microcontroller.
The library builds for dsPIC30F6015, dsPIC30F6010A, and
the dsPIC30F6010 microcontrollers, though you can easily modify the
Makefile
to build for other targets as well.
I have released this code under the
GNU General Public License with the hope that others might find it useful.
See the
table of attachments below to download the source or the documentation.
You can
browse the sources here.
You can find the
online documentation here.
dsPIC Threads Library
The dsPIC Threads Library provides basic cooperative multitasking/multi-threading to
the Microchip dsPIC family of microcontrollers. It is written mostly in C. It implements a simple round-robin style
task switcher.
The cooperative multitasking design results in task switches that are less expensive than would be possible with preemptive multitasking. This design also means that the implementation
never disables interrupts.
This library provides basic thread start and stop functions, a way to assign thread-local storage, and a way to check stack usage.
The library builds for dsPIC30F6015, dsPIC30F6010A, and
the dsPIC30F6010 microcontrollers, though you can easily modify the
Makefile
to build for other targets as well.
I have released this code under the
GNU General Public License with the hope that others might find it useful.
See the
table of attachments below to download the source or the documentation.
You can
browse the sources here.
You can find the
online documentation here.