Go Down

Topic: Arduino UNO using two different SPIs at once (Read 229 times) previous topic - next topic

penderam

I am using a Arduino UNO to communicate with an Xsens IMU through a USB shield using the USB host Library 2.0. This library uses the SPI pins to connect to the shield and get information from my IMU using the  FTDI drivers inside the library.

I wish to connect my UNO to a FPGA, I will need a level converter among other things, but my problem lies in the interface.

I would like to use SPI but it is being used with the shield. Yes I understand SPI can have multiple slaves, all I would need is another slave select. This being said all the SPI interfacing being done between the shield and the UNO is through these drivers. I would have to start trying to recode them to allow me to connect and get info and then slave select to the FPGA.

On the data sheet its says I can use the ICP headers as well. Are these another SPI port I can use separately from my SPI with the shield? It would be a pain to get wires attached with the shield on top, but it could be done.

Please give me some advice when you can! Thanks!


pylon

Quote
On the data sheet its says I can use the ICP headers as well. Are these another SPI port I can use separately from my SPI with the shield? It would be a pain to get wires attached with the shield on top, but it could be done.
No, the ICSP header connects to the same pins on the processor. But you can use the ICSP header to get all SPI signals except the CS signal as the ICSP header doesn't provide standard GPIO pins.

Quote
I wish to connect my UNO to a FPGA, I will need a level converter among other things
Standard level converter won't work as the MISO pin needs to go tri-state if CS goes HIGH. Take care for that.

Quote
Yes I understand SPI can have multiple slaves, all I would need is another slave select. This being said all the SPI interfacing being done between the shield and the UNO is through these drivers. I would have to start trying to recode them to allow me to connect and get info and then slave select to the FPGA.
What exactly is the problem? Most drivers (in the Arduino world the are mainly called libraries) allow to specify the CS pin as it's quite usual that you must be able to choose it.

penderam

Thanks!

That is the info I needed. I have to use slave select instead of having separate interfaces, that is what I wanted to know. The slave select causes a small delay after some testing, making my other interface option a better choice

freaklabs

I've connected the SPI bus on my Freakduinos to multiple devices, some of which are at different voltages. On the board itself, there is a voltage converter to interface to the 3.3V wireless radio. So far, there has been no problem interfacing the SPI with the radio at 3.3V and other devices at 5V, even though there is a voltage converter there. I think you should be fine with your setup and just allocating an additional chip select.
FreakLabs
Wireless Technology for the environment, wildlife, and agriculture
https://freaklabs.org
https://hackerfarm.jp
Twitter: @freaklabs

pylon

Quote
I've connected the SPI bus on my Freakduinos to multiple devices, some of which are at different voltages. On the board itself, there is a voltage converter to interface to the 3.3V wireless radio. So far, there has been no problem interfacing the SPI with the radio at 3.3V and other devices at 5V, even though there is a voltage converter there. I think you should be fine with your setup and just allocating an additional chip select.
I get the impression that the only reason for your posts is advertisement for your company. You had several posts with unrelated or even wrong information in it.

Please don't confuse the people looking for help here with undifferentiated information as above (where you missed the information that an SPI level converter should depend on the CS state).

freaklabs

Interesting. I believe I've proved you wrong already. Please let me know which posts and also how I am advertising for my company. There are many unidirectional level converters and also converters that automatically sense data direction.
FreakLabs
Wireless Technology for the environment, wildlife, and agriculture
https://freaklabs.org
https://hackerfarm.jp
Twitter: @freaklabs

pylon

Quote
Please let me know which posts and also how I am advertising for my company.
In the footer of every post and in the profile part. In this post you even had a link to your commercial product in the post itself without providing any additional relevant information to the problem OP had.

Quote
There are many unidirectional level converters and also converters that automatically sense data direction.
I don't disagree but it's not relevant here. For an SPI bus you should have a level converter that put MISO tri-state if CS is HIGH.

freaklabs

#7
Mar 23, 2019, 02:04 am Last Edit: Mar 23, 2019, 02:07 am by freaklabs
Quote
In the footer of every post and in the profile part. In this post you even had a link to your commercial product in the post itself without providing any additional relevant information to the problem OP had.
Actually those links are to my home page which I both provide instruction to wildlife researchers and environmental conservationsists and provide devices for people interested in environmental and wildlife conservation and monitoring. The hackerfarm link is to my non-profit communal farm where we work on agriculture and technology for indie and organic farmers. In fact, Bunnie Huang, an open source hardware advocate and one of the early pioneers of open source hardware, is currently doing a residency at hackerfarm a few doors down from me.

Also, I believe I do provide something of value to the post, like this knowledge bomb I'm about to drop...

Quote
I don't disagree but it's not relevant here. For an SPI bus you should have a level converter that put MISO tri-state if CS is HIGH.
I've used the FXMA108 in many projects including as an SPI interface on Arduino based boards to translate between 5V and 3.3V. It has auto-direction sense and does not require a chip select. Perhaps it's important to research a bit more before you correct people.
FreakLabs
Wireless Technology for the environment, wildlife, and agriculture
https://freaklabs.org
https://hackerfarm.jp
Twitter: @freaklabs

pylon

Quote
I've used the FXMA108 in many projects including as an SPI interface on Arduino based boards to translate between 5V and 3.3V. It has auto-direction sense and does not require a chip select.
Then it's a bad choice for an SPI level converter. But fortunately the chip is not such a bad choice as it offers an OE input which (connected to the CS signal of the connected chip) tri-states the relevant MISO signal.

Go Up