Tag Archives: MPLAB

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

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

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

PWM output on 2 channels of the dsPIC30F4011 with equal duty cycle and 180 degrees out of phase

Reader Mo Hsen wrote in with an interesting query about generating PWM output from the dsPIC30F4011 on two channels with equal duty cycle but 180 degrees out of phase (see the waveforms below for an example). I’ve created a short … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , | 50 Comments