View previous topic :: View next topic |
Author |
Message |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
TC77 Shared DataIN & DataOUT on SPI |
Posted: Wed Dec 06, 2006 7:45 am |
|
|
Hello All,
Just wanted a quick sanity check on my understanding...
The TC77 temperature sensor from Microchip uses a shared wire for both data in and data out. I'm assuming there are no problems with other hardware on the bus as long as they are not chip selected?
Thanks,
John |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Dec 06, 2006 8:40 am |
|
|
You are right, as long as you use only one "One Wire device" sharing a
SPI bus, but if you are going to use multiple TC77, - or another "one wire"- you
would use a software SPI and toggle the TRIS register accordingly (SDI or SDO)
to ovoid bus collision.
Humberto |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Wed Dec 06, 2006 9:06 am |
|
|
Humberto,
Thanks.
My configuration will be:
TC77 (SPI shared DI & DO)
MCP41xxx (SPI pot w/ individual DI & DO)
25LC256 (SPI EEPROM w/ individual DI & DO)
I'm guessing I'll have to setup the SPI comms for each device in code prior to communicating, because, as you have said I'll have to change from 'out' to 'in' for the TC77. But, other than that, there are no problems mixing devices on the same bus? (The chip select keeps the untargeted device from reacting to any data or activity on the bus?
John |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Dec 06, 2006 11:31 am |
|
|
I assume that the PIC is managing the SPI communication, so you have full control
of all the times involved in the comunication handler, hence there would not be any
conflict sharing the SPI bus with a "one wire" device.
Quote: |
(The chip select keeps the untargeted device from reacting to any data or activity on the bus?
|
The chip select in H state keep the untargeted device with its I/O in high Z.
To initiate the comunication cycle with the TC77, the first action is to configure the
PIC Pin as receiver, then pull down the TC77 chip select and then clocking the SCK line
13 times while fetching the SDO line to get the temperature data stored in
the internal register.
Humberto |
|
|
|