Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
all: nrfprog
CFLAGS=-ggdb -Wall
DEBUG := $(if $(DEBUG),-DDEBUG_PRINT)

nrfprog: nrfprog.c bp.h nrf24le1.h
gcc ${CFLAGS} -o nrfprog nrfprog.c
gcc ${CFLAGS} -o nrfprog nrfprog.c $(DEBUG)

clean:
rm -f nrfprog
9 changes: 0 additions & 9 deletions README

This file was deleted.

41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# BusPirate NRF24LE1/NRF24LU1+ programmer
This is a simple programmer for the nRF24LE1 (or nRF24LU1p) using the Bus Pirate as the SPI
device.

## building
```
make clean
make
```

### debugging
for debug build, use:
```
make clean
DEBUG=1 make
```

## usage
`nrfprog BUSPIRATE_PORT [filename]`

Running the program directly (./nrfprog) will dump the InfoPage. Put this some
where safe, as this contains information unique to your nRF24LE1. Running the
program, but passing a existing .hex file as a parameter will make the programmer write
the .hex file to the device. If you pass in filename of non-existing file, nrfprog will attempt to read from chip into the file.

## hardware

| bus pirate | nrf 24 pin | nrf 32 pin | nrf 48 pin |
|--------------|------------|------------|------------|
| GND (brown) | GND | GND | GND |
| 3V3 (red) | PROG | PROG | PROG |
| AUX (blue) | RESET | RESET | RESET |
| CS (white) | P0.5 | P1.1 | P2.0 |
| MISO (black) | P0.4 | P1.0 | P1.6 |
| MOSI (grey) | P0.3 | P0.7 | P1.5 |
| CLK (purple) | P0.2 | P0.5 | P1.2 |

## references
* bus pirate binary modes: http://dangerousprototypes.com/docs/SPI_%28binary%29
* nrf24le1 datasheet: https://www.nordicsemi.com/kor/nordic/content_download/2443/29442/file/nRF24LE1_Product_Specification_rev1_6.pdf

1 change: 1 addition & 0 deletions bp.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#define BP_SPI_CFG_CKE 0x02
#define BP_SPI_CFG_SMP 0x01
#define BP_SPI_WR_RD 0x04
#define BP_SPI_WR_RD_NO_CS 0x05

#define BP_I2C 0x02
#define BP_UART 0x03
Expand Down
6 changes: 3 additions & 3 deletions nrf24le1.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define __NRF24LE1_H_


#define NRF24_BLOCK_SZ (512)
#define NRF24_FLASH_SZ (32*NRF24_BLOCK_SZ)
#define NRF24_INFO_SZ (256)
#define NRF24_PAGE_SZ (512)
#define NRF24_FLASH_SZ (32*NRF24_PAGE_SZ)
#define NRF24_INFO_SZ (512)

#define NRF24_SPI_WRSR (0x01)
#define NRF24_SPI_PROGRAM (0x02)
Expand Down
Loading