Project:HUGnet Controller Board

From HUG Wiki

Jump to: navigation, search

This board controls the HUGnets and routes packets between the endpoints and the data collector. It supplies power and does the transmitting that the endpoints can recieve.

Contents

How It Transmits

An endpoints transmit by drawing current on the power line. This is hard to receive, taking quite a few parts. What the controller board does is to retransmit those current pulses as a square wave on the voltage. This allows for a simple capacitor and transistor circuit to receive the message. This allows all of the endpoints to talk to eachother. This is important because they need to know when another endpoint is transmitting so they don't overwrite the message.

Currently the voltage is being boosted.This could just as easily (and with less parts) be done as a voltage drop. The endpoints should be able to receive this without changing them at all. It would remove about 1/4 of the parts from this circuit board. This is not tested at all.

See Project:HUGnet Power Supply Theory for a more indepth disection of how it transmits.

Firmware

There are two pieces of firmware in the controller board. The board boots into the bootloader. The bootloader then checks the main program. If the checksum matches the recorded checksum then the booloader runs the main program. If they do not match the bootloader stays resident.

More information about the firmware can be found on the Project:HUGnet Endpoint Firmware page.

Bootloader 0039-20-06-C
The bootloader only has facilities for talking over the RS485. It can not talk HUGnet, and just turns both channels off. It will let the data collector know that it booted up by sending an unsolicited packet. It then waits for the data collector to load a new program into it.
This program will take packets MUCH larger than a normal endpoint. It uses most of it's ram for a buffer becuase it can. It has nothing else running.
Main Program 0039-20-01-C
This is the firmware that actually runs the HUGnets. It will talk RS485 and it controls the receiving of the current pulses and transmitting of the voltage pulses.
This program is loaded into the board via RS485 and the HUGnet packet structure. The routines to do it are in the e00392100 driver.

Mounting the Board

The endpoint is made to mount in a standard double gang electrical box. The holes in the board line up with the screw holes on the box. The board faces into the box and is held in place by the cover of the box.

Note: A plastic cover should be used to avoid shorting the back of the board.


Face Out Mounting

The boards can be mounted on mud plates that are screwed to the wall face out. This makes it easy to work on the boards. This should only be done in a very protected location as the boards are out in the open and easy to disturb.

Powering the Board

The board needs a minimum of a 300mA 8-24V DC power source. 500mA is a better size.

HUGnet Buses

There are two HUGnet buses on each board.

Each one is independent and should they should NOT ever be connected together.

Both HUGnets come out on the same connector (SV3).

The + and - should be connected to the HUGnet input on the endpoint boards.

Connecting to the Data Collector

The RS485 connection (in SV2) should be connected to the RS485 bus connected to the computer.

Connectors

SV1 (Programming Header)

Pin Function Notes
1 Ground Digital Ground Pin
2 SCK / PB5 Serial Clock Pin.
3 MOSI / PB3 / OC2 Master Out Slave In
4 MISO / PB4 Master In Slave Out
5 Reset Processor Reset Pin

SV2 Power/RS485 Header

Pin Function Notes
1 Term+ If termination resistors are used this is the plus side of the termination bridge
2 RS-485+
3 RS-485-
4 Ground
5 8-24V DC

SV3 HUGnet

This connects to the HUGnet input on the endpoint boards.

Pin Function Notes
1 HUGnet 1 +
2 HUGnet 1 -
3 HUGnet 2 -
4 HUGnet 2 +

Hardware Versions

0039-21-01

Image:Controller.jpg
HUGnet Controller Verion 1


So far there is only one version of the controller board.

This board controls 2 HUGnets. It has two connectors. One for power/rs485 (5 pin) and the other for the HUGnets (4 pin). They are both standard Phoenix connectors. This board will put out 2 amps on each channel, but can only make the HUGnet work under about 300ma. The 1000 uF capacitor will need to be enlarged for it to transmit while outputting more power.

There are 5 LEDs on the board. The single one (bottom center of the image) is the power LED. If this is lit up green then the board has power. There is then 2 leds for each channel. The green one (top in the image) shows that that channel has power, the amber one blinks with data.

The parts for the HUGnet channels are symetical on the board. Every part in the actual HUGnet channel is mirrored across the center of the board. This makes diagnostics and troubleshooting easier.

The heatsinks on the FETs are not required unless the voltage on the HUGnets is being put out at lower than the power supply voltage. The FETs will drop the extra voltage just like a resistor.

Specs

  • 16k Code space
  • 512 bytes E2
  • 1k bytes SRAM
  • Avaliable on Headers:
    • RS-485
    • HUGnet (x2)
    • Atmel serial programming port (also works as I2C port)
    • Incoming Voltage
  • Industrial temp range (-40 to +85 C)
  • Autoincertable
  • Mixed through hole and surface mount
  • 8 to 28 Volts input
  • Works on either the ATMega16 or the ATMega32
  • Currently we are building them with the ATMega16

Schematic

Image:0039-21-01-sch.png
Schematic for 0039-21-01

PCB Layout

Image:0039-21-01-pcb.png
PCB Layout for 0039-21-01

PCB Silk Screen

Image:0039-21-01-silk.png
PCB Silk Screen for 0039-21-01

Bill of Materials

See Also