Tag Archives: example

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

Using SendInput to type unicode characters

I received a query from reader Partha D about generating unicode keystrokes using the SendInput function in Windows. As I understand it, Partha wants to generate one or more unicode keystrokes when a particular keyboard shortcut is pressed. The following … Continue reading

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

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

Sending a key to a window that’s not in focus (C program)

In a previous post, I showed how a C program can simulate a keystroke in Windows using SendInput. I also posted a subsequent example showing how to simulate a keypress with the Control key included (e.g. Ctrl+V). In this post … Continue reading

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

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

Basic example program for MSP430G2231

My colleagure Damon Berry and I have just spent a couple of hours playing around with a selection of components that we’re considering including in an ultra low-cost robotics kit that we’re designing. The kit is intended for a series … Continue reading

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