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!

Parents
  • 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.

  • 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.

Reply
  • 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.

Children
No Data
Related