REDUCING PIN USAGE IN MICROCONTROLLER

Dear all .

AS we know Arduino Deumilanove board has 13 digital io and 5 analog ios .Total we have 18 pins.suppose I have 24 pins how can i reduce it to 18 pins.

Example: current configuration for my project

ds1307 is using 2 pins i.e A5 and A4 GPS receiver takes 2 pins DI0 and DI1 motor driver takes 4 pins DI(2,3,4,5) PWM controll takes 2 pins DI(10,11) heart beat signal takes 1 pin DI(13) feed back sensor takes 2 pin DI(6,7) motor speed selector 4 pins:8,9,10,12(http://in.element14.com/multicomp/mcrm4af-16r/rotary-dip-switch-smd/dp/1522038) mode change over selection:A3,A2 Sensor Slection: A1,A0

RTC reset require 1 pin gps logger require 1 pin debugger pin require 1 pin etc option.

IS there way to reduce pin selection without affecting above pin configuration

1)i thought of doing with resistor first in series with switch, But i found value read by port are not stable enough for selector switch wen subjected to high temperature. 2) i don't have any I2c based device expect RTC. else i could acccess using I2c protocol If any one has idea share it with links.

You could use an I2C expansion module to the drive your loads.

AMPS-N: AS we know Arduino Deumilanove board has 13 digital io and 5 analog ios .Total we have 18 pins.suppose I have 24 pins how can i reduce it to 18 pins.

14 digital (0 to 13) and 6 analog (A0 to A5).

Some of the output names sound fairly static - you could combine those to be outputs of a shift register instead.

Or use a processor with 10 more IO pins.

http://www.crossroadsfencing.com/BobuinoRev17/ $6 for a bare board mailed to US locations

Hi,

There are a bunch of ICs you can use to add IO capability to your microcontroller, some examples are:

| 74HC4051 | 8 channel analog multiplexer/demultiplexer which acts like a printer switch, you tell it which output or input you want to read or write to and put that value on a single analog pin and it switches that IO to that one single pin for you. | | - | - | | 74HC595, TPIC6B595 | shift registers where you can set a great number (they cascade to add blocks of 8 ) of digital outputs | | 74HC165 | a shift register that can be used to input multiple digital inputs | | MCP23017, MCP23008 | 16 and 8 bit I/O expanders with which give you additional IO pins using the I2C interface. Up to 8 of these can be added by presetting their addresses on the I2C bus. |

Or, as Bob posted above graduate to a microcontroller with more pins. Or there's could be the option of using a 2nd microcontroller for taking care of some of your tasks and querying that when you need specific data.

Without seeing your circuit it might also be possible to reduce your input pin-count if you're using multiple switches, by using an R-2R ladder and combining your switches down to just one analog input.

So many options in fact :) Cheers ! Geoff

Edit: to fix a typo. And another, thanks Bob !

TPIC6B595 Open drain power shift (out) register.

CrossRoads: TPIC6B595 Open drain power shift (out) register.

Yes sorry, I typed that wrong didn't I - thanks for picking it up. Will fix.

AMPS-N: AS we know Arduino Deumilanove board has 13 digital io and 5 analog ios .Total we have 18 pins.suppose I have 24 pins how can i reduce it to 18 pins.

Example: current configuration for my project

ds1307 is using 2 pins i.e A5 and A4 GPS receiver takes 2 pins DI0 and DI1 motor driver takes 4 pins DI(2,3,4,5) PWM controll takes 2 pins DI(10,11) heart beat signal takes 1 pin DI(13) feed back sensor takes 2 pin DI(6,7) motor speed selector 4 pins:8,9,10,12(http://in.element14.com/multicomp/mcrm4af-16r/rotary-dip-switch-smd/dp/1522038) mode change over selection:A3,A2 Sensor Slection: A1,A0

RTC reset require 1 pin gps logger require 1 pin debugger pin require 1 pin etc option.

You need to tell us more about the devices it is connected to. You've only told us about the motor speed selector. What motor driver are you using, and what is "PWM control" ? What is "feedback sensor", "mode change over selection", "sensor selection" and "etc option" ? You may be able to multiplex some of these pins.