Category Archives: PIC

50Hz square wave example for PIC16F1829

This post presents two example programs for the PIC16F1829 microcontroller that generate 50Hz square waves. The first example uses simple bit banging to generate the waveform. The second example uses the dedicated PWM hardware module. Example 1: bit banging In … Continue reading

Posted in PIC | Tagged , , , , , , , , , , , | 27 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

Updated version of IGBT control program for buck-boost dc-dc converter

This is an updated version of my IGBT control example for the dsPIC30F4011, which appeared in an earlier post. In this version, an analog control signal on pin AN6 is used to vary the duty cycle of the waveforms produced. … Continue reading

Posted in PIC | Tagged , , , , , , , , , , | 28 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

IGBT control in a buck-boost DC-DC converter

Reader Jil Sutaria wrote in a with a query about controlling four IGBTs in a buck-boost DC-DC converter. Some of the main features of this application are: Two pairs of IGBTs need to be controlled. Each pair of IGBTs share … Continue reading

Posted in PIC | Tagged , , , , , , , , , , , | 17 Comments

Servo motor control example for the PIC18F4620

This is a simple servo motor control example for the PIC18F4620 microcontroller. The servo is controlled by the PWM signal from CCP1 (pin 17 on the PIC). The PWM period is 20ms and the pulse width varies between 1ms and … Continue reading

Posted in PIC, Uncategorized | Tagged , , , , , , , , , | 17 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