Code for receiving data from Nordic key FOB - SparkFun

#1
I have a Nordic RF transceiver module and a key FOB from SparkFun that I wanted to get working with a PICAXE 20M2.

I had some Basic Stamp code that I worked on a few months ago, so I just had to convert it.

I am attaching the code in case anyone might be interested.

Here is program output showing register values and detected button/count info
Code:
Initialized
Register 0 = 00111011
Register 1 = 00000000
Register 2 = 00000011
Register 3 = 00000011
Register 4 = 00000000
Register 5 = 00000010
Register 6 = 00000110
rxAddr P0: 231 231 231 231 231 
txAddr: 231 231 231 231 231 
 442 Top
 443 Bottom
 445 Left
 446 Right
 447 Center

The key FOB description
This is a nicely packaged key FOB that contains a Nordic nRF24L01+ radio and a ATtiny24 for control. Press any one of 5 buttons and the ATtiny24 will wake up, transmit the buttons being pressed, a 16-bit integer value of the total button presses since last battery replacement, and then return to low-power sleep.

Nordic.jpg
 

Attachments

Last edited:
#2
I created another demo program which emulates the Sparkfun 5 button Key FOB.

It continously transmits the button codes and 16 bit sequential counter (as the FOB does).

I am attaching the transmit and receive (tweaked) programs...
 

Attachments

#3
There is a bug in Transmit.bas.
"CE" should be LOW during transceiver configuration and data reading/writing.
"CE" should be HIGH when transceiver should actually send data via RF.

So this block:
LOW CE
PAUSE 1
HIGH CE
should be:
HIGH CE
PAUSE 1
LOW CE

Thank you for the samples, RonCzap!
 
Top