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

SENSE Value Mismatch?

Over the past few months I have worked extensively on a few different projects that all utilize the nRF51422. In some recent debugging of GPIO issues (both relating to SENSE mechanism and GPIOTE module) I have discovered an inconsistency between the "nRF51 Series Reference Manual" (v1.1) and the reference code provided in the Nordic SDK.

Referencing the manual, chapter 13 (GPIO), section 13.2.8, description of the PIN_CNF[n] fields, field "E" (SENSE):

"RW SENSE Pin sensing mechanism DISABLED 0 Disabled HIGH 1 Sense for high level LOW 2 Sense for low level"

However, notice the provided reference code differs: #define GPIO_PIN_CNF_SENSE_High (0x02UL) /*!< Wakeup on high level. / #define GPIO_PIN_CNF_SENSE_Low (0x03UL) /!< Wakeup on low level. */

Other projects that I've worked on utilize the SENSE mechanism using the reference code values shown above - those work as expected so I'm guessing this is just a typo in the reference manual?

It almost seems as if the upper bit is a SENSE enable/disable bit, while the lower bit determines if high or low level SENSing is desired.

I appreciate any clarification on this. Thanks!

  • Unfortunately, this is a know typo in the reference manual, that will be fixed in the next release. You're quite correct that the value in nrf51_bitfields is correct, and also on the bit meanings, although you shouldn't rely on that.

  • Thanks for the quick response Ole! This is the 3rd time you have answered a question for me and I have neglected to "Accept as Answer" all 3 times - not because it wasn't helpful, but because I did not see any option in my browser to "accept as answer".

    Perhaps this is because I posted as a guest? I have created an account as it seems I'll be frequenting this website for the foreseeable future :)

    One last thing, can you clarify what you mean that I "shouldn't rely on that"? Just that I should not rely on the bit meanings until they are officially corrected/published in the reference manual?

  • Accepting an answer is only available to the original poster, but the question was posted anonymously, there is no way for you to do this. I can however do it for you. :-)

    What I meant with my "shouldn't rely on that" comment was that when you read the reference manual, you should only rely on things that are explicitly spelled out. Even though you can work out the meaning of the bits behind the values, this could in principle change with a future revision, and if it does, we won't necessarily document that change very clearly, since the exact meaning wasn't spelled out in the first place. However, for the same version of the chip, this shouldn't really be a problem.

Related