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

LPCOMP Configuration of nrf52832

Hi all,

I am trying to configure the LPCOMP module of the nrf52832 using registers directly, that is, without using the already generic functions that come with the sde.

I am also using the debugger module of Keil, in order to look at the registers and check if things are as expected.

It turns out that there are a few things, which even after having done some research, I am not able to understand.

1. The first thing that I noticed is that the INTENSET and the INTENCLR registers get assigned the same value, even though I explicitly set only the INTENSET register. After noticing that, I tried to also set the INTENCLR register in the code, however they still get the same value. Maybe this is what it is supposed to be, however looking at the datasheet and from the name itself, I think that INTENSET and INTENCLR should be "opposite" to each other; whatever bit is 1 at INTENSET needs to be 0 at INTENCLR, as I understand it. Can someone please give me some insight here?

2.  When I set the TASKS_START to 1, the EVENTS_READY is generated, even though I have not set its respective bit at the INTENSET to 1. I want and I have actually set only the CROSS event bit at the INTENSET. On top of that, the TASKS_START is immediately set to 0, which I can some logically understand, but just wanted to make sure that this is a normal behavior. So, does the EVENTS_READY have to generated, although not configured? And does the TASKS_START have to be set to 0, once the LPCOMP has started?

3. The main issue is that the EVENTS_CROSS is not generated, even though I am sure that the input voltage has crossed the "internal reference x 1/16", which I have configured. The thing is that I do not have any clue right now why this happening.

4. I would like to use interrupts in my project and to do so I am using the NVIC_EnableIRQ(LPCOMP_IRQn) command. I do not know how this NVIC works and would appreciate an explanation for someone. I looked at the datasheet, but somehow did not find a it.

Thank you in advance for the replies.

Bests,

Gazi

Parents Reply Children
No Data
Related