Hardware Developers Community - NI sbRIO & SOM

cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating Digilent pmods with sbRIO-9651

Hi,

Has anyone tried (and succeeded) to use any of the Digilent pmod modules with the sbRIO-9651 carrier board and SOM? If so, do you have a reference design you can share?

Hugh

0 Kudos
Message 1 of 11
(9,052 Views)

Hey Hpollittsmith,

Here is a thread where we've discussed porteing the LV FPGA library for SPI and i2c.

http://forums.ni.com/t5/Industrial-Communications/LabVIEW-FPGA-SPI-with-NI-9651-dev-board/m-p/307645...

I had tested this out before the 9651's release and got about 2-3 pmods working with SPI. The directions from the 8th post should get you started. I found it the easiest to copy and paste the pinouts and timing diagrams from the data sheets for each PMOD into my VI as I modified it.

Which PMOD are you specifically looking at? I happen to have their analog fundamentals kit at my desk so if I have the same IC to see if I can spot any hiccups but its been a few months since working on it.

I didn't get a chance to port over the i2c library so that will require a little more work.

Kyle Hartley
Senior Embedded Software Engineer

Message 2 of 11
(7,618 Views)

Hey Hugh,

We have been working on an API for SPI that should make things a lot simpler for users like yourself. It is currently in a Beta period, but we are looking to release the API sometime in the near future, and getting feedback from users is one of our primary goals currently.

I'll private message you a link to the latest build of the API. It has an example included for SOM as well, so that should help you get up and running quicker. Just be aware that the API isn't released publily yet.

Regards,

Ryan

Ryan P.
CLA
0 Kudos
Message 3 of 11
(7,618 Views)

Thanks for the info! It's all very helpful. My aim right now is just to get a feel for the sbRIO-9651 board and design flow. I think the ADC pmod would be the one I'll eventually be using, but getting anything working to start with is good.

0 Kudos
Message 4 of 11
(7,618 Views)

Hi Ryan,

Thanks again for the API for SPI for the sbRIO-9651. I'm trying to adapt the design example for another PMOD I have (Digilent GYRO module), which uses a few more pins (2 interrupt pins on PMOD pin 7 and 8). Looking at the example, for the Chip Select DIO Lines type definition, I see I can specify SCLK, MISO, MOSI and CS0, but then there are 5 additional chip select lines, which don't appear to be used (at least in the example, they are connected to  PMOD2 Pin2 which is not in use)--is there any reason why I can't use CS1 and CS2 to my interrupts? Is there a reason why the other CS lines (CS1-5) are included and enabled?

Hugh

0 Kudos
Message 5 of 11
(7,618 Views)

Hey Hugh,

There are multiple CS lines available in case you want to speak to multiple chips connected to the SOM. The idea of multiple CS lines is that you would have multiple chips all connected to the same MOSI and MISO lines, but with their own CS lines. Then you can control which chip you speak to depending on which CS line you pull low when the message transmits.

If you look at a screenshot of the code below, there are red boxes around the parts of the code where CS is used. In the left box, you first choose which hardware resource (DIO line) will be used for each CS. Then in the Command Queuing Loop, we specify which Chip the current command is meant for using the "Chip Select" control that is present there. Later when the Engine transmits the message on the MOSI line, it will pull low the hardware line corresponding to the CS resource that you selected with this control when the command was queued.

CS.png

Because it works this way, you likely won't be able to use one of the other CS lines as an interrupt line. How do the interrupts for this chip work? Most SPI chips just have CS, MOSI, and MISO, so I'm not immediately sure how you would integrate interrupts in this case.

Regards,

Ryan

Ryan P.
CLA
0 Kudos
Message 6 of 11
(7,618 Views)

Hi Hugh,

Typically you can get away with reading data from the sensors/chips without using interrupt lines. I have seen interrupt lines used when communicate with microprocessors to give it breathing time. For FPGA, you can have dedicated loop to get data and give it to other loops.

In other words, you can probably get data from device without interrupts. You can control the rate at which you are reading data from Gyro by changing loop rate of the Command Queuing Loop.

Kalyan

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 7 of 11
(7,618 Views)

Hi. I am also trying to do something similar. Can you please send me a link to the API?

0 Kudos
Message 8 of 11
(7,618 Views)

Hello I am also trying to do something similar with PMODs on sbRIO-9651. Could you please send me the link to this API?

0 Kudos
Message 9 of 11
(7,618 Views)

Hey Guys!

I am also trying to implement SPI on the sbRIO-9651. Can you send me a link to your API?

BR

0 Kudos
Message 10 of 11
(7,618 Views)