I know this isn't exactly the right forum to ask this, since this
supposed to be a WinARM forum but everyone here knows a lot, and the
boards are fairly active, so away we go!
I'm trying to use USART 0 on the AT91SAM7A3 eval board. I seem to be
failing though. I was able to get the DBGU port up and running, and
since the example that I took that code from casted all the DBGU stuff
as a USART, I figured it should be the same thing.
// Open PIO for USART0
AT91F_US0_CfgPIO();
// Enable Transmitter & receivier
AT91C_BASE_US0->US_CR = AT91C_US_RSTTX |AT91C_US_RSTRX;
// Configure DBGU
AT91F_US_Configure (
AT91C_BASE_US0, // USART base address
48054857,
AT91C_US_ASYNC_MODE, // Mode Register to be
programmed
57600, // Baudrate to be programmed
0); // Timeguard to be programmed
// Enable Transmitter & receivier
AT91C_BASE_US0->US_CR = AT91C_US_RXEN;
// Enable USART IT error and AT91C_US_ENDRX
AT91F_US_EnableIt(AT91C_BASE_US0, AT91C_US_RXRDY);
// open interrupt ------ Using DBGU receive interrupt
AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_US0,
INTERRUPT_PRIORITY_SIX, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,
InterruptServicer::Interrupt_ID_US0);
AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_US0);
And later on I do:
AT91F_US_EnableIt(AT91C_BASE_US0, AT91C_US_TXEMPTY);
AT91C_BASE_US0->US_CR = AT91C_US_TXEN;
This is pretty much the same code that I used for my DBGU port, except
that works and this doesn't. At first glance does it appear that I'm
doing anything wrong? Is there something that needs to be initialized
differently for a USART than the DBGU port?
I set up an oscilliscope to the USART0 Transmit pin on the the testing
pins on the side of the board, and its never moving at all. The DBGU
one moves right when it should.
Anyone have any thoughts about what the problem could be? Thanks in
advance!
It figures.... I've been working on this for 3 days on and off, and 45 minutes after posting I find the problem, thus ensuring I've wasted atleast someones time :( To anyone that read the first post and this post, thanks for taking the time to read it atleast! P.S. I did not set PMC stuff, which apparently the DBGU port does not need but USARTS do.
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.