This is the revision A version of the Controller28 module.

Controller28 Module (Revision A)

Table of Contents

1. Introduction

The Controller28 module can accept one of the many available 28-pin microcontrollers from Microchip®.

This module has the following features:

The following Microchip microcontrollers plug into this module:

There are many other microcontrollers in the 16F and 18F series that can be plugged into the 28-pin DIP socket.

2. Programming

You are free to program the microcontroller using any technology that you want. Three techniques are described here:

Downloader
A downloader executive can be programmed into the microcontroller, and programs can be loaded into the microcontroller via the RoboBricks2 bus. The WireHost module can be used to facilitate this.
ICD2 Header
The ICD2 header can be hooked up to the Microchip ICD2 (In-Circuit Debugger). The ICD2 allows for microcontroller programming and program debugging with breakpoints.
External Programmer
An external programmer such as the Microchip PICStart+ or the KitsRUs K128/K149/K150/K182 can be used. The microcontroller chip is physically transfered between the programmer device and the 28-pin IC socket on the Controller28 board.
The rest of this section discusses the first downloader option.

Command
Name
Action Bit Description
8 7 6 5 4 3 2 1 0
Set Memory Address Send 0 0 0 0 0 0 0 0 0 Set the memory read/write address to hhhhhhhh:llllllll.
Send 0 h h h h h h h h
Send 0 l l l l l l l l
Recieve 0 0 1 0 1 1 0 1 1
Read Memory Send 0 0 0 0 0 0 0 0 1 Read cccccccc words of program memory starting at the address recorded by Set Memory Address. The most significant byte comes first, followed by least significant byte. There are always cccccccc × 2 bytes returned. The 0x5c is always taked onto the end.
Send 0 c c c c c c c c
Receive 0 a a a a a a a a
Receive 0 b b b b b b b b
Receive ...
Receive 0 z z z z z z z z
Recieve 0 0 1 0 1 1 1 0 0
Program Word Send 0 0 0 0 0 0 0 1 0 Set the next word of program memory to hhhhhhhh:llllllll. Respond with rr equal to 3 for success, or 2, or 1 for failure.
Send 0 h h h h h h h h
Send 0 l l l l l l l l
Recieve 0 0 1 0 1 1 0 r r
Common
Commands
Send 0 1 1 1 1 1 1 x x Standard common command. See specifications for details.
Receive 0 a a a a a a a a
Select Send 1 a a a a a a a a Select the module with an address of aaaa aaaa. A time-out indicates that the module is not selected.
Receive 0 0 0 0 0 0 0 0 0

3. Hardware

The hardware consists of a circuit schematic and a printed circuit board.

3.1 Circuit Schematic

The schematic for the Controller28 module is shown below:

Controller28 Schematic

The parts list kept in a separate file -- controller28.ptl.

3.2 Printed Circuit Board

The printed circuit board files are listed below:

controller28_back.png
The solder side layer.
controller28_front.png
The component side layer.
controller28_artwork.png
The artwork layer.
controller28.gbl
The RS-274X "Gerber" back (solder side) layer.
controller28.gtl
The RS-274X "Gerber" top (component side) layer.
controller28.gal
The RS-274X "Gerber" artwork layer.
controller28.gml
The RS-274X "Gerber" mask layer.
controller28.drl
The "Excellon" NC drill file.
controller28.tol
The "Excellon" tool rack file.

ICSP/ICD Cable

Unfortunately, there is not much standardization for In Circuit Serial Programming connectors. However most of the programmers that have ICSP support use some sort of 1×N male header with either .156" or .100" between the pins.

When it comes to in circuit debuggers for Microchip PIC microcontrollers there are few products to choose from. Indeed, as of October 2005, there are only three products I am aware of:

The Microchip product is available directly from Microchip and other distributors (e.g. Digikey and others.) In the United States, the Olimex products are distributed by Spark Fun Electronics.

Microchip appears to have standardized on a 6-6 (6 position/6 wire) RJ11 connector and Olimex has standardized on a 1×6 .1" polarized connector. So even though there are only three products, there are already two connectors to choose from.

The Controller28 module uses the Olimex 1×6 header instead of the Microchip RJ11 connector. The reason for this is because there is simply insufficient room on the Controller28 board for the female RJ11 connector and everything else. Thus, the 1×6 is the only reasonable alternative.

The ICSP/ICD pins names, numbers, and descriptions are listed below:

MCLR/Vpp (Pin 1)
The is the pin used to reset the processor and to force the processor into programming mode.
Vdd (Pin 2)
The voltage that is being fed into the Vdd pin of the 28-pin processor (i.e. +5 volts.)
GND (Pin 3)
Ground.
PGD (Pin 4)
The program data pin on the 28-pin processor. This is sometimes called RB7.
PGC (Pin 5)
The program clock pin on the 28-pin processor. This is sometimes called RB6
PGM (Pin 6)
The low voltage program enter pin on the 28-pin processor. Microchip seems to have dropped this feature from their newer chips. The '16F87x chips seem to have it though.
A picture of the header is shown below:
The picture is a deep link into the Spark Fun PG2C Tutorial.

What if you have the Microchip ICD2 product and want to connect it to the Controller28 module? Well there are two options:

Adaptor Cable
The easies solution is to find a 6-wire cable with a 6-6 RJ11 connector on it, snip one end off, and splice on a 1×6 female header onto the other end.
RJ11 to 1×6 Adaptor
Alternatively, a adaptor between a 6-6 RJ11 and 1×6 polarized male header can be fabricated. If I get sufficiently motivated, I may even cook one up for laughs.

One comment, since the Microchip MPLAB® product does not currently run on Linux, I have used neither the Olimex nor Microchip in circuit debugger products. This ICSP/ICD facility is provided as a feature for people other than myself.

4. Software

The following files are available:

controller28.ucl
The Controller28 µCL source code file.
controller28.asm
The Controller28 boot loader assembly code listing.
controller28.lst
The Controller28 boot loader listing file.
controller28.hex
The Controller28 boot loader Intel® Hex file.

5. Issues

The following fabrication issues were encountered:


Copyright © 2005-2007 by Wayne C. Gramlich. All rights reserved.