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: AT91SAM9G45 DBGUART can not print out
PostPosted: Tue Mar 15, 2011 11:01 am 
Offline

Joined: Thu Feb 24, 2011 3:28 pm
Posts: 2
my AT91SAM9G45 board DBGUART can not print out,DEBUG at91bootstrap-at91sam9g45-ek-iar source #if defined(TRACE_DBGU) DEBUG cannot print out,#lif defined(TRACE_USART_2) UART2 print out normal.why?


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45 DBGUART can not print out
PostPosted: Fri Mar 18, 2011 11:01 pm 
Offline

Joined: Sat Sep 11, 2010 1:32 am
Posts: 23
I have never had an issue with my DEBUG port as long as it was initialized and configured for the correct baud rate.

Here is my init code (Note: I don't use IAR but the Atmel Config file should be similar)

/* Write DBGU register */
static inline void write_dbgu(unsigned int offset, const unsigned int value)
{
writel(value, offset + AT91C_BASE_DBGU);
}

/* Read DBGU registers */
static inline unsigned int read_dbgu( unsigned int offset)
{
return readl(offset + AT91C_BASE_DBGU);
}

/* Disable interrupts */
write_dbgu(US_IDR, -1);
/* Reset the receiver and transmitter */
write_dbgu(US_CR, AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS);
#if (MASTER_CLOCK == 133333333)
/* Configure the baudrate 115200 = 133333333 / 16 * CD */
write_dbgu(US_BRGR, 72);
#else
/* Configure the baudrate 115200 = 100000000 / 16 * CD */
write_dbgu(US_BRGR, 54);
#endif
/* Configure USART in Asynchronous mode */
write_dbgu(US_MR, AT91C_US_PAR);
/* Enable RX and Tx */
write_dbgu(US_CR, AT91C_US_RXEN | AT91C_US_TXEN);


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 16 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: