我要产生方波,用TIOA1输出,配置PWM,但一直没输出,代码如下:
#define PIN_ESAM_CLK {1 << 28, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
static const Pin EsamClockPin = PIN_ESAM_CLK;
PIO_Configure(&EsamClockPin, PIO_LISTSIZE(EsamClockPin));
void ConfigureTc1(void)
{
// 使能定时器计数器
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_TC1;
AT91C_BASE_PMC->
// 配置定时器TC1模式寄存器使工作在 Waveform Mode
TC_Configure(AT91C_BASE_TC1,AT91C_TC_CLKS_TIMER_DIV5_CLOCK | AT91C_TC_WAVESEL_UP_AUTO | AT91C_TC_WAVE |
AT91C_TC_ACPA_SET | AT91C_TC_ACPC_CLEAR );
AT91C_BASE_TC1->TC_RC = 1000;
AT91C_BASE_TC1->TC_RA = 500;
AT91C_BASE_TC1->TC_CV = 0;
// 开启时钟
CLKStart_ESAM();
}
上面的代码,PIOA1(PA27引脚)一直没输出方波,很是郁闷,求指点!!!!!!!
------解决方案--------------------
------解决方案--------------------
AT91SAM9260定时器计数器模块(翻译)