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

Low Power Comparator

Hello,

I'm working with nrf51822 on a custom board and i'd like to use the LPCOMP as wakeup source. I configured the module by the code listed above:

void lpcomp_init(void) { NRF_LPCOMP->PSEL = 0x00000000; NRF_LPCOMP->REFSEL = 0x00000006; NRF_LPCOMP->ANADETECT = 0x00000000;

NRF_LPCOMP->ENABLE = 1;
NRF_LPCOMP->TASKS_START = 1;

while (NRF_LPCOMP->EVENTS_READY == 0) {

}

}

I don't know if the configuration is correct but the function stuck into the while cycle. Am i doing something wrong? Could be an hardware issue related to the silicon revision of my chip?

Thanks in advance and best regards

Parents
  • Your code snippet looks reasonable. The LPCOMP is only available on second revision chips, so if you try to use this on a first revision chip, I assume you'll see something similar to what you see, since the register isn't actually there.

    You can take a look at the PCN for an overview over the changes, and you may also have use in reading the migration whitepaper.

Reply
  • Your code snippet looks reasonable. The LPCOMP is only available on second revision chips, so if you try to use this on a first revision chip, I assume you'll see something similar to what you see, since the register isn't actually there.

    You can take a look at the PCN for an overview over the changes, and you may also have use in reading the migration whitepaper.

Children