Hello!
Is it possible to combine the following shields on an Arduino Mega, or will there be hardware conflicts?
If so, is the a workaround?
- 2 x Adafruit Motor Shield v2.3
- 1 x Adafruit Data Logging Shield, latest version
- 1x Adafruit RA8875 Driver Board
Thanks in advance,
Frank
Shield compatibility
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Shield compatibility
All of those boards can be used with the Mega.
- FrankL
- Posts: 6
- Joined: Thu May 12, 2022 2:10 pm
Re: Shield compatibility
...yes I am aware of that.
The question is: Can I use them at the same time (stacked) without any hardware conflict?
I noticed, that I have no more SD card access, as soon as I connect the RA8875.....
The question is: Can I use them at the same time (stacked) without any hardware conflict?
I noticed, that I have no more SD card access, as soon as I connect the RA8875.....
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Shield compatibility
The SD card uses the SPI bus. And the shield is set up to use pin 10 for CS (Chip Select) by default as indicated on the shield:
The RA8875 also uses the SPI bus. Since it is just a breakout board, you can use any otherwise unused pin for CS. A trickier issue is that the MOSI pin does not tri-state when CS is not asserted. So you would need additional circuitry such as an 74HC125 chip to buffer the signal so as not to interfere with other devices (i.e. the SD card) on the bus.
https://learn.adafruit.com/ra8875-touch ... -3019682-5
Here is a general tutorial on making a tri-state buffer from a 74HC125
http://www.learningaboutelectronics.com ... ircuit.php
Here is an example of using that to allow 2 RA8875 displays to share the bus. (You would need just half of that circuit).
viewtopic.php?f=47&t=60533&start=60#p323604
The RA8875 also uses the SPI bus. Since it is just a breakout board, you can use any otherwise unused pin for CS. A trickier issue is that the MOSI pin does not tri-state when CS is not asserted. So you would need additional circuitry such as an 74HC125 chip to buffer the signal so as not to interfere with other devices (i.e. the SD card) on the bus.
https://learn.adafruit.com/ra8875-touch ... -3019682-5
Here is a general tutorial on making a tri-state buffer from a 74HC125
http://www.learningaboutelectronics.com ... ircuit.php
Here is an example of using that to allow 2 RA8875 displays to share the bus. (You would need just half of that circuit).
viewtopic.php?f=47&t=60533&start=60#p323604
- FrankL
- Posts: 6
- Joined: Thu May 12, 2022 2:10 pm
Re: Shield compatibility
Whew - it's gonna take some thinking for me to figure that out, but thanks anyway.
- jaylikeneigh
- Posts: 4
- Joined: Mon Jun 13, 2022 2:42 pm
Re: Shield compatibility
Hi, I am attempting to revive this thread as I have a similar question. I am confused by " the MOSI pin does not tri-state when CS is not asserted." Wouldn't the CS pin be active/asserted when the RA8875 is outputting to a TFT display?
So if both the SD logger and RA8875 were active, wouldn't that resolve the issue without additional circuitry? Or am I thinking about this in the wrong manner.
I apologize if this has been answered elsewhere, but I am still very new to this world of microcontrollers.
So if both the SD logger and RA8875 were active, wouldn't that resolve the issue without additional circuitry? Or am I thinking about this in the wrong manner.
I apologize if this has been answered elsewhere, but I am still very new to this world of microcontrollers.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Shield compatibility
@jaylikeneigh - Sorry, "MOSI" was a typo. It is the MISO pin that does not tri-state: https://learn.adafruit.com/ra8875-touch ... -3019682-5
- jaylikeneigh
- Posts: 4
- Joined: Mon Jun 13, 2022 2:42 pm
Re: Shield compatibility
Ahh that makes sense, but I assume that a work around is not as simple as pulling the CS pin High in stead of low then? Or can I not pull a CS pin high when using an SPI bus?
In short, if I wanted to use these modules in unison I would need to add a 74HC125 into the system, or is there a way that I can have these configured in the script itself?
In short, if I wanted to use these modules in unison I would need to add a 74HC125 into the system, or is there a way that I can have these configured in the script itself?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Shield compatibility
A 'well-behaved' SPI device would disable it's output (i.e. tri-state or high-impedance mode) when not selected via the CS pin, so other devices could freely use that line. Unfortunately, the RA8875 is not well behaved and its output pin remains active regardless of the state of the CS pin. So any other device trying to control the line would be fighting with the RA8875. At best, nothing would work. At worst, one and/or the other would be damaged.
Bottom line: You need something like an 74HC125 chip to buffer the signal. Since CS is an active-LOW signal, you need to have the 74HC125 go tri-state when CS is HIGH.
Bottom line: You need something like an 74HC125 chip to buffer the signal. Since CS is an active-LOW signal, you need to have the 74HC125 go tri-state when CS is HIGH.
- jaylikeneigh
- Posts: 4
- Joined: Mon Jun 13, 2022 2:42 pm
Re: Shield compatibility
Excellent, thank you for that explanation. That makes much more sense.
However, this is not the case with ILI9341 and using the included SD socket as a "write to" instead of a "read from," or is this also requiring a 74HC125 to be used as a data logger?
However, this is not the case with ILI9341 and using the included SD socket as a "write to" instead of a "read from," or is this also requiring a 74HC125 to be used as a data logger?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Shield compatibility
The ILI9341 is a completely different device and is well-behaved on the SPI bus, so no additional buffering is required.
- jaylikeneigh
- Posts: 4
- Joined: Mon Jun 13, 2022 2:42 pm
Re: Shield compatibility
Excellent, thank you for the insight, very appreciated. Cheers.
Please be positive and constructive with your questions and comments.