Close

Not a member yet? Register now and get started.

lock and key

Sign in to your account.

Account Login

Forgot your password?

Adding More Digital I/O Part 1

  

Part 1 -Adding More Digital I/O to your 16 Bit Experiments Kit (The Hardware) 

  

If you purchased the 16 bit Micro Experimenter kit (see figure 1) you are already familiar with its solderless breadboard environment and the 10 line I/O expansion bus that comes with the kit. The Experimenter expansion bus is fully programmable: the 10 lines can be assigned to be digital, analog or even connected to any of the PIC24F Microcontroller’s internal extensive peripheral set (i.e. dual UART, five CCP modules, ADC, Real time Clock Calendar, dual SPI, and dual I2C). 

 

Figure1 16 Bit Experimenter
But you find this 10 line I/O capability constraining there is a really cool enhancement to add even more I/O to your kit: the Microchip 8 bit I/O Expander, the MCP23S08. The MCP23S08 is available in 18 pin dip (perfect for solderless bread board environments) works with either 3.3V or 5V supplies. We will focus on the use of this part with Experimenter, but it can also be used with any microcontroller that has a Synchronous Peripheral Interface (SPI). The MCP23S08 device is a general purpose, parallel I/O expansion device that uses the SPI for 8 bit port read, 8 bit port write and port initialization. Its SPI can work at any clock rate up to 10 MHZ. The MCP23S08 SPI is a slave device that needs to get its synchronous clock from the microcontroller. Each MCP23S08 device supports an eight bit port configuration where individual port bits are accessible on the device pins GP7, GP6, GP5, GP4, GP3, GP2, GP1, and GP0. These pins can be configured as either as input or output. In our application the device is configured for eight output pins. All of the outputs are configured to drive their own individual LED through an external current limiting 100 ohm resistor. The microcontroller turns each LED on and off one at a time in sequence .The MCP23S08 device is connected to he Experimenter +3.3V supply and its I/O Expansion bus as follows:
• Expansion Bus PIN 4 Serial Data out Experimenter to MCP23S08 Serial Data In
• Expansion Bus PIN 5 Serial Clocks out Experimenter to MCP23S08 Clocks In
• Expansion Bus PIN 6 Serial Data in Experimenter to MCP23S08 Data Out
• Expansion Bus PIN 2 Digital out Experimenter to MCP23S08 Chip select in 

A Schematic is provided in figure 2 showing the Experimenter to MCP23S08 device hookup. The MCP23S08 can share SPI with other devices as well (like the128x64 Graphics Module). This is not a problem as long as the speed of the SPI does not exceed any the capabilities of any of the connected devices that share the SPI bus, and that a separate Chip select is used by the microcontroller to independently select and communicate with devices on the shared SPI. In fact up to four MCP23S08 (a digital I/O capability of 32 bits total) can share the same SPI (and the same Chip Select) as long as each one uses a unique A0, A1 pin setting. All MCP23S08 outputs are capable of sourcing up to 25ma maximum if needed. Figure 3 shows our prototype port expander and its associated eight Led output. In next increment of this feature we will discuss the software. 


Figure 2 Hook up Diagram

 

  

 

Figure 3 Prototype