​ ​ ​ ​ Code for receiving data from Nordic key FOB - SparkFun
Results 1 to 3 of 3

Thread: Code for receiving data from Nordic key FOB - SparkFun

  1. #1
    Member
    Join Date
    Sep 2011
    Location
    Louisville KY USA
    Posts
    52

    Default Code for receiving data from Nordic key FOB - SparkFun

    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
    Attached Files Attached Files
    Last edited by RonCzap; 30-10-2011 at 02:51.

  2. #2
    Member
    Join Date
    Sep 2011
    Location
    Louisville KY USA
    Posts
    52

    Default

    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...
    Attached Files Attached Files

  3. #3
    New Member
    Join Date
    Feb 2014
    Location
    Českß republika
    Posts
    1

    Default

    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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •