PDA

View Full Version : Software based SPI For use on Nordic NRF24L01



longpole001
- 28th April 2012, 22:06
Hi Guys , i been doing search for PIC basic code to do a read / write to NRF24L01 Transceiver . but cant find anything

I have found some examples in C but not for picbasic ,so any links that would be useful would help for the basic code for master / slave

The PIC i am using does not have a hardware SPI and need to generate the SPI via software to talk to the NRF24L01. so some sample code would be very helpful on how this is done

Not sure how critical the time pulse width for sck, to the MOSI / MISO for this chip so this SPI will function correctly for the data in/out timing , so some advise on that would be helpful
if any have used it before.

Cheers

Sheldon

Darrel Taylor
- 28th April 2012, 23:31
SPI is implemented with the SHIFTIN/SHIFTOUT commands in PBP.
Since they are software commands, they can be used on any pins. And anything that accepts SPI ... will accept the timing of SHIFTIN/SHIFTOUT.

An example of SPI communications with an EEPROM device can be found here. http://support.melabs.com/content/236-SPIX.pbp

Usage with any of the thousands of other parts that use SPI will vary, but the concept of SPI communications, is the same.
Concetrate on the SHIFTIN/SHIFTOUT commands in that code.

Oh, and don't forget to read the manual.

longpole001
- 29th April 2012, 01:49
Thanks Darrel for that ,

thats just what i need to start to get the SPI going ,

The manual well yes this chip has 40 page manual ,with a lot of registers to understand for a newby at this , but it looks like a fun , this premade pcb transceiver are often very easy to get a hold of for a good price ,

Not sure how empty the airwaves in the 2.4ghz will be and if swapping channels and multi signal pipes which is required in the end is going to be needed, perhaps a lot .

For what i want to do the actual sending and receiving is not a lot of data but its is fairly busy. i suspect a lot of bandwidth will be lost to checking and resend.

For those also reading this I found some basic pro examples on another site https://sites.google.com/site/avcnetsite/mcu have not found much here so far on how to use the Nordic chip in basic pro.

So other examples using this chip in basic pro coding would be welcomed. i am sure i am going to be at this for the next three weeks or so.


Cheers

Sheldon