nRF24L01 with Teensy 3.5

Status
Not open for further replies.

MogaRaghu

Well-known member
Just a quick check ... I am planning to use the Rf24 module with Teensy3.5 and following are the pin assignments :

09 : CE of RF24L01
10 : CSN of RF24L01
11 : MOSI of RF24L01
12 : MISO of RF24L01
13 : SCK of RF24L01

I am sure about all of them except Pin9 which is marjed as CS0. In fact there are way too many CS0's on the module ( 9,10,15, 20 21 )

I gather that if some functions are dimmed out then they must specifically invoked in code. But all above CS0 are in bold....

Can you please clarify on above ?
 
I am not sure what your question is?

Are you asking why there are multiple pins marked as CS0 in the hardware card for the Teensy 3.5?
All of the above pins are Chip select pins for the SPI buss 0. The teensy 3.5 has 3 SPI busses, so the ones marked CS1 are for buss #1...

As for Buss 0: there are actually more pins that can be hardware chip select pins(10, 2, 9, 6, 20, 23, 21, 22, 15)
They are not all listed on the card as there are some restrictions on which pins you can use with other chip select pins... That is internally for Hardware Chip select, these IO
pins all map to specific bits that get set in the PUSHR register (sort of like channels), to be controlled by the hardware... And for example: both pins 10 and 2 map to channel 0, so you can only use one of these two pins (For hardware Chip select)...

However with the majority of libraries, they simply use the SPI library and do not make use of the hardware chip select capabilities. As such with most libraries you can use any digital pin as a chip select pin.
 
The function of chip select is to tell the chip to wake up and read/write data on the bus. So there are multiple chip select pins to allow you to use multiple SPI devices sharing clock, MOSI and MISO.

So the library should allow you to define which CS you want to use, even if it doesn't define flexibility on other pins. Pin 10 is generally the Arduino default but that's largely in terms of how tutorials will tell you to wire it than anything else. And as KurtE notes, most libraries don't use the hardware CS properly anyway so you can often point the library at any digital pin and it will work, slightly more slowly than a dedicated version would.
 
Are you asking why there are multiple pins marked as CS0 in the hardware card for the Teensy 3.5?
All of the above pins are Chip select pins for the SPI buss 0. The teensy 3.5 has 3 SPI busses, so the ones marked CS1 are for buss #1...

Thanks ... that's what I want to know. SO my configuration for the Rf24 will work. Good.

Just curious - to which CS is the on board SD card interface tied up with ? But I think I don't have to worry about this as I see none of the pins connected to the SD card are broken out.

And one last query ... since the port pins are 5V tolerant , if I interface a I2C convertor for a LCD , I don't need any level translation ? The LCD will be running at 5V .
 
If you set board type T3.5 and look in the SD card examples you will see how to configure for the t3.5 built in SD card (line SDCardchipSelect = BUILTIN_SDCARD;) which tells it to use to onboard SD card hardware rather than SPI mode.

Edit: re 5V LCD the Teensy pins will tolerate 5V signals, this doesn't guarantee the LCD will reliably read 3.3V as logic high. So it's safe but may not work without some tweaking (dropping LCD VCC or similar).
 
If you set board type T3.5 and look in the SD card examples you will see how to configure for the t3.5 built in SD card (line SDCardchipSelect = BUILTIN_SDCARD;) which tells it to use to onboard SD card hardware rather than SPI mode.

Edit: re 5V LCD the Teensy pins will tolerate 5V signals, this doesn't guarantee the LCD will reliably read 3.3V as logic high. So it's safe but may not work without some tweaking (dropping LCD VCC or similar).

That was a good point on the LCD. Thanks !!
 
Just curious - to which CS is the on board SD card interface tied up with ?

None! It doesn't use any SPI pins either. :)

SD cards have 2 access modes. Their native mode is called SDIO. It uses a 4 bit bus with 2 control signals. During the data transfers, it's 4X faster at the same clock rate, and it also supports faster clock speed. SD cards also support SPI mode, using just 4 signals. The 2 outer pins on the card are unused in SPI mode.

The built-in SD card socket on Teensy 3.5 & 3.6 uses the native 4 bit SDIO mode. It's connected by 6 dedicated signals which aren't shared by any of the other pins. So none of the SPI signals are used, leaving them all fully available for your other SPI chips.

More detail on the schematic page...

https://www.pjrc.com/teensy/schematic.html
 
Thanks Paul. The exact point I wanted to know. With all this confirmations I today tried out the RF24 module with Teensy3.5 and it worked first shot !! I now am planning to move a big project from Mega2560 to the Teensy.3.5

It uses the following peripherals :

SD Card module via SPI
RTC 1332 module via I2C
BLE Module HM10 via HW Serial
4L x 20C LCD via I2C
RF24 Module via SPI
8 LEDs
8 PushButtons.

When I use the Teensy3.5 the SD Card / RTC modules are eliminated.

I have already finalized the IO summary for the Teensy 3.5 setup. Just wanted to know if its OK as I am very new to Teensy3.5 and going only by the schematic for it :

TEENSY3.5 Pin Assignments : Modified to suit from the original Mega version.
USB : Serial RXD for Programming
USB : Serial TXD for Programmin
2 : Gear Flow Meter Input( Interrupt)
01 : HM10 RX Pin ( Serial 1)
00 : HM10 TX Pin ( Serial 1)
18 : SDA of I2C [ RTC + LCD ]
19 : SCL of I2C [ RTC + LCD ]
02 : START Push Button
03 : INC Push Button
04 : SHIFT Push Button
05 : ENT Push Button
06 : RFID Push Button
07 : GET Push Button
08 : SEND Push Button
14 : CLK Push Button

24 : PWR LED Output
25 : Low Batt LED Output
26 : BT ON Relay Output
27 : RF OK LED output
28 : RF FLT LED Output
29 : Grease OK Output
30 : Fault LED Output

09 : CE of RF24L01
10 : CSN of RF24L01
11 : MOSI of RF24L01
12 : MISO of RF24L01
13 : SCK of RF24L01
 
i am trying to connect nrf24l01 with teensy3.5. can you post the code?
thank you.

Have you tried looking at the different libraries that are setup to work with these? Things like Radiohead? There are example programs included
 
Status
Not open for further replies.
Back
Top