I want a f = 50KHz waveform, it's duty cycle is 50%; My test code as follow, Could you tell me why it is failed?
And need i setting PF config register, if it is,how to do?
Thanks very much!
/* Initialize managed drivers and/or services */
*pSICA_SYSCR &= 0xFFDF; // clear bit 5 to unlock
// set Clocks
// sets Core clock to 600MHz (= 18 x 33MHz) and SCLK to 120MHz (=600Mhz / 5) on BUB
Set_PLL( (short)(CORECLK/CLKIN), (short)(CORECLK/SYSCLK));
/* Set TMR1 as PWM_OUT mode and output 50KHz clk for AD7606 Convert A & B*/
// Disable Timer 1 first, in case there was an unexpected history.
*pTMRS8_DISABLE = TIMDIS1;
*pTIMER1_CONFIG = PERIOD_CNT | PULSE_HI | PWM_OUT;
*pTIMER1_PERIOD = 0x9600; //SCLK = 120MHz, PWM_CLK = 50KHz;
*pTIMER1_WIDTH = 0x4800; // duty cycle of 50%
*pTMRS8_ENABLE = TIMEN1;
/*Set timer over*/