This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Device Address match

I have two questions.

  1. Is it possible to use the DAP[n]/DAB[n] registers without using Bluetooth 4.0?

  2. If it is possible, then how? I searched all the sample code, and couldn't find anything. Furthermore, I read the reference manual for the nRF51822 and there was only one paragraph (16.1.13) on the topic.

I just want to use a host to listen for 5 devices using the radio. No s110 or s120 bluetooth stack. I don't want to use Gazell or Ant. I want my own stack. The reason is that since s110, s120, Ant and Gazell do not allow me to see the source code (since it is already precompiled) I can't learn anything. I don't believe in blindly trusting someone's code. I'm sure their code is good, but I would like to tailor the code to my application, and thus optimize it.

  • Yes, it's perfectly possible to implement a completely custom radio protocol on the nRF51, using the radio hardware directly. Developing a good radio protocol is however pretty complex, and not necessarily something I'd recommend unless you have specific requirements that are not covered by existing solutions. There are lots of issues to deal with; interference, packet loss, duplicate packets, addressing and so on.

    However, to get started, I'd recommend you to thoroughly read through the radio chapter of the Reference Manual, make sure you fully understand the task and event system of the nRF51 and how you can use a combination of timers, PPI and the radio to achieve mode switches, retransmissions and such. We don't have a lot of example code for this, but there is a very simple example in the SDK called radio_example. In addition, you may have use in taking a look at this project on GitHub.

  • Thanks for the speedy reply.

    I did read the entire section of the reference manual pertaining to the Radio. Several times. This is why I'm asking if there is anybody who has actually used the DAP[n]/DAB[n] registers. I also understand that writing my own protocol is challenging, but anything worth doing is always tough. I just want to be able to use a host that listens and receives packets from several devices, and I don't want to use the proprietary protocols since they always limit my flexibility.

    Thank you for the link to the GitHub project. It helps to see what others are doing.

  • As is explained in section 16.1.13, these registers are made for doing address whitelisting, as is used in the Bluetooth specification. Unless your on-air frames use the same format as BLE, they won't really be very useful for your own protocol.

    The reason they're useful in BLE is that all packets going on the advertising channels use the same access address (HW address as seen by nRF51), but the device that sends the packet's address is part of what is considered a payload by the nRF51 radio. Hence, normally the firmware would have to read out the packet payload, and then do a manual compare with the address of the device it wants to receive for instance a connection request from. However, using this feature instead, the HW will do the matching for it, and it can just use the result.

    As section 16.1.13 says, you should refer to the Bluetooth specification to understand how this works. See for instance Volume 6, Part B, section 2.1 and 2.3.

Related