05-22-2023 10:40 AM
Hi LabVIEW Community,
I am facing some problems with interfacing NI myRIO with Linear Technologies evaluation board DC2259A which contains LTC6811-1 chipset USE to monitor battery cell voltage for BMS System
When writing to the LTC6811, it uses SPI Mode 3. However, the LTC6811-1 is not communicating properly with myRIO.
For example, if I send in the command 0x0001 (command code write configuration), with the PEC calculated of the command code of 0x0001 to be 3D6E, and the configuration to be
0xF8 00 00 00 00 00 with it calculated PEC, the response I getting back is 0x FF FF FF FF FF FF, which does not tally. I am supposed to receive back 0xD8 00 00 00 00 00 with its calculated PEC.
Did I do something wrong with the configuration of my VI? Also, do I still need the connection of the 5K resistor to the myRIO VCC MISO input too? I thought the myRIO has internal pull-up resistors for it.
This is based on Figure 15 Pg 44 of the datasheet of the LTC6811-1.
I have attached my VI in the post, together with the datasheet of the LTC6811-1 and the schematic of the evaluation board which uses the LTC 6811-1 Chip.
SPI Connection Pages in the Datasheet (Pg44,45,55-66)
Operation of the LTC6811-1 (Pg 20-36)
I have linked the hardware connections from the board J2 connections to the myRIO.
VCC to 5V input of the myRIO
SCK to Clock Input of myRIO DIO 5 MXP A Connector
MISO to MISO Input of myRIO DIO 6 MXP A Connector
MOSI to MOSI Input of myRIO DIO 7 MXP A Connector
CS to DIO0 of myRIO DIO0 MXPA Connector (I have set it to False in the VI)
Can any kind soul advise me on this matter, please? Thank you!
Regards,
cyongjed
05-22-2023 11:24 AM
I might be able to help, as I'm using myRIO to control 16 boards all with multiple SPI chips (fortunately, I only need to get rapid communication from the SPI A/D chip on each of the 16 boards, and can "make do" with a sampling rate around 20 kHz). Needless to say, we are "rolling our own" SPI signals, but that's pretty much also what the SPI routines you are using are trying to do.
Unfortunately, you did not attach the entire LabVIEW Real-Time Project, particularly, the Project File (and the supporting VIs that you might have developed). Please do the following:
Bob Schor
05-23-2023 08:20 AM
Hi Bob,
I have reuploaded the zip file. Could check if you are able to view it (I have used the myRIO project template to create a new project from the LabVIEW startup page, I didn't create it from the real-time module project wizard)
Also, the sampling rate, I don't really get for this, how do I set it? For my current case, I still set the myRIO with 1Mhz frequency for the clock phase = trailing, clock polarity=high.
I attached images from the datasheet for your reference too.
Hope to hear from you soon!
Regards,
Cyong
05-23-2023 10:50 PM
Hello, Cyong.
I'm able to open your Project, and your VI. However, I'm attending NI's annual Trade Show (now called NI Connect), and won't have access to a myRIO until I return home tomorrow and go back to work. I'll also print out the datasheet you sent (my poor eyes can't read such fine print) and will try to answer your questions. I should mention that I am not an Engineer (look at my Avatar and guess what I do), so I may need to consult some of my colleagues about some of the SPI details (though I've programmed the SPI protocol in the myRIO's FPGA, so I can look at my own code and maybe "figure it out" for myself) ...
Bob Schor
05-28-2023 01:05 AM
Hi Bob,
I have solved the issue. There were quite a number of problems in my design of the QSM. I didn't set back the CS lines back to high once a data read is attempted and the clock frequency is too high, hence the read was invalid.
I have since adjusted my clock frequency to 30kHz, and set the CS lines back accordingly. Thanks for the help!