I have an applicaiton that uses an SPI master 18F4685 and 5 SPI slaves 18F2523.
I have the master and 1 slave working. I add the other pcb to the spi bus, this board has the 4 other pics that are on the spi bus. Now when I restart the first slave no longer responds correctly.
I suspected that i had multiple pics selected on the spi bus . I have a simple 138 decoder to select the active slave pic.
The decoder seems to be working. I run the master code in debug and the slave select decoder is working correctly on slave 1-5.
I connected my scope to the sclk line and I can see the clock pulses but I notice that my project will not communicate while the scope is connected. Also I have no buffering between the mater pic and the 5 slaves. Should I?
Why does the scope kill my comm? The signal looks very clean on the scope, no rounded edges. Crystal is 16.384Mhz and spi is set to clk/64.
Tomorrow I will debug both master and slave at the same time to hopefully get a better idea what is going on.
Any suggestions?
Chris
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Wed Apr 15, 2009 7:47 pm
Buffering between master and slaves is normally not required. What is the wire length between master and slaves?
The scope can be loading the SCK line too much. Make sure to use an x10 probe.
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Mon Apr 20, 2009 2:04 am
And as extra info: Master and Slave must have the same SPI mode setting.
What I don't understand is that how changing the SPI mode did solve your problem. As long as you had the Master and all Slaves configured for the same mode then your change can not have solved the underlying problem.
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