Reply by Joel Winarske●December 28, 20052005-12-28
> May be already answered but I couldn't find it . I tried to read
data > from UART0 by initializing exactly based around
Insider Guide book
> from Hitex . I could not receive data by Hyperterminal . After
> checking all parameters , I used Oscilloscope and I had serial data
> with correct baud rate . Another software was used but the same
> problem exist.
If you confirmed correct baud rate and you see data being sent from target
there are still two possibilities:
1. Improper pin-out of RS-232 cable
2. Baud rate mismatch between target and host
void UART0_Write(char c)
{
while(!(U0LSR & 0x20)); // Check U0LSR_bit.THRE for 1
U0THR=c;
}
Hope this will work for you....
Regards
--- majid_mokhtari <majid_mokhtari@maji...> wrote:
---------------------------------
Hi Everybody ,
First of all , Merry Christams and I hope a happy new
year for everybody.
May be already answered but I couldn't find it . I
tried to read data
from UART0 by initializing exactly based around
Insider Guide book
from Hitex . I could not receive data by Hyperterminal
. After
checking all parameters , I used Oscilloscope and I
had serial data
with correct baud rate . Another software was used
but the same
problem exist.
I tried to read data by loop baking UART0 and 1 . (
only connecting
2< - - > 3) with the same initializing and I saw
serial data on line.
By overriding putchar ( ) for writing data and getchar
( ) to read
data but it didn't read anything . Any advice is
welcomed , it's my code ;
void UART0 (void)
{
PINSEL0 = 0x05; // Select TxD and RxD on
pin connect block
U0LCR = 0x80; //Enable programming of
divisor latches
U0DLL = 0xC2; //Program the divisor
latch for 19200 baud
U0DLM = 0x00;
U0LCR = 0x33; //Program the line
control 8\N\1
U0FCR = 0x4F; //enable the FIFO's
Reply by majid_mokhtari●December 28, 20052005-12-28
Hi Everybody ,
First of all , Merry Christams and I hope a happy new year for everybody.
May be already answered but I couldn't find it . I tried to read data
from UART0 by initializing exactly based around Insider Guide book
from Hitex . I could not receive data by Hyperterminal . After
checking all parameters , I used Oscilloscope and I had serial data
with correct baud rate . Another software was used but the same
problem exist.
I tried to read data by loop baking UART0 and 1 . ( only connecting
2< - - > 3) with the same initializing and I saw serial data on line.
By overriding putchar ( ) for writing data and getchar ( ) to read
data but it didn't read anything . Any advice is welcomed , it's my
code ;
void UART0 (void)
{
PINSEL0 = 0x05; // Select TxD and RxD on pin connect block
U0LCR = 0x80; //Enable programming of divisor latches
U0DLL = 0xC2; //Program the divisor latch for 19200 baud
U0DLM = 0x00;
U0LCR = 0x33; //Program the line control 8\N\1
U0FCR = 0x4F; //enable the FIFO's