Manual PORT Expander All Mikroelektronikas development systems feature a large number of peripheral modules expanding microcontrollers range of application and making the process of program testing easier. In addition to these modules, it is also possible to use numerous additional modules linked to the development system through the I/O port connectors. Some of these additional modules can operate as stand-alone devices without being connected to the microcontroller. MikroElektronika Additional BoardPORT Expander Additional Board The PORT Expander additional board provides easy I/O port expansion using a standard serial interface such as SPI. Connection with a development system is established by connecting 2x5 male connectors on the additional board to the appropriate port on the development system. Depending on the development system in use, it is necessary to select one of three connectors supplied on the additional board. For dsPIC development systems, the CN1 (dsPIC) connector is connected to the PORTF port. For AVR-8051 development systems, the CN2 (AVR-8051) connector is connected to the PORTB port. PIC development systems use the PORTC port to establish connection with the CN3 (PIC) connector on the additional board. The PORT Expander board provides two additonal ports PORTA and PORTB for the development system it is connected to. 2x5 male connector is used with Jumpers used to determine the dsPIC development systems port expanders hardware address Additional port PORTA 2x5 male connector is used with AVR-8051 development sysems 2x5 male connector is used with Additional port PORTB PIC development systems Figure 1: PORT Expander additional board The PORT Expander additional board uses SPI serial interface to communicate with the microcontroller provided on the development system it is connected to. Additional ports receive/send data in parallel format, which means that it is necessary to convert it into serial format. The MCP23S17 circuit, supplied on the additional board, is used to convert data received from 16 additional pins and to transmit it to the microcontroller via two pins. The advantage of such conversion is obvious. Instead of 16 lines, the additional board is connected to the microcontroller via only four lines known as data receive/transmit lines and two control lines. The function of pins provided on connectors CN1, CN2 and CN3 is as follows: MOSI - Master Output, Slave Input (microcontroller output, MCP23S17 input) MISO - Master Input, Slave Output (microcontroller onput, MCP23S17 output) SCK - Serial Clock (microcontroller clock signal) CS - Chip Select (data transfer enable) INTA - Interrupt pin INTB - Interrupt pin Data transfer via MOSI and MISO lines is performed simultaneously in both directions. The MOSI line is used to transfer data from the microcontroller to the port expander, whereas the MISO line is used to transfer data from the port expander to the microcontroller. The microcontroller starts data transfer when the CS pin is driven low (0) by sending a clock signal (SCK). MikroElektronika