Posts

VPP limiter for new PIC microcontrollers.

PIC VPP limiter schematic

PIC VPP limiter schematic


Newer PIC18s, such as my current favorite – PIC18F26K20, don’t like to be programmed with 12V. The datasheet maximum is 9V. Older Microchip programmers/debuggers, such as PicKit and ICD 2, do not support variable programming voltage. When you start a MPLAB project consisting of K-series PIC18 and ICD 2 debugger, you will get a warning and suggested VPP limiting circuit schematic. In this article I’m describing this very circuit, so you can build it beforehand.


Continue reading VPP limiter for new PIC microcontrollers.

Lightweight USB Host. Part 1 – Motivation.

Lightweight USB Host

Lightweight USB Host


Universal serial bus is quite popular. USB peripherals are aplenty, and they are cheap; therefore,it is tempting to use them in microcontroller projects.

There are two distinctive roles for devices on USB bus. USB host controls the bus and initiates data exchanges. Peripheral device won’t do anything until instructed by host. In other words, to make use of USB peripheral, our little microcontroller has to become a USB host.

Making a USB host is not as difficult and scary as it sounds. We don’t need a functionality of a PC USB host controller. USB specification for embedded host says that such host need only support a certain set of devices or device classes and nothing else. What is in this set (called Target peripheral List, or TPL ) is up to you. You may want your micro to work with a certain web camera or printer, or use memory sticks, which are all “Mass Storage Class Bulk Only Transfer” devices, or Bluetooth radios, or whatever else you may need in your design.


Continue reading Lightweight USB Host. Part 1 – Motivation.

Interfacing LCD via SPI.

HD44780 LCD display

HD44780 LCD display

Introduction.

As time goes by, microcontrollers become more powerful, cheaper, and smaller. A typical micro of the past could have had 40 pins and no internal memory. On the contrary, modern J-series PICs are made with 96K program memory and 28 pins. We can drive a lot of peripherals with that amount of memory, however we are getting short on pins.

In this article I will show how to drive a parallel interface peripheral serially. A HD44780-compatible LCD module is good candidate – it is popular, inexpensive, and slow, so you won’t be losing any speed while converting parallel to serial. And you could even save some money using a micro with fewer pins.


Continue reading Interfacing LCD via SPI.

Testing GeSHi

Installed syntax highlighting plugin built on my favourite GeSHi. The plugin name is wp-syntax. Testing:

#include <stdio.h>
main
{
   printf("hello, world\n");
}