27
input_value_0 = MMnet102_SEL2_0;
// read from input register 0
input_value_1 = MMnet102_SEL2_1;
// read from input register 1
input_value_2 = MMnet102_SEL2_2;
// read from input register 2
input_value_3 = MMnet102_SEL2_3;
// read from input register 3
A
1
B
2
C
3
OE2A
4
OE2B
5
OE1
6
Y7
7
GND
8
Y6
9
Y5
10
Y4
11
Y3
12
Y2
13
Y1
14
Y0
15
VCC
16
74HCT138
A
1
B
2
C
3
OE2A
4
OE2B
5
OE1
6
Y7
7
GND
8
Y6
9
Y5
10
Y4
11
Y3
12
Y2
13
Y1
14
Y0
15
VCC
16
74HCT138
A0
A1
A0
A1
GND
GND
+5V
+5V
GND
GND
+5V
+5V
SEL1
SEL2
#WR
#RD
#WR1
#WR2
#WR3
#RD1
#RD2
#RD3
LED1
LED0
LED2
LED3
LED4
LED5
LED6
LED7
GND
+5V
GND
1k
+5V
10k
+5V
SW0
SW1
SW2
SW3
SW4
SW5
SW6
SW7
GND
#WR0
#RD0
+5V
GND
+5V
#WR0
#RD0
10k 10k 10k 10k 10k 10k 10k
1k
1k
1k
1k
1k
1k
1k
DIR
1
A0
2
A1
3
A2
4
A3
5
A4
6
A5
7
A6
8
A7
9
GND
10
OE
19
Q7
11
B6
12
B5
13
B4
14
B3
15
B2
16
B1
17
B0
18
VCC
20
74HCT245
AD1
AD5
AD7
AD3
AD6
AD0
AD2
AD4
AD0
AD1
AD2
AD3
AD4
AD5
AD6
AD7
AD0
AD1
AD2
AD3
AD4
AD5
AD6
AD7
AD0
AD1
AD2
AD3
AD4
AD5
AD6
AD7
OE
1
D0
2
D1
3
D2
4
D3
5
D4
6
D5
7
D6
8
D7
9
GND
10
CP
11
Q7
12
Q6
13
Q5
14
Q4
15
Q3
16
Q2
17
Q1
18
Q0
19
VCC
20
74HCT574
Figure 21
An example of using the SEL output as an address selection output.
4 Programming the module
The ATmega128 microcontroller has 128kB of Flash memory programmable in the system for the program
code and 4kB of EEPROM memory for user’s data. Programming of these memories can be effected in two
ways: by means of an ISP interface or through JTAG. Both interfaces have a standard of used connectors and
a standard of arranging signals in the connector.
ISP connector
The programmer in ISP standard communicates with the microcontroller through a three-wire SPI interface
(plus the RESET signal and power supply). The interface uses the I/O terminals of the microcontroller (PE0,
PE1 and PB1) which, after the programming, can fulfill ordinary functions. When connecting peripherals to
these terminals it should be remembered that the programmer should have the possibility to force appropriate
logic levels on them. The figures below present the method of connecting the ISP connector to the module.