This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

COMP to GPIOTE at ~250KHz, Value Sync or GPIOTE Failure

Hi,

Just after an eyes over. I'm using the internal COMP to save on an external chip and wiring the output out to a GPIOTE. What occurs is the NRF_COMP->EVENTS_DOWN fires, which clears the channel/pin, however the NRF_COMP->EVENTS_UP does not appear to be firing, or GPIOTE is ignoring.

I'm using minimal hysteresis (61 and 62 out of 63) and the signal may be quite fast, 250KHz. I wonder if there's a frequency limit to the GPIO or PPI (apparently COMP can handle it).

Cheers,

Andrew


  NRF_COMP->PSEL = CFG_AIN_POWERMANAGER_UVLO << COMP_PSEL_PSEL_Pos;
  NRF_COMP->MODE = COMP_MODE_SP_High << COMP_MODE_SP_Pos;
  NRF_COMP->REFSEL = COMP_REFSEL_REFSEL_Int2V4 << COMP_REFSEL_REFSEL_Pos;
  NRF_COMP->TH = UVLO_THUP << COMP_TH_THUP_Pos | UVLO_THDOWN << COMP_TH_THDOWN_Pos;
  NRF_COMP->SHORTS = COMP_SHORTS_READY_SAMPLE_Enabled << COMP_SHORTS_READY_SAMPLE_Pos;

  NRF_PPI->CH[CFG_PPI_POWERMANAGER_CHANNEL_UVLO_ABOVE].EEP = (uint32_t) &NRF_COMP->EVENTS_UP;
  NRF_PPI->CH[CFG_PPI_POWERMANAGER_CHANNEL_UVLO_ABOVE].TEP = (uint32_t) &NRF_GPIOTE->TASKS_SET[CFG_GPIOTE_POWERMANAGER_CHANNEL_UVLO];
  NRF_PPI->FORK[CFG_PPI_POWERMANAGER_CHANNEL_UVLO_ABOVE].TEP = (uint32_t) &NRF_COMP->TASKS_SAMPLE;
  NRF_PPI->CHENSET = 1 << CFG_PPI_POWERMANAGER_CHANNEL_UVLO_ABOVE;

  NRF_PPI->CH[CFG_PPI_POWERMANAGER_CHANNEL_UVLO_BELOW].EEP = (uint32_t) &NRF_COMP->EVENTS_DOWN;
  NRF_PPI->CH[CFG_PPI_POWERMANAGER_CHANNEL_UVLO_BELOW].TEP = (uint32_t) &NRF_GPIOTE->TASKS_CLR[CFG_GPIOTE_POWERMANAGER_CHANNEL_UVLO];
  NRF_PPI->FORK[CFG_PPI_POWERMANAGER_CHANNEL_UVLO_BELOW].TEP = (uint32_t) &NRF_COMP->TASKS_SAMPLE;
  NRF_PPI->CHENSET = 1 << CFG_PPI_POWERMANAGER_CHANNEL_UVLO_BELOW;

  NRF_GPIOTE->CONFIG[CFG_GPIOTE_POWERMANAGER_CHANNEL_UVLO] = GPIOTE_CONFIG_OUTINIT_High << GPIOTE_CONFIG_OUTINIT_Pos | GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos | CFG_PIN_POWERMANAGER_UVLO_OUT << GPIOTE_CONFIG_PSEL_Pos;

Parents Reply Children
No Data
Related