Beruflich Dokumente
Kultur Dokumente
USERS MANUAL
Revision A, June 2014
Designed by OLIMEX Ltd, 2014
OLIMEX 2014
DISCLAIMER
2014 Olimex Ltd. Olimex, logo and combinations thereof, are registered trademarks of Olimex Ltd. Other product
names may be trademarks of others and the rights belong to their respective owners.
The information in this document is provided in connection with Olimex products. No license, express or implied
or otherwise, to any intellectual property right is granted by this document or in connection with the sale of
Olimex products.
This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of
this license, visit http://www.creativecommons.org/licenses/by-sa/3.0/.
This hardware design by Olimex LTD is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported
License.
The part of the example software that was written by Olimex is released under GPL. If there are parts of the software
belonging to other developers or companies they maintain their respective rights of the code.
It is possible that the pictures in this manual differ from the latest revision of the board.
The product described in this document is subject to continuous development and improvements. All particulars of the
product and its use contained in this document are given by OLIMEX in good faith. However all warranties implied or
expressed including but not limited to implied warranties of merchantability or fitness for purpose are excluded. This
document is intended only to assist the reader in the use of the product. OLIMEX Ltd. shall not be liable for any loss or
damage arising from the use of any information in this document or any error or omission in such information or any
incorrect use of the product.
This evaluation board/kit is intended for use for engineering development, demonstration, or evaluation purposes only
and is not considered by OLIMEX to be a finished end-product fit for general consumer use. Persons handling the
product must have electronics training and observe good engineering practice standards. As such, the goods being
provided are not intended to be complete in terms of required design-, marketing-, and/or manufacturing-related
protective considerations, including product safety and environmental measures typically found in end products that
incorporate such semiconductor components or circuit boards.
Olimex currently deals with a variety of customers for products, and therefore our arrangement with the user is not
exclusive. Olimex assumes no liability for applications assistance, customer product design, software performance, or
infringement of patents or services described herein.
Page 2 of 28
OLIMEX 2014
Table of Contents
DISCLAIMER............................................................................................................. 2
CHAPTER 1: OVERVIEW........................................................................................5
1. Introduction to the chapter.......................................................................................................5
1.1 Features.....................................................................................................................................5
1.2 Target market and purpose of the board...............................................................................5
1.3 Board variants..........................................................................................................................6
1.4 Board version used in the manual..........................................................................................6
1.5 Document organization........................................................................................................... 6
OLIMEX 2014
CHAPTER 7: SCHEMATICS..................................................................................23
7. Introduction to the chapter.....................................................................................................23
7.1 Eagle schematic......................................................................................................................23
7.2 Physical dimensions...............................................................................................................25
Page 4 of 28
OLIMEX 2014
CHAPTER 1: OVERVIEW
1. Introduction to the chapter
Thank you for choosing the MOD-IO extension module from Olimex! This document provides a
users guide for the MOD-IO board. As an overview, this chapter gives the scope of this document
and lists the boards features. The documents organization is then detailed.
The MOD-IO board allows easy expansion of the functionality of other boards by adding relays,
optocouplers and analog inputs.
MOD-IO is an open-source, open-hardware project and all documentation is available to the
customer.
1.1 Features
The board has the following set of features:
OLIMEX 2014
have. The customer can choose which new feature he wants to expand. More on the UEXT might be
found in the following document:
https://www.olimex.com/Products/Modules/UEXT/resources/UEXT_rev_B.pdf
MOD-IO provides 4 relays with proper connector that allow the switching of circuits. The board is
also equipped with 4 optocouplers (also known as opto-isolators) that transfer electrical signals
between two isolated circuits by using light. MOD-IO also has 4 analog inputs won a connector.
MOD-IO comes with built-in firmware which makes the usage of the board's peripherals much
easier. It uses a standard I2C communication and several commands are defined. The source of the
firmware is also available to the customer.
Customers have full access to the technical documentation of the board. The software is released
under General Purpose License and the board is considered open-hardware all schematics and
board design files are available to the customer under the Creative Commons AttributionShareAlike 3.0 Unported License.
Page 6 of 28
OLIMEX 2014
OLIMEX 2014
OLIMEX 2014
than others. This is perfectly normal for some chips for instance voltage regulators and the main
processor.
Page 9 of 28
OLIMEX 2014
The demo requires an established hardware I2C connection between the module and a host board.
You would need to send and receive parameters to the slave device to be able to communicate with
the following peripherals on the board:
- Digital outputs (relays): OUT1, OUT2, OUT3, OUT4 signals: O1, O2, O3, O4.
- Digital inputs (optocouplers): IN1, IN2, IN3, IN4 signals: I1, I2, I3, I4.
- Analogue inputs: AIN-1-2, AIN-1-3, AIN-2-1, AIN-2-2 signals AN1, AN2, AN3, AN4.
There is nothing specific about the I2C protocol. Default address of the slave is 0b1011000 (058).
When addressed, the device acknowledges reception with an ACK flag set to 0 to indicate its
presence. After connection is established you can use additional commands, detailed below.
2.6.1 Setting relays
Set states of the digital outputs on the board. The board features four relay outputs named OUT1,
OUT2, OUT3 and OUT4 that can be set together with one command. The command should have
the following 3 byte format:
************************************
S aaaaaaaW cccccccc 0000dddd P
************************************
,where
S start condition
aaaaaaa slave address of the board
W write mode, should be 0
cccccccc command code, should be 010
dddd bitmap of the output states, i.e. bit0 corresponds to REL1, bit1 to REL2 and so on. '1'
switches the relay ON, '0' switches to OFF state.
P Stop condition
Example:
To set REL1 and REL3 in pseudo code:
i2cStart();
i2cSend(0xb0);
i2cSend(0x10);
i2cSend(0x05);
i2cClose();
OLIMEX 2014
,where
S start condition
aaaaaaa slave address of the board
W write mode, should be 0
cccccccc command code, should be 020
P Stop condition
R read mode, should be 1
dddd bitmap of the input states received from the MOD-IO board, i.e. bit0 corresponds to
IN1, bit1 to IN2 and so on. '1' means that power is applied to the optocoupler, '0' means the
opposite.
Note: Successive readings from the board without reissuing the command code will not get an
updated value of the ports (i.e. the user will read the same value) until another command is issued.
Example:
Reading optocoupled inputs in pseudo code
i2cStart()
i2cSend(0xb0);
i2csend(0x20);
i2cClose();
i2cStart();
i2cSend(0xb1);
byte = i2cRead();
i2cClose();
/* byte now holds the state of the inputs. To decode bitmask the data. */
in1 = byte & 0x01; //To get state of IN1
in2 = byte & 0x02; //To get state of IN2
in3 = byte & 0x04; //To get state of IN3
in4 = byte & 0x08; //To get state of IN4
2.6.3 Reading the value of an analog input
Get the voltage applied to one of the analogue inputs of the board. The board features four 10bit
resolution analogue inputs (input voltages from 0 3.3V) and each of them is read with a separate
command. Command should have the following common format:
************************************
S aaaaaaaW cccccccc P S aaaaaaaR dddddddd 000000dd P
************************************
,where
S start condition
aaaaaaa slave address of the board
W write mode, should be 0
cccccccc command code, should be 030 for AIN1, 031 for AIN2, 031 for AIN3, 031
Page 11 of 28
OLIMEX 2014
for AIN4.
P Stop condition
R read mode, should be 1
dddddddd 000000dd Little Endian (LSB: MSB) 10bit binary encoded value corresponding
to the input voltage. Range is 0 03FF and voltage on the pin is calculated using the following
simple formula: voltage = (3.3 / 1024) * (read value) [Volts]
Note: Successive readings from the board without reissuing the command code will not get an
updated value of the voltage (i.e. the user will read the same value) until another command is
issued.
Example:
Reading AN1 in pseudo code:
i2cStart();
i2cSend(0xb0);
i2cSend(0x30);
i2cStop();
i2cStart();
i2cSend(0xb1);
l_byte = i2cRead();
h_byte = i2cRead();
i2cStop();
/* Since l_byte is (LSB:MSB) we need to convert it to (MSB:LSB). To swap bits one by one
do the following */
analog = 0;
for(int index = 0; index < 8; index++){
analog |= ((l_byte & 0x80) ? 1 : 0) << index;
l_byte <<= 1;
}
/* Now add the high 2 bit to the value */
analog |= ((h_byte & 0x02) ? 1 : 0) << 8;
analog |= ((h_byte & 0x01) ? 1 : 0) << 9;
/* To convert digital reading to voltage use this */
voltage = (analog*3.3)/1023;
2.6.4 Changing the I2C address of a board
Sets new slave address to the board. The board ships with default 7bit address 058 that can be
changed to any other 7bit value in order for the host to interface more than 1 device connected on
the bus at the same time. Change is stored in EEPROM and thus is permanent between power
cycles. Changing the address requires the following command format:
************************************
S aaaaaaaW cccccccc 0ddddddd P
Page 12 of 28
OLIMEX 2014
************************************
,where
S start condition
aaaaaaa slave address of the board (the default or the old address of the board)
W write mode, should be 0
cccccccc command code, should be 0xF0
ddddddd new 7bit address to update
P Stop condition
NB!! To protect the device from accidental address updates the user should hold the on-board
button pressed (not the RESET button!) while issuing the command. Successful update is indicated
with the on-board status LED being contently lit for 2-3 seconds. Address is immediately updated
so the board will not respond to its old address any more.
IMPORTANT: The default address of the board could be restored if the on-board button is held
pressed at power up for more than 4 seconds. This situation is indicated by the on-board LED
blinking fast for the timeout period. When the fast blinking ends default address is restored.
Example:
Change address to 0x22 in pseudo code:
i2cStart();
i2cSend(0xb0);
i2cSend(0xF0);
i2cSend(0x22);
i2cClose();
OLIMEX 2014
Page 14 of 28
OLIMEX 2014
Page 15 of 28
OLIMEX 2014
OLIMEX 2014
Page 17 of 28
OLIMEX 2014
6.2 AVRISP
The AVRISP connector is used to program the board. You can plug a standard ISP programmer
(which has a 10-pin connector) to it. Make sure your programmer supports the programming of
ATMEGA16A microcontroller. Almost any ISP programmer would be capable of programming the
chip.
OLIMEX sells at least two programmers suitable for the board they are named AVR-ISP500 and
AVR-ISP-MK2 both working fine with all versions of Atmel Studio and also open source tools
like AVRDude. Both have 10-pin ISP connector.
If your programmer has only 6 pin interface you can still use it for programming as long as you
make a small adapter or set jumper wires properly. Tables with proper connections required to
convert 6-pin ISP to 10-pin ISP are seasy to be found. You can also use our adapter AVR-ICSP:
https://www.olimex.com/Products/AVR/Programmers/AVR-ICSP/
The pinout of AVRISP might be found below:
Pin #
Signal name
MOSI
3.3V
NC
GND
RST
GND
Page 18 of 28
OLIMEX 2014
SCK
GND
MISO
10
GND
6.3 JTAG
The JTAG connector is used to program the board. You can plug a standard ISP programmer (which
has a 10-pin connector) into it. Make sure your programmer supports the programming of
ATMEGA16A microcontroller. Almost any ISP programmer would be capable of programming the
chip.
Pin #
Signal Name
TCK
GND
TDO
3.3V
TMS
RST
3.3V
NC
TDI
10
GND
6.4 EXT
The EXT connector has 4 pins from the ATMEGA16A's port D PD4, PD5, PD6 and PD7; it has a
VCC and GND for easier access also.
Pin #
Signal Name
PD7
PD6
PD5
PD4
3.3V
GND
Page 19 of 28
OLIMEX 2014
6.5 UEXT_MALE
This connector is usually used for the I2C communication with the host board (the more powerful
board that uses the MOD-IO).
Additional 10-pin female-female cables might be purchased from our web-shop:
https://www.olimex.com/Products/Components/Cables/CABLE-IDC10-15cm/
Pin #
Signal Name
NC
GND
RXD
TXD
SCL
SDA
MISO
MOSI
SCK
10
#SS
6.6 UEXT_FEMALE
The UEXT female connector is not typical for the OLIMEX boards. It allows multiple MOD-IO
boards to be connected to each other even without the need of a cable! Just plug the
UEXT_FEMALE of board 1 to the UEXT_MALE of board 2. You can have as many boards as you
want as long as each of them has unique identifier for the I2C communication.
Pin #
Signal Name
NC
GND
RXD
TXD
SCL
SDA
MISO
MOSI
SCK
10
#SS
OLIMEX 2014
sending and receiving commands over the I2C line located on the UEXT connector.
6.7.1 IN1, IN2 IN3, IN4 digital inputs
Pin #
Signal
Signal Name
Connected to
3.3V
VCC
AN1
(ADC7)PA7
AN2
(ADC6)PA6
Pin #
Signal Name
Connected to
AN3
(ADC5)PA5
AN4
(ADC4)PA4
AGND
Analog GND
AIN-2
OLIMEX 2014
Pin #
Signal Name
Power Input
GND
More info about the power supply can be found in chapter 5 of this manual.
Page 22 of 28
OLIMEX 2014
CHAPTER 7: SCHEMATICS
7. Introduction to the chapter
In this chapter is located information about the schematics describing logically and physically
MOD-IO.
Page 23 of 28
OLIMEX 2014
YDJ-1134
8-30 VDC
INV
SW
N.C.
FB
RT
C3
GND
R2
IN
110k
C5
AIN-1-1
ADJ/GND
R4
8.2K
C6
10n
240R/1%
C7
R6
100n
390R/1%
C8
C9
100n
R5
Fmax=50kHz
R19
AIN-1-2
100R
AN1
C20
NA
33nF
AIN-1-3
TB2/3.5mm
R22
C21
NA
33nF
AN[1..4]
AN3
100R
R24
C22
NA
33nF
2
4
6
8
10
1
3
5
7
9
C23
R26
3.3V
JTAG
AIN-2-3
3.3V
TB2/3.5mm
2
4
RST 6
8
10
IN4-1
IN3-1
IN2-1
IN1-1
red
LED3
330R
D4
1N4148/SMD
26
25
24
23
22
21
20
19
I1
BUT
TXD
RXD
16
15
14
13
12
11
10
9
EXT
WF6S
U5
1
I2
(TOSC2)PC7
(TOSC1)PC6
PC5(TDI)
PC4(TDO)
PC3(TMS)
PC2(TCK)
PC1(SDA)
PC0(SCL)
(OC2)PD7
(ICP)PD6
(OC1A)PD5
(OC1B)PD4
(INT1)PD3
(INT0)PD2
(TXD)PD1
(RXD)PD0
330R
D2
1N4148/SMD
H11A817SMD
3.3V
AVCC
28
AGND
1K
R39
10K
C15
100n
3.3V
D7
1N4148/SMD
VCC
O3
38
VCC2
4.7K
OUT2-3
OUT2-2
OUT2-1
17
VCC1
R41
T2
BC817
1K
R42
10K
GND
C16
18
GND1
C17
C18
100n 100n
100n
39
GND2
ATMEGA16L
3.3V
3.3V
R12
4.7K
R13
R34
REL2
R43
1K
D6
1N4148/SMD
3.3V
3.3V
3.3V
R14
R15
R16
R17
R18
NA
4.7K
NA
4.7K
4.7K
BUT
UEXT_MALE
100R
C19
BUT
100n
T1107A(6x3.8x2.5mm)
RXD
SCL
MISO
SCK
1
3
5
7
9
2
4
6
8
10
TXD
SDA
MOSI
#SS
BH10S
Page 24 of 28
UEXT_FEMALE
RXD
SCL
MISO
SCK
1
3
5
7
9
2
4
6
8
10
TXD
SDA
MOSI
#SS
IDC10S/PCB
R44
1K
R45
10K
3.3V
R32
4.7K
I4
green
O2
REL2
RAS-05-15
green
O1
REL1
RAS-05-15
REL1
R46
1K
OUT1-3
OUT1-2
OUT1-1
I3
I3
T3
BC817
MCP130T
100n
27
OUT3-2
3.3V
C14
29
AREF
R38
NA
O4
U3
1
O2
O[1..4]
I4
red
LED1
XTAL1
C11
C12
33p
C13
33p
Q1
OUT3-3
OUT3-1
VCC 2
GND
7
REL3
R40
1K
U2
4.7K
U4
1
1 RESET
8MHz/20pF
green
O3
REL3
RAS-05-15
R10
RST
XTAL2
(SCK)PB7
(MISO)PB6
(MOSI)PB5
(SS)PB4
(AIN1)PB3
(AIN0/INT2)PB2
(T1)PB1
(T0)PB0
R30
H11A817SMD
4.7K
TDI
1
2
3
4
5
6
R28
H11A817SMD
red
LED2
330R
D3
1N4148/SMD
R33
IN1-2
I1
H11A817SMD
100n
RESET
(ADC7)PA7
(ADC6)PA6
(ADC5)PA5
(ADC4)PA4
(ADC3)PA3
(ADC2)PA2
(ADC1)PA1
(ADC0)PA0
I2
R31
IN2-2
U6
1
2
R29
IN3-2
red
LED4
330R
D5
1N4148/SMD
T1107A(6x3.8x2.5mm)
D8
1N4148/SMD
3.3V
+5V
TDI
TDO
TMS
TCK
SDA
SCL
G ND
3.3V
R27
+
Q2
32768Hz/6pF
TCK
TDO
TMS
1
3
5
7
9
I1
IN4-2
330R
STAT
yellow
3.3V
33nF
NA
RST
C10
+5V
3
2
1
44
43
42
41
40
RST
R11
AN4
100R
T4
BC817
R36
10K
O[1..4]
SCK
MISO
MOSI
#SS
LED
I2
I3
I4
AVRISP
BH10S
AIN-2-2
R35
1K
GND
30
31
32
33
34
35
36
37
3.3V
AIN-2-1
OUT4-1
O1
1K
10K
AN1
AN2
AN3
AN4
O4
O3
O2
O1
O[1..4]
R23
OUT4-3
OUT4-2
R8
R9
AN2
100R
REL4
R37
1K
2K
100R
R21
green
O4
REL4
RAS-05-15
+5V
R20
D9
1N4148/SMD
PWR_LED
red
R7
47uF/6.3V
0R
4n7
OUT
100n
D1
1N5819(smd)
R3
3.3V
VR2(3.3V)
LM1117IMPX-ADJ
100uH/SW68
BD9001FSO-8
C1
+5V
L1
150k
EN
220u/10V/tant
R1
3.3V
VIN
C4
220uF/35V
1uF/50v
5
+5V
VR1(5V)
8
C2
PWR_J
MOD-IO
Rev. A
COPYRIGHT(C), 2009
http://www.olimex.com/dev
T1
BC817
OLIMEX 2014
Page 25 of 28
OLIMEX 2014
Modified page
All
Notable changes
Initial release of the board
Page 26 of 28
OLIMEX 2014
Page 27 of 28
OLIMEX 2014
Page 28 of 28