Post Go back to editing

AD5940_Amperometric example hangs when it's shutdown and restarts

On my custom board, I am seeing a system hang (interrupt does not trigger any more) when another AMP measurement is attempted following the first successful amp measurement. I modified the AD5940_Amperometric example code and was able to reproduce the same issue on my EVAL-AD5941ELCZ. I built it with KEIL uVision 5.


void AD5940_Main(void)
  uint32_t temp;
  uint32_t count;

  count = 0;

  AD5940AMPStructInit(); /* Configure your parameters in this function */
  AppAMPInit(AppBuff, APPBUFF_SIZE);    /* Initialize AMP application. Provide a buffer, which is used to store sequencer commands */
  AppAMPCtrl(AMPCTRL_START, 0);         /* Control AMP measurement to start. Second parameter has no meaning with this command. */

    /* Check if interrupt flag which will be set when interrupt occurred. */
      AD5940_ClrMCUIntFlag(); /* Clear this flag */
      temp = APPBUFF_SIZE;
      AppAMPISR(AppBuff, &temp); /* Deal with it and provide a buffer to store data we got */
      AMPShowResult((float*)AppBuff, temp); /* Show the results to UART */
    if (count == 10) {
      goto restart;

Any idea how to debug this?

Parents Reply
  • Thanks for your response Akila. What's the best way to enter into the Sleep state and run another measurement upon a user input (i.e. button press)? In my code snippet above, I do jump (see "goto restart" line) to the beginning of the main function and I thought it would reset and re-init all the necessary hardware subsystems and registers.