Jump to content
  • 0

Analog Disco-2


Electrons4me

Question

Hello Digilent support,

I'm seeing a strange behavior when using the Analog-Disco 2 (AD2) for SPI  MOSI-MISO decoding. My set-up is as such:

  1. Purpose: Monitoring MOSI-MISO from Microcontroller to Slave device to make sure that commands and replies from MCU to slave chip are correct.
  2. Using: AD2 SPI  MOSI MOSI protocol analyzer
  3. DIO 4: Used as an input signal that I toggle in my code (before the third SPI transaction) so the AD2 can trigger on the last transaction (the one I'm investigating)
  4.  Microcontroller SPI: running at 120KHz
  5. MCU I/O: 3.3V (5.0V tolerant)
  6. Slave CHIP I/O: 5.0V (3.3 V level compatible)

Run #1: Graph 1: Please refer to attached graphs. Graph 1 shows a successful capture by the AD2. The MOSI is exactly what I sent and the MISO is also correct:

  • The slave should respond to the very first MOSI command (4 bytes + 1 byte CRC) with 4 bytes = 0x00 and the correspondind correct CRC (=0xB2)- Test passed!
  • The slave then responds to each succeeding MOSI commands with the adequate MISO responses and the correct CRC - Test passed!

Run #2: Graph 2: This graph shows the exact same operation, as the above, repeated once again. The MOSI is exactly what I sent and the MISO responses are now incorrect:

  • Notice how the MOSI commands are the same as the above (Run #1)and are correctly captured by the AD2.
  • Now the AD2 displays the MISO responses as all zeros. I cannot verify the first two MISO responses in my code since the program is running but I can capture in my code the third MISO response (program is halted). Please see the received buffer (rxBuf[0:4]) below Graph 2. You can clearly see that the  Microcontroller code did capture the correct (third) MISO response as 0x00, 0x00, 0x81, 0x01, 0x73. (The CRC 0x73 is also correct, so the Microcontroller definitely read the correct response from the Slave).
    Questions:
  1. Why is the AD2 displaying different MISO data then the Microcontroller rxBuf[0:4] when it is connected to the same MISO line as the Microcontroller MISO input?
  2. In Run #1 = Graph1 all worked perfectly, but in Run #2 = Graph 2 (no changes from Run #1) MISO is displayed wrong. It is as if the first MISO response it just repeated/displayed three times in a row. From the fact that the Microntroller rxBuf[0:4] contains the correct data shows that the AD2 display is not right. Why is that?
  3. What is the line showing in the SPI MISO row? I'm pointing to it on Graph 1 with a blue Arrow?

Thanks
E4M

Almost_There_No_MISO_Decode_V2.pdf

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Hi @Electrons4me

1. These are the signals that the AD2 receives in graph 1 and 2.
2. The MOSI and DIO4 toggle is evidence that the signals are correctly captured, not the same chunk repeated 3 times.
The problem is probably in the microcontroller code sending the incorrect data.

3. The line is the analog representation of the values, like here the values are a sine wave.

image.thumb.png.c0b81cd16e909d2267550ab02588aa32.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...