Guest
#1172063
Hi everyone..
Its unbelievable...! I can't initalise my COM-Port..!??!?!???!?
Ive got the AT91SAM7A3-Evalutation-Kit from Atmel.
I work with the IAR-Workbench.
I want to send somthing on USART0 and measure it with a KO.
The LIN-Driver is disconnect on S22 to S25.
So i Can measure singnals there (By S22 To S25 directly from the uC!)
MCK = 47923200
My initialisation..:
void init_UART0(void)
{
//Setting Pin (PIO)
//RXD0
(*(volatile unsigned int*)0xFFFFF404) = (0x1<<2); //Disable Register
(PIOA)
(*(volatile unsigned int*)0xFFFFF470) = (0x1<<2); //Select A
Register
(*(volatile unsigned int*)0xFFFFF400) = (0x1<<2); //Output Enable
(PIOA)
//TXD0
(*(volatile unsigned int*)0xFFFFF404) = (0x1<<3); //Disable Register
(PIOA)
(*(volatile unsigned int*)0xFFFFF470) = (0x1<<3); //Select A
Register
(*(volatile unsigned int*)0xFFFFF400) = (0x1<<3); //Output Enable
(PIOA)
//CTS0
(*(volatile unsigned int*)0xFFFFF404) = (0x1<<6); //Disable Register
(PIOA)
(*(volatile unsigned int*)0xFFFFF470) = (0x1<<6); //Select A
Register
(*(volatile unsigned int*)0xFFFFF400) = (0x1<<6); //Output Enable
(PIOA)
(*(volatile unsigned int*)0xFFFC0000) = 0x1AC;
//-> Disable and Reset Rx Tx
(*(volatile unsigned int*)0xFFFC0028) = 0X0;
// (US0) Transmitter Time-guard Register -> Disable
(*(volatile unsigned int*)0xFFFC0004) = 0x25808C0;
// (US0) Mode Register -> Baud to MCK, 8Bit, No Parity, 1 StopBit
(*(volatile unsigned int*)0xFFFC000C) = 0xFFFFF;
// (US0) Interrupt Disable Register-> Interrupt Disable
(*(volatile unsigned int*)0xFFFC0020) = 0x1A;
// (US0) Baud Rate Generator Register -> Baude=115200
(*(volatile unsigned int*)0xFFFC0024) = 0x0;
// (US0) Receiver Time-out Register -> Disable
(*(volatile unsigned int*)0xFFFC0000) = 0x50;
// -> Enable Rx Tx
}
Now i want to send something and measure it with a KO.
( To test if something coming out of USART 0 and the init works..)
How can I do that? I think i must to write into The THR-Register.
I tastet like this:
(*(volatile unsigned int*)0xFFFC001C) = 0xC &0x1FF;
// (US0) Transmitter Holding Register
while ((*(volatile unsigned int*)0xFFFC0014) & 0x2 != 0x2);
// (US0) Channel Status Register
So i wait until the THR is Ready. And it goes on! But nothing comming
out!
Is something else needet to send?
What do i Wrong???
Best Regarts
Desperatet Programmer