CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

TC77 Shared DataIN & DataOUT on SPI

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

TC77 Shared DataIN & DataOUT on SPI
PostPosted: Wed Dec 06, 2006 7:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Dec 06, 2006 8:40 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Dec 06, 2006 9:06 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Dec 06, 2006 11:31 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group