Re: Interface Buses

"Theodore A. Roth" <[email protected]> Sun, 19 Oct 2003 18:19:28 -0700 (PDT)
Newsgroups gmane.comp.hardware.avr.general
Message-ID <[email protected]>
On Mon, 20 Oct 2003, Erik Christiansen wrote:

> On Sun, Oct 19, 2003 at 11:46:10PM +0100, D I Freeman wrote:
> > I have an AVR chip, and I want to interface a number of sensors to it,
> > using some sort of bus, now the SPI bus springs to mind, but I am not
> > sure if its possible to have n number of devices connected to it, and
> > to read the data from each one?
> 
> We're in the process of designing a board with half a dozen SPI slaves
> hanging off an AVR. Current intent is to use spare port pins as chip
> selects, so that the slaves can be randomly accessed. (It would be a
> pain to have to shift the whole lot while responding to interrupts.)
> 
> Have to admit though, we haven't done the smoke test yet.   :)

I've done exactly this with two at45db161 data flash chips and it works fine
in my tests. Our final product will have 4 of the data flash chips and a
bunch of other devices hanging on the SPI bus. We're using all of port B for
SPI where the pins not used for SCK, MOSI and MISO are used to address the
attached devices, so we can have up to 32 slave devices on the SPI bus while
only using 8 pins of a mega128.

Ted Roth