Uncategorized
8:44 AM

Good. My first thought was to start with single SPI bus, to make it more newbie friendly. On second thought I would start with multiple SPI buses. Now I have soldered a dual nRF24 module board, and open/short tests are OK. Next step is to try to ping the modules.

user image
1 hour later…
9:59 AM

Now I am tidying up my old SPI signal routing lego board to test the two nRF24 modules.

user image
10:27 AM

Now I looking at the nRF24 library more closely, version 0.5 of nRF24 learning notes: penzu.com/public/09bf5314. There are a couple of reasons: I hope to: (1) Modify the big library to make a smaller and simplified version, for easy troubleshooting, (2) Modify some basic functions to make them more newbie friendly.

(3) Modify some special functions such as SPI, send/receive functions to make them more flexible for future applications. Now I need to first read the datasheet to understand how to read the nRF24 registers, how to config, initialize etc.
1 hour later…
11:28 AM

Now I am reading the nRF24 Library’s SPI setup method and found a big problem: SPI1 is NOT supported, module B is also NOT supported. I forgot what is the difference of SPI between Model A and Model B, but I will definitely be using Rpi4B (and perhaps also Rpi3B+ later. I remember the library is using a spidev compiled in its setup procedure. Since the library is NO longer supported by the author.

So I feel uncomfortable to use this old SPI method for Rpi Model A only, with the old complied spidev. My decision is to use Rpi4B buster (2019sep26 release)’s preinstalled SpiDev, which has many more (six, to be precise) SPI channels (or buses, I forgot which term I should use :))

user image
11:44 AM

Rpi4B’s six SPI channels is too messy, and too easy to go wrong. So I think I better be humble and use only two of the six, ie, SPI0, SPI1. And with three CS pins, I can control 5 nRF24 modules. I will also be using python’s “list” and “dictionary” data structure. So it should be “easy” to later to scale up to all six SPI channels.

user image
3 hours later…
2:23 PM

Now I am trying to build a minimal nrf24 library which consists of the very basic functions: (1) SPI setup, (2) nrf24 module configuration, (3) nrf24 register read write functions. With the above three basic functions, I can then config, and perform the nrf24 functions.

I am now do the top down design of the using the big library as a blueprint. The startup sections are in the top part of the following file: penzu.com/p/772fa292. Next step is reading the datasheet a couple of times and modify the template functions for nrf24.

First thing first is to read the block diagram of the nrf24 module.

user image

Then a brief description.

user image

Then a state diagram.

user image

The state diagram show TX mode and Rx mode. So I think I need to get a rough picture of what is TX and Rx modes.

user image

Then we need to check out the register map to see which registers to config, which to give commands etc. I think I should start with the config register, never mind other not so important registers.

user image

Then we need to read the command set to know how to load a message, how to send, how to receive etc etc.

user image

It is indeed very messy. Bed time. So I will call it a day. See you tomorrow.

« first day (12 days earlier)  

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.