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.

MSP430F6459-HIREL: how to generate 400hz DAC output sin wave with help of TimerB

Part Number: MSP430F6459-HIREL

Hi,

i am using examples from driverlib directory present in   mspware SDK with CCS version 11.2 .

i am able to generate sin wave with formula mentioned below:

 sineWave[i] = (uint16_t)((sinf((2 * M_PI * i) / TABLE_SIZE) + 1) *  1023.75/2.0) with table size of 256 and i am using SMCLK clock

How can i use TimerB interrupt  to generate 400HZ sin waveform from  DAC output ?

Regards,

Mounika

  • Hi,

    For a 400Hz sin wave, the period is 1/400 = 2.5ms. And there are 256 points in one period. So, the time appearance for each point is 2.5ms/256 = 9.77us. So, setting a time interval of 9.77us using the TimerB. Then change the output data of the DAC in the interrupt routine. 

    Best regards,

    Cash Hao

**Attention** This is a public forum