Tag Archives: XC16

Generating antiphase PWM signals with the dsPIC30F4011

I frequently receive queries from people who are using a dsPIC microcontroller to control power electronics of some kind, such as in an inverter, a voltage converter, or similar. Many of these queries relate to the generation of different combinations … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments

First attempt at printing to an LCD display from a dsPIC30F4011

The following example is my first attempt at printing to an LCD display using the dsPIC30F4011 microcontroller. The display I’m using is a 16×1 character screen with what I think is a standard Hitachi interface. It’s my first time using … Continue reading

Posted in Uncategorized | Tagged , , , , | 42 Comments

Simple interrupt-driven sampling example for the dsPIC30F4011

Reader Swetha wrote in with a query about performing 10Hz sampling on a dsPIC30F4011 in some kind of energy monitoring system. The following example illustrates a basic structure for interrupt-driven sampling using Timer 1. I compiled this program with Microchip’s … Continue reading

Posted in PIC | Tagged , , , , , , , , | 6 Comments

Nasty 4-channel logic analyser using dsPIC30F4011

This post is about a quick and dirty 4-channel logic analyser that I hacked together to get a snapshot of four parallel binary signals from something I was building. I just want to quickly capture this information here for the … Continue reading

Posted in PIC | Tagged , , , , , , , , | 2 Comments

Simple dsPIC33FJ32MC202 example

This is a very simple example circuit and C program for Microchip’s dsPIC33FJ32MC202 microcontroller. The basic circuit used to connect the PICkit 2 to the dsPIC33FJ32MC202 is shown below. One thing that confused me when I tried to wire this … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , | 17 Comments

Short dsPIC30F4011 program to test output compare SFR values

I’ve been playing around with the output compare feature of the dsPIC30F4011 microcontroller for the last day or two and finding out some interesting things about it. There are two output compare channels (OC1 on pin 23, OC2 on pin … Continue reading

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

PWM Sinewave generation using output compare on dsPIC30F4011

Reader Manu Abraham wrote in with an interesting query about sinusoidal variation of PWM duty cycle using the output compare feature of the dsPIC30F4011. The 30F4011 has two output compare channels which can be used to very easily generate periodic … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , | 10 Comments