Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: DBGU configuration fails in test program
PostPosted: Wed Jul 18, 2007 3:06 pm 
Offline

Joined: Thu Apr 26, 2007 1:01 pm
Posts: 9
Hello all,

i have a AT91SAM9293-EK. I could compile, link and download the LED Test example from Atmel. The program works fine, except the debug output is not working properly:

Its initilized like this:

static void dbgu_init (void)
{
/* Reset and disable receiver */
AT91C_BASE_DBGU->DBGU_CR = AT91C_US_RSTRX | AT91C_US_RSTTX;

/* Disable interrupts */
AT91C_BASE_DBGU->DBGU_IDR = 0xFFFFFFFF;

/* Configure PIOs for DBGU */
AT91C_BASE_PIOC->PIO_ASR = AT91C_PC30_DRXD | AT91C_PC31_DTXD;
AT91C_BASE_PIOC->PIO_BSR = 0;
AT91C_BASE_PIOC->PIO_PDR = AT91C_PC30_DRXD | AT91C_PC31_DTXD;

/* === Configure serial link === */
/* Define the baud rate divisor register [BRGR = MCK / (115200 * 16)] */
AT91C_BASE_DBGU->DBGU_BRGR = 54;
/* Define the USART mode */
AT91C_BASE_DBGU->DBGU_MR = AT91C_US_CHMODE_NORMAL;

/* Disable the RX and TX PDC transfer requests */
AT91C_BASE_DBGU->DBGU_PTCR = AT91C_PDC_RXTDIS;
AT91C_BASE_DBGU->DBGU_PTCR = AT91C_PDC_TXTDIS;

/* Enable transmitter */
AT91C_BASE_DBGU->DBGU_CR = AT91C_US_TXEN;
}

... and i assume i have a 99 MHz Masterclock, so the BRGR Register should be correct with 54 (= 115200 baud)

But when i connect to a terminal i see only cryptic signs. The Terminal has 115200-8-1-N settings.

Can anyone help me, about this problem. I think there it's only a baudrate error. Is the MCK for the AT91SAM9263 really 99 MHz or is it different?

Thanks
Mario Borer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 18, 2007 4:13 pm 
Offline

Joined: Thu Apr 26, 2007 1:01 pm
Posts: 9
Well i solved the problem: On my Board AT91SAM9263 (Y1) the Main clock is 16.367660 MHz --> so i had to change the default value in AT91SAM9263-EK.h for AT91B_MAIN_OSC to 16367660


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: