Magimedia
Posts: 33
Joined: Sun Feb 22, 2015 8:31 pm

Can I use an NRF24L01+ and a TouchScreen with Pi Zero?

Thu Sep 15, 2016 7:48 pm

I've never used the NRF24L01+ module before, and I want to use it to communicate with some PIC controlled lighting. I also want to use the Pi with a touchscreen. Both need the MOSI/MISO pins - does that essentially mean it's on or the other, but not both?

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Can I use an NRF24L01+ and a TouchScreen with Pi Zero?

Thu Sep 15, 2016 8:09 pm

Multiple SPI devices can be connected, you just need to connect each to a separate Chip Select line.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Magimedia
Posts: 33
Joined: Sun Feb 22, 2015 8:31 pm

Re: Can I use an NRF24L01+ and a TouchScreen with Pi Zero?

Thu Sep 15, 2016 8:20 pm

Thanks.

So I connect the MOSI/MISO/SCLK in parallel, and since my touchscreen is using CE1 on the GPIO header, and can't be changed, I need to simply recompile a library for the NRF24L01+ that uses CE0?

(I say simply, it looks daunting, but I'm determined!)

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Can I use an NRF24L01+ and a TouchScreen with Pi Zero?

Fri Sep 16, 2016 11:35 am

It might be that simple. Depending on the NRF24L01 library you might just be able to tell it to look at a different device on the same port.

For example python-spidev the syntax is

Code: Select all

spi.open(bus, device)
Which will open the spidevice /dev/spidev<bus>.<device>
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Return to “Interfacing (DSI, CSI, I2C, etc.)”