AnsweredAssumed Answered

bf506 TIMER_width and TIMER_Period for AD sample rate

Question asked by lau on Jan 7, 2014
Latest reply on Feb 1, 2014 by Prashant

Hi,

 

I have a question for how to calculate the ad sample rate according to the following configure.

 

----------------------------------------------------------------------------

*pPLL_CTL = 0x2000;//VCO = 400MHz

*pPLL_DIV = 0x0004;//SCLK = 80MHz

 

//Timer7 Config for trigger

          *pTIMER7_CONFIG = PERIOD_CNT | PWM_OUT | PULSE_HI;// | IRQ_ENA;

          *pTIMER7_PERIOD = 128;//Sampling freq = SCLK / Period

          *pTIMER7_WIDTH = 5;

/****************************************************************/

/***WAVEFORM GENERATION USING TIMER0*****************************/

/****************************************************************/

          *pPORTG_FER |= PG14;

          *pPORTG_MUX |= 0x8000;

          //Timer0 Config for trigger

          *pTIMER0_CONFIG = PERIOD_CNT | PWM_OUT | EMU_RUN ;

          *pTIMER0_PERIOD = 64000;

          *pTIMER0_WIDTH = 32000;

          *pTIMER_ENABLE = TIMEN0;

 

Thanks

Outcomes