Hello!
I am currently working on a project involving an automotive application in which data will be collected via CAN bus. My design is based off the Arduino 2009 (duemilanove) with a couple shields stacked on top.
Once data is collected over the CAN Bus interface, it will be either transmitted over Bluetooth to another Bluetooth-enabled device (a laptop in this case) or displayed on a Nokia 5110 LCD display. This design will also have logging capabilities that will store data onto a micro SD card.
One question I have concerns pin contention and possible confusion among those devices that share the same pins. For example - I know my Micro SD card will utilize the MISO and MOSI pins of my ATMega328p, but my CAN Bus MCP2515 device also uses these same pins.
What is the general guideline on pin sharing? Is it microcontroller-specific or a universal guideline that should be applied here?
I have attached my schematic to this post. Please note that the LCD has not been incoporated, yet. I need to make a footprint and schematic drawing for it, first.
Thank you for your assistance!
Schematic:
http://i.imgur.com/35lNSdB.png
jacob80:
I know my Micro SD card will utilize the MISO and MOSI pins of my ATMega328p, but my CAN Bus MCP2515 device also uses these same pins.
What is the general guideline on pin sharing? Is it microcontroller-specific or a universal guideline that should be applied here?
I'm not sure what your question is. The MOSI and MISO pins, when used for the SPI "bus", are intended to be shared by multiple devices. Same for the clock pin. There's a separate slave select (SS) pin for each of the devices that "ride the bus" and only one device can be selected (by it's SS pin) to use the bus at any one time. It's up to your code to maintain proper timesharing of the "bus".
http://en.wikipedia.org/wiki/Serial_Per … erface_Bus
A somewhat similar condition exists for other pins when used for the I2C bus.
Still other pins (though not on any MCU that I can recall) are a special open collector (OC) or open drain (OD) type and are intended to be connected to others of the same type. It’s used to “OR” the outputs into 1 composite signal.
http://en.wikipedia.org/wiki/Open_collector
Are there other conditions where pins can be shared ? Sure but there needs to be a way of insuring that the correct device receives it’s intended signal and/or that 2 outputs aren’t connected to each other and try to be in differing HIGH/LOW states.