This post is part of the Rack Box Project series.
RS-232 interface module, with 9 inputs and 9 outputs. Uses an AVR ATmega8 microcontroller.
Table of contents
Details
This I/O module provides 9 digital inputs and outputs for the computer serial port. The outputs are open collector — giving GND when activated, max load per channel is 100mA.
The inputs are triggered when they are pulled low.
By sending commands to the module; one can change the status of the outputs, the module will confirm when the action is carried out.
It’s also possible to ask for the current status of any in- or output, this is done by not sending a set value:
002:o:01:1 will set output 1 active
002:o:01 will return the output 1 value
The same can be done with the inputs:
002:i:01 will return the input 1 value
All commands from the module is sent with a checksum.
I/O
Input
- PC0 Input 1
- PC1 Input 2
- PC2 Input 3
- PC3 Input 4
- PC4 Input 5
- PC5 Input 6
- PD5 Input 7
- PD6 Input 8
- PD7 Input 9
Outputs
- PB0 Output 1
- PB1 Output 2
- PB2 Output 3
- PB3 Output 4
- PB4 Output 5
- PB5 Output 6
- PB6 Output 7
- PB7 Output 8
- PD2 Output 9
- PD3 Life-signal (to Module stability monitoring unit 2)
- PD4 Link activity
D-Sub 25-pin
- 5V +
- 5V -
- Input 1
- Input 2
- Input 3
- Input 4
- Input 5
- Input 6
- Input 7
- Input 8
- Input 9
- Output 1
- Output 2
- Output 3
- Output 4
- Output 5
- Output 6
- Output 7
- Output 8
- Output 9
- Life-signal
Communication
Interfacing is done with RS-232, using MAX232 or MAX202 and the SIOS protocol.
13:53:08 => 002:i:06:1:122
13:53:08 <= 002:i:06:0
13:53:05 => 002:o:01:0:122
13:53:05 <= 002:o:01:0
13:53:03 => 002:o:01:1:123
13:53:03 <= 002:o:01:1
13:52:58 => 002:s:01:1:127
13:52:35 => 002:s:00:1:126
Serial settings
- Baud: 9600
- Data bits: 8
- Parity: None
- Stop bits: 1
Source code
- Bascom-AVR source is available in a git repository:
- https://github.com/thomasjsn/AVR-Online-serial-interface/tree/v1.0
Photos
Schematic drawing
Parts list
- 1 × AVR ATmega8-16PU, DIL-28, 16 MHz, 23 I/Os
- 5 × Capacitor, aluminium electrolytic, 1 µF, 50V
- 1 × Capacitor, aluminium electrolytic, 10 µF, 25V
- 1 × Capacitor, ceramic, 1 nF, 100V
- 2 × Capacitor, metallized polyester foil, 10 nF, (0.01 µF)
- 1 × D-sub soldering cups, 25 pin male
- 1 × D-sub soldering cups, 9 pin female
- 1 × DIL socket, 16-pin, 7.62mm
- 1 × DIL socket, 28-pin, 7.62mm
- 1 × Enclosure, plastic (1591 FL), 150x80x50mm, flange
- 1 × Fuse 5x20 mm, 800 mA, fast-acting
- 1 × Fuse holder, panel, 5x20mm, PTF30
- 1 × LED 5mm clear, Green, 2.1V, 20mA, 385mcd, 6°
- 1 × LED 5mm clear, Yellow, 2.0V, 20mA, 250mcd, 6°
- 1 × LED lens 5mm, CLB 300 low, Green
- 1 × LED lens 5mm, CLB 300 low, Yellow
- 64 cm2 PCB, stripboard, 100x160mm, 160cm2
- 11 × Resistor, carbon film, 0.25W, 330 Ω, 5%
- 11 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
- 9 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
- 1 × RS232 interface, MAX232CPE, dual
- 58 × Straight pin header, female, Single row, 2.54mm
- 48 × Straight pin header, male, Single row, 2.54mm
- 11 × Straight pin header, male, Y, Single row, 2.54mm
- 10 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B
Last commit 2024-11-11, with message: Add lots of tags to posts.
All posts in Rack Box Project series
- Parallel port I/O module
- Power supply and fuse monitoring module, AVR
- Monitored fuse box, 6 channels
- Stack lights and horn controller — with AVR
- Mute and light controller for the Rack box — AVR module
- Monitored fuse box, 4 channels
- Module heartbeat monitor, 6 inputs — AVR
- Controller for lights and relays — AVR driven
- Emergency power off controller — controlled by 555 timers
- Fan controller with LCD — AVR powered
- Sound alarm control unit — AVR module
- Multiplexer output extender
- Multi-purpose AVR module
- Electric heater and timer controller — AVR
- Module heartbeat monitor, 15 inputs — LCD and AVR
- Serial port I/O module with 11 inputs — AVR
- Serial port I/O module with 9 in and outputs — AVR
- Serial interface for emergency power off — AVR
- Status panel for the Rack box project
- Intruder alarm system controller — AVR
- Serial port I/O module with 15 inputs — AVR
- Serial interface module, with analog and digital I/O — AVR
- The rack box project — an overview