The main module of the HomeLab is a controller development board (controller board) equipped with the AVR ATmega128 microcontroller. In addition to the microcontroller, the board consists of several peripherals, voltage stabilizer, connectors, etc. The controller board has the following features:
Module is equipped with AC/DC rectifier circuit and LDO voltage stabilizer (with low dropout) - external feeder with voltage stabilization is not needed.
Module can be powered just from step down transformer with output voltage greater than 6 volts and lower than 15 volts. Module has a wrong-polarization protection circuit (Greatz bridge). POWER LED signalizes connected feed (“POWER” description on the board).
Circuit can be equipped with external power switch by connecting it to S2 2-pin on/off connector. If external power switch is not used, S2 2-pin on/off connector must be shorted.
All ATmega128 signals are available on three connectors on the edge of the board. Connectors pin assignment is described in the next part of this instruction. It includes full descriptions of ATmega128 pins and their alternative functions. The module is equipped with microprocessor reset circuit (when power on) and reset button for microprocessor restart. Microprocessor can be programmed with ISP or JTAG programmer.
To the seventh pin of port B (named as PB7) the status LED (described as PB7 on the board) is connected. This LED can be used as a status indicator of application software. Low state on PB7 pin causes the status LED to be lit.
Module provides two serial ports described on the board as UART1 and UART2. The first one is 9-pin female connector (DB-9 PC serial port compatible) and the second is 3-pin connector. MAX232 circuit provides signal conversion to serial standard.
Multiplexer 74HC4053 provides full use of ports, including those used for microprocessor programming, because in reset state (when programmed) the processor multiplexer switches PE0, PE1 and PB1 signals to ISP and JTAG connector. When the processor is in run state, these signals are switched to connectors on the edge of the board.
Module is equipped with external memory (Atmel AT45DB041B). It is 4Mbit serial data flash memory connected to Master/Slave SPI serial interface of the microprocessor. Internal Real Time Clock is connected to external 32.768 kHz crystal resonator named as X2 on the board.
Nr | Pin | Alternative function / Description | |
---|---|---|---|
1 | PD7 | T2 | Timer/Counter2 Clock Input |
2 | PD6 | T1 | Timer/Counter1 Clock Input |
3 | PD5 | XCK1 | USART1 External Clock Input/Output |
4 | PD4 | IC1 | Timer/Counter1 Input Capture Trigger |
5 | PD3 | INT3/TXD1 | External Interrupt3 Input or UART1 Transmit Pin |
6 | PD2 | INT2/RXD1 | External Interrupt2 Input or UART1 Receive Pin |
7 | PD1 | INT1/SDA | External Interrupt1 Input or TWI Serial Data |
8 | PD0 | INT0/SCL | External Interrupt0 Input or TWI Serial Clock |
9 | VCC | - | +5V |
10 | GND | - | GND |
11 | PB7 | OC2/OC1C | Output Compare and PWM Output for Timer/Counter2 or Output Compare and PWM Output C for Timer/Counter1 |
12 | PB6 | OC1B | Output Compare and PWM Output B for Timer/Counter1 |
13 | PB5 | OC1A | Output Compare and PWM Output A for Timer/Counter1 |
14 | PB4 | OC0 | Output Compare and PWM Output for Timer/Counter0 |
15 | PB3 | MISO | SPI Bus Master Input/Slave Output |
16 | PB2 | MOSI | SPI Bus Master Output/Slave Input |
17 | PB1 | SCK | SPI Bus Serial Clock |
18 | PB0 | SS | SPI Slave Select Input |
19 | PE7 | INT7/IC3 | External Interrupt 7 Input or Timer/Counter3 Input Capture Trigger |
20 | PE6 | INT6/ T3 | External Interrupt 6 Input or Timer/Counter3 Clock Input |
21 | PE5 | INT5/OC3C | External Interrupt 5 Input or Output Compare and PWM Output C for Timer/Counter3 |
22 | PE4 | INT4/OC3B | External Interrupt4 Input or Output Compare and PWM Output B for Timer/Counter3 |
23 | PE3 | AIN1/OC3A | Analog Comparator Negative Input or Output Compare and PWM Output A for Timer/Counter3 |
24 | PE2 | AIN0/XCK0 | Analog Comparator Positive Input or USART0 external clock input/output |
25 | PE1 | PDO/TXD0 | Programming Data Output or UART0 Transmit Pin |
26 | PE0 | PDI/RXD0 | Programming Data Input or UART0 Receive Pin |
Nr | Pin | Alternative function / Description | |
---|---|---|---|
1 | GND | - | GND |
2 | VCC | - | +5V |
3 | PA0 | AD0 | External memory interface address and data bit 0 |
4 | PA1 | AD1 | External memory interface address and data bit 1 |
5 | PA2 | AD2 | External memory interface address and data bit 2 |
6 | PA3 | AD3 | External memory interface address and data bit 3 |
7 | PA4 | AD4 | External memory interface address and data bit 4 |
8 | PA5 | AD5 | External memory interface address and data bit 5 |
9 | PA6 | AD6 | External memory interface address and data bit 6 |
10 | PA7 | AD7 | External memory interface address and data bit 7 |
11 | - | NC | Not connected |
12 | - | NC | Not connected |
13 | PG2 | ALE | Address Latch Enable to external memory |
14 | - | NC | Not connected |
15 | PC6 | A14 | External memory interface address and data bit 14 |
16 | PC7 | A15 | External memory interface address and data bit 15 |
17 | PC4 | A12 | External memory interface address and data bit 12 |
18 | PC5 | A13 | External memory interface address and data bit 13 |
19 | PC2 | A10 | External memory interface address and data bit 10 |
20 | PC3 | A11 | External memory interface address and data bit 11 |
21 | PC0 | A8 | External memory interface address and data bit 8 |
22 | PC1 | A9 | External memory interface address and data bit 9 |
23 | PG0 | WR | Write strobe to external memory |
24 | PG1 | RD | Read strobe to external memory |
25 | - | NC | Not connected |
26 | - | NC | Not connected |
Nr | Pin | Alternative function / Description | |
---|---|---|---|
1 | VCC | - | +5V |
2 | GND | - | GND |
3 | REF | AREF | Analog reference voltage for ADC |
4 | GND | - | GND |
5 | PF0 | ADC0 | ADC input channel 0 |
6 | GND | - | GND |
7 | PF1 | ADC1 | External memory interface address and data bit 4 |
8 | GND | - | GND |
9 | PF2 | ADC2 | External memory interface address and data bit 6 |
10 | GND | - | GND |
11 | PF3 | ADC3 | Not connected |
12 | GND | - | GND |
13 | PF4 | ADC4/TCK | ADC input channel 4 or JTAG Test ClocK |
14 | GND | - | GND |
15 | PF5 | ADC5/TMS | ADC input channel 5 or JTAG Test Mode Select |
16 | GND | - | GND |
17 | PF6 | ADC6/TDO | ADC input channel 6 or JTAG Test Data Output |
18 | GND | - | GND |
19 | PF7 | ADC7/TDI | ADC input channel 7 or JTAG Test Data Input |
20 | GND | - | GND |
When connecting the controller module with other peripheral modules and devices, one should connect the power supply last. If power is on, it is dangerous to connect and disconnect external devices. Modules have to be connected with each other with great care without applying strong force as this can bend connectors. JTAG-ICE programmer have to be connected to the correct port and the ribbon cable directs out from board (red stripe is by the power supply connector side).