Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SPI with multiple device

Status
Not open for further replies.

rikie_rizza

Full Member level 6
Joined
Aug 5, 2006
Messages
331
Helped
29
Reputation
58
Reaction score
8
Trophy points
1,298
Location
Bikini Bottom, between a rock and a pineapple
Activity points
3,173
Hi all,

I have this tiny doubt about a project that I've been designing on. It uses three SPI device and each device uses different SPI mode (different CPOL and CPHA, speed, and first data bit). What should I do when I want to access the device? I'm using C to program the uc, and i use ATMEGA8535.

Thanks for the answer.
 

Simple.
1.) One of the three devices must be a MASTER
2.) The other two must be SLAVEs
3.) Each of the two SLAVEs must have separate CHIP select lines.
4.) The SLAVEs share clock lines and data lines.

To access one of teh devices simply select the CHIP select line you want to access.

If you want all devices to access any of the other devices, use I2C

Hope this help abit
 

That's not what i mean. I got this MEGA8535, his the master SPI, and I got 3 other devices (ADC, RTC, and Digipot) uses SPI channel but with a different mode. The ADC uses mode 0 (CPOL=CPHA=0), and the RTC uses mode 3 (SPOL=CPHA=1), and the Digipot uses mode 1. Must I initialize the SPI register of the MEGA8535 each time I need to access the device or...?
 

put an inverter or write seperate routine fo each device
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top