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.
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
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...?