1
Discussion - MCU / Re: SPI comm between PIC32 chip on UBW32 board and FT810 chip on VM81050A-D board
« on: April 01, 2021, 05:03:09 PM »
Hello BRT Community Member,
Thanks for responding.
Yes, though I did not include it in my first post, I am indeed turning ON the SPI module at the end of "SPI config:" code snippet.
I am using the UBW32 board with PIC32MX795F512L MCU on it:
http://www.schmalzhaus.com/UBW32/
https://www.sparkfun.com/datasheets/DevTools/PIC/UBW32_MX795_v262.pdf/
Some observations:
1) During the first post, I let PIC32 MCU SPI master drive the CS line in sync with the SPI clock pulses (low when the clock is active and high when the clock is idle so CS was asserted/disasserted multiple times during a single multi-byte read/write operation). Now, I am manually asserting CS so the CS line is held down for the whole multi-byte read/write operation during an SPI TX/RX operation. Now, I can see data coming out of the MISO pin and it is always 0x00 0x4A 0x43 0x42 0xEF 0xBE 0xAD 0xDE 0xEF (the last byte is decoded as 0x77 sometimes but I think it is a shortcoming of the scope?). I have attached a screenshot of the corresponding picoscope capture.
2) I pull down PD and pull it back high during initialization. I do not do a Power Down of the SPI module after that until it is power cycled. So, I am expecting the PD line to stay high but it toggles multiple times when CS is low. Any ideas on why this is happening?
3) According to FT810 documentation/example code:
"while (EVE_MemRead8(0X302000) != 0x7C)"
But the code decodes the last byte as "0xDF" on the MISO line. Picoscope decodes it as "0xEF". The SPI read/write is supposed to be MSB first and I selected that option on the picoscope as well. I can't figure out why the SPI data is decoded differently by the code/picoscope and both versions are different from what is mentioned in the FT810 prohg guide.
I double-checked all my connections, soldered parts, etc and they are intact (checked impedances and the SPI related pins are isolated from each other. Both PIC32 and FT810 boards have decoupling capacitors. I haven't added any bypass capacitors as the signals are clean and I don't feel like they are required). Any suggestions about this decision are welcome.
I have read the PIC32 and FT810 chip/VM810C50A-D b0oard datasheet and programmer's guide more than once now and I haven't yet figured out why PD line is doing that or why picoscope and the FT810 example code decode the data differently (both of them don't match 0x7C like the FT810 programmer's guide mentions).
I attached the scope capture that you requested for your reference. I wish the website allowed for a bigger attachment size, I had to compress the image, etc before I could add an attachment and I was able to add only 1 attachment.
Any ideas/suggestions will be very useful (I have been working on this for a while) .
Thanks again,
Madhu
Thanks for responding.
Yes, though I did not include it in my first post, I am indeed turning ON the SPI module at the end of "SPI config:" code snippet.
I am using the UBW32 board with PIC32MX795F512L MCU on it:
http://www.schmalzhaus.com/UBW32/
https://www.sparkfun.com/datasheets/DevTools/PIC/UBW32_MX795_v262.pdf/
Some observations:
1) During the first post, I let PIC32 MCU SPI master drive the CS line in sync with the SPI clock pulses (low when the clock is active and high when the clock is idle so CS was asserted/disasserted multiple times during a single multi-byte read/write operation). Now, I am manually asserting CS so the CS line is held down for the whole multi-byte read/write operation during an SPI TX/RX operation. Now, I can see data coming out of the MISO pin and it is always 0x00 0x4A 0x43 0x42 0xEF 0xBE 0xAD 0xDE 0xEF (the last byte is decoded as 0x77 sometimes but I think it is a shortcoming of the scope?). I have attached a screenshot of the corresponding picoscope capture.
2) I pull down PD and pull it back high during initialization. I do not do a Power Down of the SPI module after that until it is power cycled. So, I am expecting the PD line to stay high but it toggles multiple times when CS is low. Any ideas on why this is happening?
3) According to FT810 documentation/example code:
"while (EVE_MemRead8(0X302000) != 0x7C)"
But the code decodes the last byte as "0xDF" on the MISO line. Picoscope decodes it as "0xEF". The SPI read/write is supposed to be MSB first and I selected that option on the picoscope as well. I can't figure out why the SPI data is decoded differently by the code/picoscope and both versions are different from what is mentioned in the FT810 prohg guide.
I double-checked all my connections, soldered parts, etc and they are intact (checked impedances and the SPI related pins are isolated from each other. Both PIC32 and FT810 boards have decoupling capacitors. I haven't added any bypass capacitors as the signals are clean and I don't feel like they are required). Any suggestions about this decision are welcome.
I have read the PIC32 and FT810 chip/VM810C50A-D b0oard datasheet and programmer's guide more than once now and I haven't yet figured out why PD line is doing that or why picoscope and the FT810 example code decode the data differently (both of them don't match 0x7C like the FT810 programmer's guide mentions).
I attached the scope capture that you requested for your reference. I wish the website allowed for a bigger attachment size, I had to compress the image, etc before I could add an attachment and I was able to add only 1 attachment.
Any ideas/suggestions will be very useful (I have been working on this for a while) .
Thanks again,
Madhu