SPI clock line dipping for slave 2.

Thread Starter

ashokraj

Joined Feb 1, 2018
135
Hi,
On my board I am using SPI slave devices in the following configuration. when every there is an spi communication happening between controller and slave1, everything is good. whereas, during the communication between the controller and slave2 SPI_CLK line is dipping from 2.4 to 2.1. what could be the reason for this? Any in sights? The dip is observed only on SPI _CLK line, MISO, MOSI, CS lines are giving proper 2.4V only.
I am operating SPI at 4MHz, 8MHZ. slave1 is flash, slave2 is accelerometer.
1690885571746.png




this is the clock line, it is dipping from 2.4 to (1.8 to 2.1) at the beginning of SPI communication. it is varying,
 

Attachments

Last edited:
So, when Slave 2 is disabled (CS_slave2 inactive) - CLK is normal, 2.4V? You need to check datasheet for Slave 2 - any special conditions for CLK input? Any series resistors in CLK line? I think you need to provide more information - can be many things
 

Thread Starter

ashokraj

Joined Feb 1, 2018
135
So, when Slave 2 is disabled (CS_slave2 inactive) - CLK is normal, 2.4V? You need to check datasheet for Slave 2 - any special conditions for CLK input? Any series resistors in CLK line? I think you need to provide more information - can be many things
[/QUOT
I have updated with images above. when there is a communication between slave2 and controller, some times the clock line is dipping. some times it is 2.4V, some times it is 1.8V resulting in improper data acquisition. I have kept a series termination resistor of 68 ohms to control signal integrity issues. I am ready to answer any number of questions.
 

nsaspook

Joined Aug 27, 2009
12,318
lave2 is accelerometer
Just a guess.
What's the exact type and model of accelerometer. Some of them have dual communications modes that start in i2c and switch to SPI unless programmed (software or hardware jumpers) to always stay in SPI mode.
 
I have updated with images above. when there is a communication between slave2 and controller, some times the clock line is dipping. some times it is 2.4V, some times it is 1.8V resulting in improper data acquisition. I have kept a series termination resistor of 68 ohms to control signal integrity issues. I am ready to answer any number of questions.
Thanks for uploading the waveforms, this helps. It is possible that the scope just shows you a distorted picture. It may be related to a thing called undersampling. This happens when you are looking at very fast signal on a very long time scale. To verify this try to capture the pulses in question on the faster time resolution. Or if your scope has big memory buffer, just capture single shot and zoom into your pulses that appear to have lower level (if your scope has small memory, the pulses will appear really distorted, so better capture on faster time scale). You will see that the amplitude is fine, its just pulses are so short, they are not covered by samples on the screen. You have different frequencies - it could be just that: higher frequency appears distorted.
You can read more about this effect here: https://www.edn.com/digital-oscilloscopes-when-things-go-wrong/
 

Thread Starter

ashokraj

Joined Feb 1, 2018
135
Thanks for uploading the waveforms, this helps. It is possible that the scope just shows you a distorted picture. It may be related to a thing called undersampling. This happens when you are looking at very fast signal on a very long time scale. To verify this try to capture the pulses in question on the faster time resolution. Or if your scope has big memory buffer, just capture single shot and zoom into your pulses that appear to have lower level (if your scope has small memory, the pulses will appear really distorted, so better capture on faster time scale). You will see that the amplitude is fine, its just pulses are so short, they are not covered by samples on the screen. You have different frequencies - it could be just that: higher frequency appears distorted.
You can read more about this effect here: https://www.edn.com/digital-oscilloscopes-when-things-go-wrong/
thanks Fatiuk, I am aware of this undersampling theory. yeah after I keep the timeperiod in scope as 1us or even less than that, the distorted waveform will not be seen, here what I want to show is some times the clock pulses are at 1.8V and some times at 2.4V. I could not understand what could be the reason for this. can you please support me in what could have resulted in clock pulses fluctuating?
 
Could you share the waveform with faster time scale, so we can see the form of pulses and the deviation you mentioned? On the waveforms you provided it appears not clear, plus time scale is not shown. Seeing the shape may give people more information and more clues
 
Top