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.

Topic attachments
  Attachment Size Date Comment
pdfpdf dspic-helper.pdf 62.9 K 14 Nov 2008 - 22:15 dsPIC Helper Library Documentation
pdfpdf dspic-threads.pdf 59.4 K 14 Nov 2008 - 22:16 dsPIC Threads Library Documentation
ziptgz dspic-helper-1.0-src.tgz 19.7 K 14 Nov 2008 - 23:04 dsPIC Helper Library 1.0 sources. (See HISTORY for recent changes.)
ziptgz dspic-threads-1.0-src.tgz 20.3 K 15 Nov 2008 - 00:07 dsPIC Threads Library 1.0 sources. (See HISTORY for recent changes.)
r3 - 20 Nov 2008 - 23:18:18 - DeanFerreyraYou are here: Bourbon Street Software  >  Home > DsPICDevelopment
 
Home
NearlyFreeSpeech  This site is powered by the TWiki collaboration platform