How do I use nRF24L01 with TFT Touch screen on Teensy 3.6

Status
Not open for further replies.

Jack1688

Member
How do I use a nRF24L01 on a Teensy 3.6 with the TFT and Touchscreen? I have a code which will work with the TFT Touchscreen and a separate code that operates with a RF24 and communicates with another board. But I can not figure out how to integrate them. I have looked at:

Forum
49786-Multiple-SPI-Devices-Two-s-Good-Three-s-a-Crowd?
Michael Messiner's comment - I imagine that you really should convert ALL of the SPI drivers you are using to using SPI transactions: https://www.pjrc.com/teensy/td_libs_SPI.html. That didn't seem like it got me there.

I also saw this thread
https://forum.pjrc.com/threads/4808...tor-nRF24L01-Multiple-SPI?highlight=card+rf24

and Paul said
If you *really* want to use SPI2, you'll probably have a lot of work to do editing the library.

From there I tried to run both the TFT Touchscreen and the RF24 on the main SPI bus.
The TFT and Touch screen wired per TFT Touchscreen direction.
The RF24 had parallel MISO, MOSI, SCK ,

How do I get a Teensy 3.6 to work with a TFT Touch screen and an nRF24L01. I have codes which will work with the TFT Touchscreen and a separate code that operates with a RF24 and communicates with another board. But I can not figure out how to integrate them. I have looked at:

Forum
49786-Multiple-SPI-Devices-Two-s-Good-Three-s-a-Crowd?
Michael Messiner's comment - I imagine that you really should convert ALL of the SPI drivers you are using to using SPI transactions: https://www.pjrc.com/teensy/td_libs_SPI.html. That didn't seem like it got me there.

I also saw this thread
https://forum.pjrc.com/threads/4808...tor-nRF24L01-Multiple-SPI?highlight=card+rf24

and Paul said
If you *really* want to use SPI2, you'll probably have a lot of work to do editing the library.

From there I tried to run both the TFT Touchscreen and the RF24 on the main SPI bus.
The TFT and Touch screen are wired per TFT Touchscreen directions.
The RF24 had parallel MISO, MOSI, SCK ,and CS (pin10)
The RF24 has interrrupt on 4 and CE on 6, RF24 radio(6,10);

In the attached program for the RF24 the program sends RF data to a second RF unit and the second unit receives data correctly. The second RF24 (using Arduino Mircro ) has a keypad that sends keystrokes back and this works. When I connect the TFT and Touch screen as described above data is still uploaded to the second RF24, but the keystroke data is incorrect. If I pull the TFT and Touchscreen feed to MOSI (pin 12) I again get correct data from the second RF24 keypad.
 

Attachments

  • Teensy_RF24_5.ino
    4.8 KB · Views: 73
Update on my last submittal. I have integrated the TFT-Touchscreen code and the RF24 code and will provide that below. The TFT-Touchscreen and the RF24 are connected to Teensy 3.6 as follows:
ILI9341Pin - Teensy 3.x
VCC - VIN
GND - GND
CS - 10
RESET +3.3V
D/C - 9
SDI(MOSI) - 11
SCK - 13
LED - VIN W/100 OHM RESISTOR
SDO(MISO) - 12
T_CLK - 13(SCK)
T_CS - 8
T_DO - 12
T_IRQ - 2

RF24 Wiring
RF24 - TEENSY 3.X
VCC - VIN
GND - GND
CE - 6
CS - 25
SCK- 13
MOSI - 11
MISO - 12
IRQ - 4

Results
The TFT and Touchscreen work properly. The RF data upload works correctly. However the remote RF keypad data is not received correctly. It should receive a 1 for key 1 etc but instead key 1 is received as a 9, some keys come in as ; and other incorrect results. Now if I pull the TFT-Touchscreen MISO pins out of Teensy pin 12 the keypad data downloads correctly.
The conflict appears to be on the MISO pin (Master IN – Slave OUT). Any Thoughts or suggestions or a working sample code that has a RF24 data incoming.

Thanks in advance for your help.
Regards,
Jack Edwards
 

Attachments

  • Teensy_Touchscreen_RF24.ino
    15.9 KB · Views: 81
I don't think I have tried the RF24s... I am playing around some with the RF95 with the touch screen... I have not played much yet with the touch...

On my Well monitoring board, WIP, I have the RF95 using SPI1. It was easy to make this work with Radiohead, as I added another file with the SPI1 stuff in it... I believe I made a SPI2 setup as well... Then you can define that I am using SPI1 like:

Code:
#include <RHDatagram.h>
#include <RH_RF95.h>
#include <RHHardwareSPI1.h>
...
RH_RF95 rf95(RFM95_CS, RFM95_INT, hardware_spi1);

But again I am using Radiohead library...
 
Status
Not open for further replies.
Back
Top