Monthly Archives: August 2012

dsPIC Workshop: Digital i/o, timing, PWM, UART

Today’s dsPIC programming workshop will take place from 2-4pm  in room KEG-036, DIT Kevin St. Conall O’Griofa will be co-presenting and Damon Berry will hopefully be helping out too. We’ll be using the following hardware: Laptops, PICkit 2, breadboard, dsPIC30F4011, … Continue reading


Posted in Uncategorized | Tagged , , , , , , , , , , | 1 Comment

Using pk2cmd to transfer a hex file onto the dsPIC30F4011

Since upgrading to MPLAB X, I’ve had difficulty using the PICkit2 from within the IDE, so I’ve mainly been using the PICkit2 helper application to transfer my compiled hex files to the dsPIC. However, there is another handy way of … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

PWM generation with the dsPIC30F4011

This is a simple example of PWM waveform generation using the dsPIC30F4011 microcontroller. This chip has three PWM channels (pins 33-38), each channel consisting of a pair of pins which can be configured in various ways. The code below enables … Continue reading

Posted in Uncategorized | Tagged , , , , | 1 Comment

Printing text from the dsPIC30F4011 to a PC via UART

This is a simple example of sending text from a dsPIC30F4011 microcontroller to a PC via the UART. This program toggles an LED on RD0 once every second. Each time the LED is switched on or off, the word “Hello” … Continue reading

Posted in Uncategorized | Tagged , , , | 13 Comments

Creating a new XC16 project in MPLAB X

These are the steps I use to create a new MPLAB X project for a C program compiled with Microchip’s XC16 compiler: From the File menu, select “New Project…”. The new project dialog box will appear. Choose Project: Select “Microchip … Continue reading

Posted in Uncategorized | Tagged , , | 10 Comments

Next programming workshop: 2-4pm Thursday 30-8-2012

I’ m planning to run another programming workshop next Thursday, 30th August 2012. This workshop will build on the dsPIC basics that we covered in the previous workshop. Basically, I’d like to give a short guided tour of what I … Continue reading

Posted in Uncategorized | 13 Comments

Two square waves with arbitrary phase shift on dsPIC

Reader Imad wrote in with an interesting query about generating two square waves with equal frequency but an arbitrary phase shift between them using a dsPIC microcontroller. I’m still working out the fine details, but here’s the general gist of … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , | 32 Comments

dsPIC Programming Workshop

Introduction This workshop on dsPIC programming took place in room KEG-009 (DIT Kevin St) from 2-4pm on Wednesday 1-8-2012. Thanks to all those who participated. Here’s what we covered: We found out what software you need to install to get … Continue reading

Posted in PIC | Tagged , , , , , , | Leave a comment