Modbus family - AVR controler solution

Made some automation solutions with AVR controllers connected via Modbus to a SCADA system. ( Ver. 1999 )

Modbus generals

Modbus is probably the most spread serial protocol in industry. Most devices, being able to communicate serial, talk Modbus.

One of the best sources for detailed information’s is http://www.Modbus.org/

The communication is master / slave driven. Modbus is capable to run full-duplex RS232 lines and half-duplex RS485 solution.
Also newer implementation variants run via Ethernet &TCP/IP.

A typical Modbus telegram shown in hex characters is:

Request from master                       02 03 00 08 00 01 05 FB            
with the answer from slave              02 03 02 02 01 3C E4           

To slave 02 request 03, to send back from his address 0008, one word (00 01), with checksum 05 FB,  and
from slave 02 answer 03, with 02 bytes, the values 02 01, and checksum 3C E4.                                        

If you want to give your application an easy connectivity to most of the worlds devices, so you should choose Modbus at your first thought.

And if you are a friend of Mark Albert’s fine Basic implementation, choose this code to help yourself saving money.

The application is purely BASCOM Basic. It’s a software implementation for Atmel AVR controllers.
The smallest, fully tested version is for AVR 2313 with RS485, running the board you see below.

All here presented modules are a slave implementation, but you can easily change to your specific master implementation.

If you want to get the downloadable code please go to Mark Alberts shop on his page
http://www.mcselec.com/modbus.htm

Modbus Device tester

Download Modbus-master application to test your devices:
ModBus Master tester



AVR 2313 module with 16 Digital input and 16 digital outputs
AVR 2313 board
AVR 2313 BRD layout
.pdf
AVR 2313 schematic
.pdf
Address map
Low  
byte
High  
byte
Functionality
.
000116 multiplexed input 1..16;   signal status
020316 multiplexed outputs;   normal function, 1 => output 1..16 goes high   
040516 same outputs;  1 means out 1..16 goes high until input1..16 is high
060716 bit counter;   parametered counting of input 1..8
0809Counter parameter                Slave address
0A0BSpare
0C0DSpare
0E0FSpare

Documentation: ModBu_slave_for_AVR_2312.pdf
Loadable STK200 sample: ModBus slave AVR 2312



AVR 8515 on DTR103 with connected LCD
AVR 2313 BRD layout
AVR 8515 with LCD schematic
.pdf
Address map
Low  
byte
Highest  
byte
Functionality
.
0003Reserved for inputs 1..32 ;   signal status
0409Reserved for outputs 1..32 ;   normal function   
0809Reserved for parameter                Slave address              
0A0FSpare
105FAll 80 bytes are shown as string(80)

Not yet available Documentation: ModBus slave for AVR 8515 LCD.pdf



AVR 8535 on SIMM100 for 4 PID regulators
AVR 8535 PID with SIMM100
AVR 8535 for PID schematic
.pdf
Address map
Low  
byte
Highest  
byte
Functionality
.
0003inputs 1..32 ;   signal status
0409outputs 1..32 ;   normal function   
0809Counter parameter                Slave address              
0A0FSpare
105FHAS TO BE FILLED IN

Not yet available Documentation: ModBus slave for AVR 8535 PID.pdf