This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDC1000-TDC7200EVM: How to create a firmware that triggers a reading every 30 secs?

Part Number: TDC1000-TDC7200EVM

Hi everyone:

We are using the TDC1000-TDC7200EVM in conjunction with an arduino to send the ultrasound readings to a remote end.

The connection is easy: the UART pin of the TDC1000-TDC7200EVM board is connected to a serial pin on an arduino mega, and every info that is received by the arduino is sent using a wireless module.

I am able to do so if I have the TDC1000-TDC7200EVM connected to the computer, but whenever I disconnected the board it stops reading and sending the info. And I need that because I want to leave it installed on some pipe for testing.

I tried to modify the firmware that comes with the TDC1000-TDC7200EVM board, but the results are not that great.

What I did was to leverage the bext_trigger_time int used in main.c

  next_trigger_time = 0;
  while (1)
  {
//    __bis_SR_register(LPM0_bits + GIE);                                        // Enter LPM0, enable interrupts
    __no_operation();                                                          // For debugger 
    USBCommunicationTask();
    if (next_trigger_time)
    {
      next_trigger_time = 0;
      if (TDC1000_MSP430Timer_TDC)
        MSP430Timer_tdc_trigger_measure();
      else
        tdc_trigger_measure();
      __no_operation();                                                        // For debugger     
    }
  }

I realized that the timer Timer1 has the interrupt service routine that sets that value (timer_queue.c, line 240). Therefore I decided to check hw the timer is init. This line appears on the init:

TA1CCR0 = INTERVAL_100ms; 

Can I just change that value to the number of seconds I want my ultrasound to trigger a measurement every 30 secs? I also set the continuous_trigger_state variable to 1 for this.

The problem I am having is that if I disconnect the USB the triggering is not performed afterwards.

Any other change I should do for this to work?