Sierra Radio Systems User Guide Station Controller Version 1.1
Welcome HamStack GPIO Board Reference Manual Revision 1.0 2011 George Zafiropoulos, KJ6VU and John Best, KJ6K This guide provides a broad introduction to the HamStack GPIO board. Sierra Radio Systems' HamStack web page www.hamstack.com The HamStack community support web site is hosted on Yahoo Groups with a group name of hamstack http://tech.groups.yahoo.com/group/hamstack/ Microchip's web site for more info on the CPU chips, MPLAB, C18 compiler and incircuit programming software www.microchip.com Swordfish Basic compiler website for basic language and compiler information and general support forum www.sfcompiler.co.uk If you are interested in purchasing HamStack hardware, software or accessories, visit our web store at www.hamstack.com and click on the store link. We believe all material in this document is correct and up to date. There is always a chance that something was omitted or incorrect. If you find any errors or have ideas of how to make the document better, please email us at support@hamstack.com
Contents Overview Hardware Firmware WiFi radio Appendix For more information, go to the Sierra Radio Systems web site at www.sierraradio.net or www.hamstack.com
StationStack Station Controller Introduction The Station Controller can monitor and control many devices in you radio station, repeater site, or just about anywhere that real time control and monitoring is required. The Station Controller consists of 3 key modules: The CPU board, the communications board or module and the motherboard or IO interface board. The Station Controller uses the standard HamStack CPU board containing a PIC 18F46K22 CPU. This CPU board is plugged on top of a standard HamStack GPIO board which provides the IO connections to the real world, power supply and additional communications circuits. When controlling the Station Controller through the RS232 or RS485 ports, no additional communications hardware is needed. If you connect the Station controller to a network, you will also need an ethernet or WiFi module.
Overview The HamStack GPIO board provides a convenient way to interface the CPU s signals to the real world. Using the GPIO board in the default configuration, the board provides the following IO connections and functions... 8 SPDT relays with a maximum current rating of 8 amps. 4 digital inputs with 10k pullup resistors to +5v DC 4 analog inputs with a selectable voltage range of 0-5 or 0-22 volts DC Jumper selectable serial interface for RS-232 or RS-485 +5v DC switching power supply Optional 28 pin PIC CPU used in place of the HamStack CPU board In the normal configuration, the HamStack CPU board plugs on top of the GPIO board. The GPIO board can be used for a stand-alone application where the HamStack CPU is in full control of the IO or it can be remotely controlled by the RS-232 or RS-485 serial interfaces. In this case, the HamStack CPU would act as a communications processor, sending and receiving commands over the serial port. The most common computer control interface is RS-232. The GPIO board and HamStack CPU do not require hardware handshaking so any RS-232 interface, including USB dongles work fine. If you plan to remotely locate the GPIO board far from the controlling computer or want to control multiple GPIO boards, you can use the RS-485 circuit on the GPIO board. Assembly There is no critical assembly sequence. The easiest approach is to install the lowers parts first. Starting with the IC sockets, then resistors, capacitors, diodes, etc. Finally install the connectors and relays. If you find too many parts... You may find extra parts in your kit. We do this because some components are easy to loose or install incorrectly. So just in case, we may include a few extras. If you are missing parts... While we are very careful to make sure you get what you are supposed to get, we may have accidently omitted a component. If this happens, drop us an email at support@hamstack.com and we will send you a replacement part right away. Configuration There are a few critical configuration topics that you must consider when building and assembling your GPIO board. Make sure you read this section BEFORE you start assembly. Local vs the standard HamStack plug-in CPU board The GPIO board is designed to use a standard HamStack CPU board plugged in on the 6 interconnect connectors (J1-J6). There is an alternative CPU that you can choose to use, this is called the Local CPU. You will notice a section of the board with the label Local_CPU, this part of the board is designed to host a 28 pin PIC such as the 18F2620, the smaller version of the 18F4620. Project developed for a standard HamStack CPU board can be ported to the local CPU by changing CPU pin assignments but your expansion options will be limited compared to the normal plug in CPU board. When you are building the board, you do not need to populate any of these components contained within the local CPU silkscreen outline box.
GPIO Board Rev 1
GPIO board rev 1 Configuration continued. JU3 JU4 JU1 JU2 JU5 Serial interface There are three typical options for connecting a serial interface to the GPIO board. 1. MAX232 chip on the CPU board and RS232 connection on the GPIO board. (Most common configuration) Using the standard MAX232 chip on the CPU board just needs a mechanical connection to the DB9 connector on the GPIO board. In this case, make sure the jumpers are configured as follows. - JU1 (OUT) (OUT) (OUT) (OUT) - JU2 - (OUT) (OUT) (OUT) (OUT) - Remove the MAX232 on the GPIO board. 2. Using the Local CPU and MAX232 for RS232 connection on the GPIO board This uses the DB9 and MAX232 on the GPIO board. This makes a very convenient and mechanically sturdy connection. The jumpers are configured as follows. - JU1 (IN) (IN) (OUT) (OUT) - JU2 - (OUT) (OUT) (OUT) (OUT) - Remove the MAX232 on the CPU board. 3. RS485 connection on the GPIO board In this configuration, we use the RS485 network transceiver instead of the RS232 connections. Set jumpers as follows. - JU1 (OUT) (OUT) (IN) (IN) - JU2 - (OUT) (OUT) (OUT) (OUT) - Remove the MAX232 on the GPIO board AND the CPU board.
Jumpers GPIO Board rev 1 JU1 JU3 JU2 JU4 JU5 JU1 Local / CPU RS232 selection Installing jumpers in the left two positions, will connect the DB9 on the GPIO board to the MAX232 on the GPIO board. Installing jumpers in the right two positions will connect the MAX232 on the CPU board to the DB9 connector. JU2 Analog input range selection Installing a jumper in each position will insert a voltage divider in front of each A/D input. The input series resistor is 10k. The jumper will insert a 2.2k resistor to ground which will give you a range of 0-22 VDC. With the jumper out, the input range is 0-5 VDC. JU3 RS232 / RS485 Selection Insert two jumpers in the left positions when using the RS485 interface. Insert two jumpers in the right positions when using the GPIO board as a RS232 to RS485 bridge. JU4 Term Inserts 120 ohm shunt resistor across the RS485 data lines. The network should have one board with a terminator jumpered in place. JU5 NetPower - Routes power from the DC power input jack to the RS485 network so power remote devices.
GPIO Board rev 1
GPIO Board rev 1
GPIO Board rev 1
GPIO Board rev 1 Assembly Checklist C1 330uf 16v electrolytic C2 0.1 uf monolithic C3 0.1 uf monolithic C4, C5, C6, C7 330uf 16v electrolytic C8 0.1 uf monolithic *Optional - for local CPU C9, C10 22pf (22) *Optional - for local CPU C11 1 uf electrolytic C12 0.1 uf monolithic C13, C14, C15 1 uf electrolytic D1 Diode 1N4004 D2-D9 LED Red - T1-3/4 D3 Diode 1N5822 Note: the 1N5822 should be D11 but the silkscreen says D3 D10 Diode 1N4004 INS1 Crystal insulator *Optional - for local CPU J1 1x8 pin header male installed in the outer position J2 1x8 pin header male installed in the outer position J3 1x6 pin header male installed in the outer position J4 1x8 pin header male installed in the outer position J5 1x6 pin header male installed in the outer position J6 1x8 pin header male installed in the outer position J7 DB9-F J8 Terminal block (7x2 pin) J9 RJ-45 J10 RJ-45 J11 2.1mm DC coaxial power connector J12 J13 2x5 pin header male w/shell J14 Terminal block (2x2 pin) J15 Terminal block (1x2 pin) J16a Terminal block (12x2 pin) in front of all relays J16b Solder pads no components (open collector outputs)
GPIO Board rev 1 Assembly Checklist Jtemp 3 pin male connector with locking ramp JU1 2x4 pin header male ( Local/CPU ) JU2 2x4 pin header male ( A/D Range ) JU3 2x4 pin header male ( RS-485 ) JU4 1x2 pin header male ( Term ) JU5 1x2 pin header male ( NetPower ) L1 100uh inductor R1, R2 Resistor 1/4W 1k Ohm 5% R3 Resistor 1/4W 120 Ohm 5% R4, R5 Resistor 1/4W 620 Ohm 5% Marked 680 on silkscreen on rev 1 boards R6, R7 Resistor 1/4W 1k Ohm 5% Marked 470 on silkscreen on rev 1 boards R8 Resistor 1/4W 4.7k 5% R10 Resistor 1/4W 270 5% RP1 5 resistor pack 10k ohms (6 pin SIP) RP2 4 resistor pack 10k ohms (8 pin SIP) RP3 9 resistor pack 270 ohms (10 pin SIP) 330 ohms can also be used RP4 5 resistor pack 2.2k ohms (6 pin SIP) RY1, RY 2, RY3, RY4, RY5, RY6,RY7,RY8 P & B 8A power relay SOC1 none SOC2 8 pin DIP IC socket SOC3 16 pin DIP IC socket Marked U4 on the rev 1 PCB SOC4 28 pin DIP IC socket SOC5 18 pin DIP IC socket U1 LM2576T-5.0 U2 75176 U3 MAX232 Market U4 on the rev 1 PCB U4 18F2620 *Optional U5 ULN2803 Y1 Crystal, 10 MHz
GPIO Board Rev 1
GPIO board PCB rev 1 Builders Alerts There are no known problems with the rev 1.0 GPIO PCB. However, there are a few silkscreen mistakes. Take a minute to review these items before you assemble your board. #1 #1 #2 #5 #6 #3 #4 #1 The terminal blocks in front of the relays should be labeled J16A and the solderpads for the open collector outputs should be labeled J16B #2 The MAX232 chip should be labeled U3. #3 The Temp probe jack has no reference designator. We refer to it as JTemp. #4 R6 and R7 are labeled 470 ohms. The parts installed should be 1k ohms. $5 R4 and R5 are labeled 680 ohms. The parts installed should be 620 ohms. #6 The 1N5822 should be D11, not D3.
Optional Serial to USB Adapter The serial to USB interface converts the TTL signals from the CPU board to USB for connection to a PC. When using the adapter, remove the MAX232 lever converter chip on the CPU board. If your Station Controller does not have the DB9 for serial port 1 installed, you can optionally install this TTL to USB adapter. The adapter is installed with a 6 pin SIP male header. 1. Do not install the DB9 connector. 2. Solder the six pin male header to the GPIO Board PCB. 3. Slip the USB adapter on to the 6 pin header and solder it in place. 4. Install the FTDI serial driver on your PC. 5. At this point you are ready to talk from the PC to the Project board through the USB connection.
Contents Overview Hardware Firmware WiFi radio Appendix For more information, go to the Sierra Radio Systems web site at www.sierraradio.net or www.hamstack.com
Firmware The Station Controller firmware monitors the serial port for commands and sends appropriate responses to the master device controlling the GPIO board. The commands can be sent through the RS232, RS485, WiFi or in some cases, an Ethernet interface. In all cases, the command set is identical. The syntax for the command set follows the Sierra Radio Systems Device Control Protocol format. More information can be found on the Sierra Radio web site. You can install the latest firmware yourself using a Microchip PicKit2 compatible in-circuit programmer including the Sierra Radio In-Circuit programmer. The latest firmware is on the SRS web site.
STATION CONTROLLER SUPPORTED COMMANDS Relay control Command RY,<mask> Example //RY,10X00000 Will turn on relay 1, and turn off relays 2,4,5,6,7,8 Regardless of the current state relay 3 will be unchanged Argument definition <mask> is a string of 8 characters that turn each realy 1 8 on or off. 1 = relay on 0 = relay off X = do not change the current state of the relay Individual realy Command RYn,<state> Example //RY3,1 Argument definition Where n is a value of 1..8 mapped to relays 1..8 <state> is one of the values 0, 1, T, P. 0 = relay off 1 = relay on T = toggle state (flip on to off and off to on) P = pulse. Assuming the relay is normally off, the relay is set off then pulsed on for 250 ms. then set to the off state. Get the state of the GPIO board Command STATE Example //STATE Argument definition: none. Returns the current state of the GPIO board in the format: //STATE,11111111,0000,13.8,13.8,13.8,13.8 In this example 11111111 represents the state of the relays #1.. #8 0000 represents the state of the digital inputs #1.. #4 13.8, 13.8, 13.8, 13.8 represents the values of the A to D inputs #1.. #4 State will also send the following additional commands to the master control unit or program: //LED,10101010 See //LED command for details //LCD,1,1,TEXT See //LCD command for details //LCD,2,1,TEXT See //LCD command for details //TAGLINE,TEXT See //TAGLINE command for details
STATION CONTROLLER SUPPORTED COMMANDS LED command This command is send from the GPIO board back to the master controlling device. The master can be a PC program, iphone, or hardware control head. This command updates the state of the LEDs on the master control panel or control head. Command LED,<mask> Example //LED,10GYYRX00000 The mask maps to LED s #1.. #12 <mask> is a string of 12 characters that turn each LED on and off 1 or G = Turn LED on with a green color 0 (zero) = Turn LED off R = Turn LED on with a red color Y = Turn LED on with a yellow color X = do not change the current state of the LED LCD command This command sends a text string to the master control program or control head to set characters to be displayed on the LCD screen. Command LCD,line,col,text Example //LCD,1,5,Hello Argument definition line is the line 1 or 2 where the text will appear col is the column where the text will start typically between 1 and 16 text is the text string that will be written on line starting in column col Trailing spaces are truncated. Any text written past the end of the display are lost Tagline Command TAGLINE Example //TAGLINE,W1AW Tagline places the text string on the control panel s tagline usually near the top of the display. This is provided for users to annotate a title to the control panel to personalize the display. Typically used for callsigns, names, or the purpose of the control head such as Antenna Controller
STATION CONTROLLER SUPPORTED COMMANDS Autoupdate Command AUTOUPDATE,<value> Example //AUTOUPDATE,ON This command turns the autoupdate mode on and off. When on, the autoupdate will send the GPIO board state at a regular interval defined by the INTERVAL command. The values are 1 or ON = turn on autoupdate 0 or OFF = turn off autoupdate Interval This command determines the interval at which the GPIO board update is sent to the master controller. Command INTERVAL,<value> Example //INTERVAL,30 The interval is a number representing approximate number of seconds between updates. Invert digital inputs Command INVERTN,value Example //INVERT2,ON This command will invert the state of a digital input so when it is represented to the master controller a high logic input (+5v) is represented as an off state (RED) as opposed to the normal condition where a logic 1 (+5v) is high and therefore GREEN. Other useful commands //PING Used to pin the GPIO board to make sure it is alive. Ping will return the device address as well. //ROLLCALL Same as ping but with a delayed response based on the device address to allow multiple devices to respond on the network. //SETADDR,x Set the devices network address to x //ECHO,x Return the exact string x //HELP Display the help screen //STATIS Human readable system status.
Contents Overview Hardware Firmware WiFi radio Appendix For more information, go to the Sierra Radio Systems web site at www.sierraradio.net or www.hamstack.com
WiFi RF Module Configuration The Station Controller uses a WiFi module form Roving Networks. This device can be used to create an ad-hoc network connection between an iphone or ipad and the Station Controller or connected to a wireless router for remote access over the internet. The WiFi module must be configured to operate properly. The module will either come preconfigured or will require the user to set the configuration manually. To set the configuration, you will need a USB to RF module interface such as the Sierra Radio USB RF Base Station, model #417. Once connected, you can use a simple dumb terminal program to send commands to the WiFi module to configure it. The module out of the box tries to join the network called "roving1" with the password "rubygirl". Once it connects to that network it tries to obtain a IP address via DHCP. When setting up the Station Controller this factor setting is not used. To communicate with the WiFi module through the dumb terminal program you will set your dumb terminal and serial port to 9600 baud and follow this procedure. In the terminal program enter $$$. This will put the WiFi module in command mode. Press the enter key and you should see CMD> This is the WiFi module s command prompt. You can now enter various configuration commands. To put it the Station Controller into ad-hoc network mode, enter the following commands. set wlan ssid hamstack set wlan channel 11 set wlan join 4 set ip address 169.254.1.1 set ip netmask 255.255.0.0 set ip local 7373 set ip dhcp 0 set broadcast port 7373 save reboot (or whatever you want the SSID to be) Once this is completed, if you search for wifi signals you should see an adhoc network named hamstack or whatever you set. Join that network.
Setting up the Client iphone /ipad To configure your iphone or ipad for direct control of your Station Controller, follow these steps 1. On your iphone / ipad, go to your Settings / Wi-Fi control panel. Turn on Wi-Fi. Your iphone / ipad will scan for Wi-Fi access points. If the Station Controller is powered up, you should see a device called hamstack appear. Select that device and click the right side of the menu bar > to set connection details. Enter the following parameters 1. Static IP address mode. 2. IP Address 169.254.1.2 3. Subnet mask 255.255.0.0 2. You should now be connected to the Station Controller. 3. Go into the HamLog app and select Tools. Scroll down towards the bottom of the menu and select HamStack Lite 4. You will now see the HamStack Station Controller control panel. 5. Start pressing buttons to flip relays, monitor logic and analog voltage values. 6. If you want to change the labels or commands to the Station Controller, you can select the right hand > icon on each button. 7. You should now be on the air. 8. Beyond this, every installation is different. Connecting through various network modems, routers, cell phone networks, etc. will all require some tinkering to get the IP address, subnet mask, etc to work just right.
Contents Overview Hardware Firmware WiFi radio Appendix For more information, go to the Sierra Radio Systems web site at www.sierraradio.net or www.hamstack.com
Component Identification Guide Diode Common part: 1N4004 The band on the diode is The cathode side. cathode Integrated circuit Make sure pin1 is in the right position. Pin 1 is indicated by the dot. Resistor pack Multiple resistors in a package. Values indicated by a 3 digit number. IE 103 means 10k Resistor Quarter watt. Value indicated by color code. Dipped monolithic capacitor. 3 digit number. IE 103 means 10,000 pf or 0.01uf. Electrolytic capacitor Insert positive lead into the square solder pad. Long lead = positive. Terminal block Screw terminal block. Crystal Make sure the crystal insulator is installed under the crystal case to prevent shorting out. Inductor Sealed inductor. E C B NPN transistor TO-92 plastic case transistor (PN2222) Top view E B B C C E LM2576 Swtiching voltage regulator TO-220-5 case O I C Linear voltage regulator TO-92 plastic case (78L05, etc.) Out Com Top view In LED (Size: T1) Insert long lead (anode) into the square solder pad. LED (Size: T 1-3/4) Insert long lead (anode) into the square solder pad. Optocoupler with optically isolated darlington transistor. 6 pin DIP package Solid State Relay 6 pin DIP package
Component Identification Guide DC coaxial power jack Pushbutton Momentary contact pushbutton. Jumper block 3.5mm stereo jack Shunt RJ45 Tab up configuration with built in LEDs. 3 Pin connector DB9 connector Reed Relay SPST The reed relay is fast and quiet. Make sure pin 1 is in the proper orientation. 40 Pin machined IC socket Install socket with the dimple on one end pointing toward pin 1. Crystal Insulator Make sure the crystal insulator is installed under the crystal can. 6-18 Pin machined IC socket Install socket with the dimple on one end pointing toward pin 1. 3 pin connector Molded plastic connector with alignment tab Contact point Inserted into molded plastic connector 8 Amp power relay This power relay is designed to switch medium power loads. Each set of contacts supports up to 8 Amps. G V Top view D DS18S20 Temperature sensor G using the DS OneWire interface in a TO-92 plastic case V D 100 uh inductor This inductor is used in the switching power supply.
Notes