This is revision E of the Controller28 module.

Controller28 Module (Revision E)

Table of Contents

1. Introduction

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

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. In addition, this board supports the following Atmel microcontrollers:

Bill Benson has some additional Controller28 documentation.

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
Address Set 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
Program Memory Get Send 0 0 0 0 0 0 0 0 1 Read cccccccc words of program memory starting at the address recorded by the Address Set command. The most significant byte comes first, followed by least significant byte. There are always cccccccc × 2 bytes returned. The address register is incremented by cccccccc. The 0x5c is always tacked 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 Memory Set 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. Address register is incremented by 1.
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
Execute Send 0 0 0 0 0 0 0 1 1 Start execution at the current address.
Address Low Get Send 0 0 0 0 0 0 1 0 0 Return the low order byte of the memory address as llllllll.
Send 0 l l l l l l l l
Address High Get Send 0 0 0 0 0 0 1 0 1 Return the high order byte of the memory address as hhhh hhhh.
Send 0 h h h h h h h h
Processor Architecture Get Send 0 1 1 1 1 0 1 1 0 Return the processor architecture as vvvvvvvv (0=PIC16, 1=PIC18, 2=AVR8, 3=ARM7.
Send 0 v v v v v v v v
Processor Architecture Get Send 0 1 1 1 1 0 1 1 0 Return the processor architecture as vvvvvvvv (0=PIC16, 1=PIC18, 2=AVR8, 3=ARM7.
Send 0 v v v v v v v v
Boot Loader Version Get Send 0 1 1 1 1 0 1 1 0
Send 0 m m m m n n n n
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

There is another aspect of the Controller28 that has to do with supporting debugging...

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 easiest 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.

For the Atmel boot loader pin 28 (Port C5), is used to select between boot mode and download mode. Pin N2-2 is +5V, N3-3 is Ground, and N3-4 is pin 28. By connecting these three pins to a DPST switch, a single switch can flip between download and run mode.

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.

In addition, there needs to be a boot loader for the Atmel ATmega88.

5. Issues

Any issues that come up are listed here.


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