Tag Archives: PIC

Simple example program for the PIC12F675 microcontroller

The PIC12F675 is a very inexpensive 8-bit microcontroller from Microchip that’s available in an 8-pin DIP package (i.e. it’s suitable for breadboard use). I’ve had a small tube of these on the shelf for a few years, but I’ve only … Continue reading

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

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 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 , , , , , , , , , | 13 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

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 , , , , , , , , , , , , , , , | 49 Comments

Tutorial: Getting started with PIC18F / dsPIC30F

What we will cover in this tutorial: This is an informal tutorial and we’ll see how we get on, but this is what I’m hoping to cover: Basic breadboard circuit for PIC18F / dsPIC30F What to download / install Simple … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | 8 Comments

Analog-to-PWM Conversion with the PIC18f4620

The main function below is reproduced with the kind permission of Robert Byrne who is using it in an Instrumentation project. His program is an adaptation of my PIC18F4620 template code that I posted recently, so to form a complete … Continue reading

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