ну я пользовался. баудрейт не правил кварц такой же.. все работает.. кусок инициализации уарта
UsartCfgPio();
//* Reset Transmitter & receivier
AT91C_USART_PTR->US_CR = AT91C_US_RSTTX |AT91C_US_RSTRX;
//* Configure
AT91F_US_Configure (
AT91C_USART_PTR,
MCK,
AT91C_US_485_MODE, // Mode Register to be programmed
AT91C_DBGU_BAUD, // Baudrate to be programmed
0); // Timeguard to be programmed
AT91F_US_EnableIt(AT91C_USART_PTR, AT91C_US_RXRDY|AT91C_US_TXRDY);
AT91F_AIC_ConfigureIt (AT91C_BASE_AIC, AT91C_ID_USART, USART_IRQ_LEVEL,AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, SamUsartIsr);
AT91F_AIC_EnableIt (AT91C_BASE_AIC, AT91C_ID_USART);
// Clock
AT91C_BASE_PMC->PMC_PCER = (1<<AT91C_ID_USART);
кусок инициализации клоков
while(!(pPMC->PMC_SR & AT91C_PMC_MOSCS)) /* Wait the startup time */
{
;
}
/* Checking the Main Oscillator Frequency (Optional) */
/* Setup the PLL and divider: */
/* - div by 5 Fin = 3,6864 =(18,432 / 5) */
/* - Mul 25+1: Fout = 95,8464 =(3,6864 *26) */
/* for 96 MHz the erroe is 0.16% */
/* Field out NOT USED = 0 */
/* PLLCOUNT pll startup time esrtimate at : 0.481 ms */
/* PLLCOUNT 10 */
pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 14) | (AT91C_CKGR_PLLCOUNT & (10<<8)) | (AT91C_CKGR_MUL & (72<<16)));
while(!(pPMC->PMC_SR & AT91C_PMC_LOCK)) /* Wait the startup time */
{
;
}
AT91F_PMC_EnablePCK(AT91C_BASE_PMC,0,AT91C_PMC_CSS_PLL_CLK|AT91C_PMC_PRES_CLK_8);//12MHz
AT91F_PIO_CfgPeriph(
AT91C_BASE_PIOA, // PIO controller base address
0, // Peripheral A
((unsigned int) AT91C_PA6_PCK0 )); // Peripheral B
pPMC->PMC_MCKR = AT91C_PMC_CSS_PLL_CLK | AT91C_PMC_PRES_CLK_2 ; /* Selection of Master Clock and Processor Clock */
/* Select the PLL clock divided by 2 */
while(!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY));