05-20-2015 06:38 AM
Task: I am trying to implement a custom SPI interface (Labview-USB) – FTDI – SPI.
One of the key issue is that it is a custom SPI, it has CS line and Clock as a normal SPI but MOSI have some address bit frame, then data frame, then parity bit, after all that we add some bits about 5 to allow some read back.
The MISO will have the data of the device ACK. Therefore, se sequence is write the whole block and then keep sending the last 5 bits to allow ACK data and check the ACK and if it is OK I can send the next package.
I will never need to read from the device a part from that ACK.
The Hardware: At the moment I am trying the code on development board just like this one "here"
Where I am:
FTDI has suggested to use MPSSE and gave methis application note even it’s for an I2C they said can be easily transport it to SPI.
I have tested this code using the Labview library D2XX_Fumctions_7.0 and when I try to see if I am in MPSSE mode (section 2.2.3) it fail. it said there is not bytes waiting at the buffer.
Also wanted to give it a goal tolibMPSSE-SPI if I could get it working on that .dll but there status return 2 which I guess it mean no_ device _found.
Could you please help? I am interested if you have implemented similar interface in Labview and using D2XX_Fumctions_7.0 library. Also what is the best way to implement the interface point above? Thanks
05-20-2015 07:44 AM - edited 05-20-2015 08:00 AM
Is this for academics? Or is this for an actual design? If you really are just looking for a cheap USB SPI device that can be used in LabVIEW I'd recommend looking at using the LIFA or LINX on an Arduino, or a Teensy. With the Teensy option the hardware is $12 US Dollars, has a built in real USB connected to the micro, has many SPI, I2C, AIO, DIO and a bunch of other stuff. And using the LINX firmware the software is already written. After installing LINX you'll also have on the palette all the functions to do I2C and SPI. No need to worry about parity or ACK messages, just send the data you want, and get the data back.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-20-2015 11:24 AM
@Hooovahh wrote:
After installing LINX you'll also have on the palette all the functions to do I2C and SPI. No need to worry about parity or ACK messages, just send the data you want, and get the data back.
I don't think it's that simple here, @cualquiera noted that it's a custom (ie somewhat nonstandard) SPI implementation. Parity and ACK messages are not part of the SPI standard, so those would still need to be implemented in software too even with LINX. All SPI does is provide a very simple way to send and receive bits; any higher-level logic about the meaning of those bits is left to the user.
05-20-2015 11:35 AM
@nathand wrote:
I don't think it's that simple here
Sorry, very right I was just skimming posts and missed that detail.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord