Project:HUGnet Endpoint Programmer

From HUG Wiki

Jump to: navigation, search

The endpoint programmer is used to program the endpoint with the firmare that it needs to operate. It also programs the BIOS into the controller board. It uses the serial programming (I2C) port on the Atmel microcontroller. This port comes through SV1 on the endpoint board.

It is broken into two required pieces and one optional piece. The required pieces are the PC adapter and the programming head. The optional piece is an intermediate between the two that adds power and HUGnet to the programming head, since these can't come from the PC.

Contents

What Devices Does It Program?

It will program any Atmel AVR processor that supports serial programming. That being said the specific HUGnet devices it programs are:

Software

This project uses AVRDude to program the endpoints.

If programming is REALLY slow, start an interactive session with AVRDude and enter the command 'sck 10'.  
Then you can quit.  After that it should work better.

The Pieces

PC Adapter

The PC adapter comes in two flavors. A parallel port plug and a serial port plug.

Serial Adapter

RJ-45 Jack

This is generally built with a DB9F to RJ45 adapter. One example is Digikey part number 046-0001-ND.

DB-9 RS-232 Signal Atmel Signal RJ-45 Jack Color *
Pin 3 Transmit Data MOSI Pin 8 White
Pin 4 DTR SCK Pin 7 Brown
Pin 5 Ground Ground Pin 5 Red
Pin 7 Request to Send Reset Pin 2 Orange
Pin 8 Clear to Send MISO Pin 1 Blue

* This is the common color code. Be sure to check to make sure that your adapter uses it.

Parallel Adapter

This is generally built with a DB25M to RJ45 adapter. One example is Digikey part number 046-0010-ND.


DB-25 Parallel Port Signal Atmel Signal RJ-45 Jack Color *
Pin 2 Data 1 MOSI Pin 8 White
Pin 1 Strobe SCK Pin 7 Brown
Pin 19 Ground Ground Pin 5 Red
Pin 16 Init Reset Pin 2 Orange
Pin 11 Busy MISO Pin 1 Blue

* This is the common color code. Be sure to check to make sure that your adapter uses it.

USB Adapter

Programming through a USB port requires an Atmel AVRISP mkII programmer. This can be bought through digikey and has a part number of avrisp2.

Image:Atmelprogheader.png

So we have to create an interface between this header and an RJ-45 jack, using the following pinout.

ISP6PIN Atmel Signal RJ-45 Jack Wire Color Notes
Pin 4 MOSI Pin 8 Brown
Pin 3 SCK Pin 7 White/Brown
Pin 6 Ground Pin 4 Blue
Pin 5 Reset Pin 2 Green
Pin 1 MISO Pin 1 White/Green
Pin 2 V+ Pin 3 White/Blue This must be connected or the programmer will not work.

The original programming cable can also be just cut and soldered to a blank endpoint board to create the programmer.

References

  1. Users Guide
  2. Atmel's Site
  3. Helpful hints about the programmer

Programming Head

The programming head has a piece that plugs into an endpoint and a cable that ends in a RJ45 plug. This will plug into either the serial or the parallel adapter.

Cable Pinout

RJ-45 Plug

The cable should be a cat 5 or equivalent cable. The pin out for the RJ45 connector on the end of the cable is:

RJ-45 Plug Color (568A) Signal Notes
Pin 1 White/Green MISO Required
Pin 2 Green Reset Required
Pin 3 White/Orange HUGnet+ Optional
Pin 4 Blue Ground Required
Pin 5 White/Blue 8-24V Optional
Pin 6 Orange HUGnet- Optional
Pin 7 White/Brown SCK Required
Pin 8 Brown MOSI Required

The Other End

The other end of the programming head connects to the endpoint. This can be as simple as a female single row 0.1" 5-pin header, or as complex as a blank endpoint board with 3 female headers coming out of the bottom of the board and a battery on the board.

Signal Header Pin
Ground Pin 1
SCK Pin 2
MOSI Pin 3
MISO Pin 4
Reset Pin 5

Powering the Endpoint

A 2 port surface mount Hubble style snap in box with 2 RJ-45 jacks on it makes an excellent way to add power. A PC input jack and a programming head output. Internally it adds power and HUGnet from an available source. It is built this way so a standard ethernet patch cable can be used to go between the computer and the box. This saves making a custom cable, and the same programming head can be used with or without the middle piece.

If an endpoint board is used as the programmer, a 9 volt battery can be put into the place for the filter capacitor that is on the input of the voltage regulator. Then a 1n4000 series diode can be put backwards into the spot for the protection diode to protect the battery from any other voltage that might be applied to it.

Each one of these has been custom so far. There really isn't a standard way to do it currently.

See Also