]> sigrok.org Git - sigrok-dumps.git/blame - spi/nrf24l01/README
Add SPI flash example exports from various vendor software.
[sigrok-dumps.git] / spi / nrf24l01 / README
CommitLineData
aeada8ac
JS
1-------------------------------------------------------------------------------
2nRF24L01/nRF24L01+
3-------------------------------------------------------------------------------
4
5This directory contains a capture of the communication between two nRF24L01+
3052f4bb 6transceivers, one connected to a Raspberry Pi and the other connected to an
aeada8ac
JS
7AVR microcontroller, and some generated files to test paths in the protocol
8decoder that aren't covered in the capture.
9
10
11nrf24l01-communication.sr
12-------------------------
13
14Logic analyzer setup
15--------------------
16
17The logic analyzer used was a Lcsoft Mini Board (at 12MHz):
18
19 Probe Description
20 ---------------------------
21 PB0 (TRG) used to trigger the logic analyzer
22 PB1 (rpi_CSN) chip select signal of the receiving chip, active low
23 PB2 (rpi_CLK) clock signal of the receiving chip
24 PB3 (rpi_MOSI) MOSI signal of the receiving chip
25 PB4 (rpi_MISO) MISO signal of the receiving chip
3052f4bb 26 PB5 (rpi_IRQ) interrupt signal for the receiving chip, active low
aeada8ac
JS
27 PD0 (uc_CSN) chip select signal of the sending chip, active low
28 PD1 (uc_CLK) clock signal of the sending chip
29 PD2 (uc_MOSI) MOSI signal of the sending chip
30 PD3 (uc_MISO) MISO signal of the sending chip
31
32 Note that the nRF24L01(+) chips have two chip select pins, "CE" used to
33 control the standby mode, and "CSN" used for SPI communication. This capture
34 only contains the "CSN" signals of the two chips.
35
36Data
37----
38
39The sigrok command line used was:
40
41 sigrok-cli --driver fx2lafw --config samplerate=12M \
42 -p '0=TRG,1=rpi_CSN,2=rpi_CLK,3=rpi_MOSI,4=rpi_MISO,5=rpi_IRQ,8=uc_CSN,9=uc_CLK,10=uc_MOSI,11=uc_MISO' \
43 -t TRG=0 --time 140 -o nrf24l01-communication.sr
44
45The capture starts with the Raspberry Pi initializing its chip as a receiver,
46followed by the microcontroller initializing the second chip as a transmitter
47at about 8.8ms - 9ms. 30ms after the start of the capture, the microcontroller
3052f4bb 48starts sending the strings "message #0" to "message #9" in intervals of about
aeada8ac
JS
4910ms. After sending a message, it uses polling to detect when the message is
50sent and the acknowledge from the receiver is received. The Raspberry Pi handles
51the first six messages after the receiving chip asserts the interrupt signal.
3052f4bb 52Because it doesn't handle the other four messages and the receive FIFO in the
aeada8ac
JS
53receiver runs full after three messages, the last message isn't acknowledged.
54The sender detects that and reads the lost packet counter from the sender chip,
55which consequently has a value of one.
56
57
58nrf24l01-communication-[rx|tx].sr
3052f4bb 59---------------------------------
aeada8ac
JS
60
61These files were generated from the file 'nrf24l01-communication.sr' using
62the commands
63
64 sigrok-cli -i nrf24l01-communication.sr -O csv | \
65 awk -F , '{if (NR > 3) {print $2","$3","$4","$5}}' | \
66 sigrok-cli -i /dev/fd/0 -I csv:samplerate=12M -o nrf24l01-communication-rx.sr
67
68and
69
70 sigrok-cli -i nrf24l01-communication.sr -O csv | \
71 awk -F , '{if (NR > 3) {print $7","$8","$9","$10}}' | \
72 sigrok-cli -i /dev/fd/0 -I csv:samplerate=12M -o nrf24l01-communication-tx.sr
73
74respectively, because apparently the pdtest/runtc tools don't support capture
75files with extra channels. The files are then used to check if the protocol
76decoder correctly decodes the message payload.
77
78
79nrf24l01-test-...
3052f4bb 80-----------------
aeada8ac
JS
81
82These files were generated by the 'gen-testfiles.py' script and contain test
83cases for the decoder that aren't yet covered by the other captures.
84
85 ...-activate.sr: Tests decoding of the 'ACTIVATE' instruction. This
86 instruction is only valid for the nRF24L01 chips
87 (without the plus) and is therefore not in the
88 communication dump.
89
90 ...-excess-bytes.sr: Used to check if the protocol decoder correctly
91 recognizes and reports superfluous bytes after the
92 commands.
93
94 ...-misc.sr: Contains checks for the instructions 'REUSE_TX_PL',
95 'R_RX_PL_WID', and 'W_ACK_PAYLOAD', that aren't
96 covered by the other dumps.
97
98 ...-missing-bytes.sr: Used to check if the protocol decoder correctly
99 recognizes and reports missing bytes after the
100 commands.
101
102 ...-no-command.sr: Used to check if the protocol decoder correctly
103 handles empty commands.
104
105 ...-unknown-command.sr: Used to check if the protocol decoder correctly
106 recognizes commands that do not exist.
107
108 ...-unknown-register.sr: Contains a 'R_REGISTER' (read register) instruction
109 of a non-existing register.