Jump to content

edwardjs

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by edwardjs

  1. Hello, I am using WaveForms to log SPI data from a USB host to SPI master IC (VNC2 from FTDI). I am testing out a card reader but the only card I have that works with the card reader is a gift card that contains around 100 bytes of data. So, the IC is going to send the 100 bytes that it receives from the card reader out over the SPI bus in a single transfer. Is there a way to capture this large of a single transfer with the SPI analyzer? I switched to the fourth configuration in the device manager but I can still only set the bits up to 32. How do I increase the buffer size after choosing the fourth configuration?
  2. Using the logic analyzer, I saw that my chip select pin randomly goes high sometimes when it should be low. It spikes a couple times during the data transfer. If no spike occurs, then the data is transferred successfully. If it spikes, data is corrupted. I'm now trying to figure out how to eliminate the spikes. Thank you for the quick reply
  3. I am using the SPI protocol analyzer on WaveForms (using the Analog Discovery 2) and I'm getting weird results. I keep getting results that look like this: ********************* Leftover bits: 2 0, Leftover bits: 3 32, Leftover bits: 2 0, Leftover bits: 4 96, Leftover bits: 5 248, ********************* I am using an Arduino Uno to send the SPI data. The sketch is as follows: ******************************** #include <SPI.h> unsigned long lastInterrupt = 0; unsigned long thisInterrupt; uint8_t Command = 173; uint16_t Data = 52128; void setup() { SPI.begin(); pinMode(8, OUTPUT); pinMode(2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(2), Interr, FALLING); SPI.beginTransaction(SPISettings(100000, MSBFIRST, SPI_MODE1)); } void Interr() { thisInterrupt = millis(); if ((thisInterrupt - lastInterrupt) > 500) { digitalWrite(8, LOW); SPI.transfer(Command); SPI.transfer16(Data); digitalWrite(8, HIGH); } lastInterrupt = thisInterrupt; } void loop() {} ******************************** I saw in another forum post that this "leftover bits" issue is caused when the active low cycle doesn't match up with the data transfer. However, I am confused why I am only getting leftover bits and no command or data bits. As well, the number of leftover bits does not add up to command bits + data bits, so where are the other bits going? I have attached a picture of my WaveForms settings. Could anyone help me with this issue? Or give me more insight on this issue? Is my CS pin going back to HIGH too early or too late? Please let me know if you need more information about the issue.
×
×
  • Create New...