EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

UART, easy prob.

Started by hasan mustafa July 28, 2010
hi everyone

im using 2811,,,,the problem,is im trying to receive and send the same char
8-bit .from other processor

Uint16 Rx_UART, Tx_UART;

//Transmit&Receive
while ( ScibRegs.SCIFFRX.bit.RXFIFST != 0 ) {

Rx_UART = ScibRegs.SCIRXBUF.all;

Tx_UART = Rx_UART;
}

while (ScibRegs.SCIFFTX.bit.TXFFST != 0);
ScibRegs.SCITXBUF = Tx_UART;
SciaRegs.SCIFFRX.bit.RXFFOVRCLR=1; // Clear Overflow flag

its not working,,,,im sure about the baud rate,,,,,,

in the other processor,,,,i keep sending the same value,,,over and over
SSB0aGluayB0aGUgUlggYW5kIFRYIGJhdWQgcmF0ZSBpcyBub3QgbWF0Y2guIApBIGJ1ZmZl
ciBtZW1vcnkgaXMgcmVxdWlyZWQgLgoKQXQgMjAxMC0wNy0yOCAxOToyOTozMe+8jCJoYXNh
biBtdXN0YWZhIiA8ZW5nLmhhc2FuLnBvd2VyQGdtYWlsLmNvbT4gd3JvdGU6CiAKCmhpIGV2
ZXJ5b25lCgppbSB1c2luZyAyODExLCwsLHRoZSBwcm9ibGVtLGlzIGltIHRyeWluZyB0byBy
ZWNlaXZlIGFuZCBzZW5kIHRoZSBzYW1lIGNoYXIgOC1iaXQgLmZyb20gb3RoZXIgcHJvY2Vz
c29yIAoKVWludDE2IFJ4X1VBUlQsIFR4X1VBUlQ7CgovL1RyYW5zbWl0JlJlY2VpdmUKd2hp
bGUgKCBTY2liUmVncy5TQ0lGRlJYLmJpdC5SWEZJRlNUICE9IDAgKSB7CgogICAgICAgIFJ4
X1VBUlQgPSBTY2liUmVncy5TQ0lSWEJVRi5hbGw7ICAgCgogICAgVHhfVUFSVCA9IFJ4X1VB
UlQ7CiAgICAgICB9CiAgICAKICAgIHdoaWxlIChTY2liUmVncy5TQ0lGRlRYLmJpdC5UWEZG
U1QgIT0gMCk7CiAgICBTY2liUmVncy5TQ0lUWEJVR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uY29tCgpPdGhlciBEU1AgUmVsYXRlZCBHcm91cHM6IGh0dHA6
Ly93d3cuZHNwcmVsYXRlZC5jb20vZ3JvdXBzLnBocApZYWhvbyEgR3JvdXBzIExpbmtzCgo8
Kj4gVG8gdmlzaXQgeW91ciBncm91cCBvbiB0aGUgd2ViLCBnbyB0bzoKICAgIGh0dHA6Ly9n
cm91cHMueWFob28uY29tL2dyb3VwL2MyOHgvCgo8Kj4gWW91ciBlbWFpbCBzZXR0aW5nczoK
ICAgIEluZGl2aWR1YWwgRW1haWwgfCBUcmFkaXRpb25hbAoKPCo+IFRvIGNoYW5nZSBzZXR0
aW5ncyBvbmxpbmUgZ28gdG86CiAgICBodHRwOi8vZ3JvdXBzLnlhaG9vLmNvbS9ncm91cC9j
Mjh4L2pvaW4KICAgIChZYWhvbyEgSUQgcmVxdWlyZWQpCgo8Kj4gVG8gY2hhbmdlIHNldHRp
bmdzIHZpYSBlbWFpbDoKICAgIGMyOHgtZGlnZXN0QHlhaG9vZ3JvdXBzLmNvbSAKICAgIGMy
OHgtZnVsbGZlYXR1cmVkQHlhaG9vZ3JvdXBzLmNvbQoKPCo+IFRvIHVuc3Vic2NyaWJlIGZy
b20gdGhpcyBncm91cCwgc2VuZCBhbiBlbWFpbCB0bzoKICAgIGMyOHgtdW5zdWJzY3JpYmVA
eWFob29ncm91cHMuY29tCgo8Kj4gWW91ciB1c2Ugb2YgWWFob28hIEdyb3VwcyBpcyBzdWJq
ZWN0IHRvOgogICAgaHR0cDovL2RvY3MueWFob28uY29tL2luZm8vdGVybXMvCgo
i think the baud rate is right,,,,because its working fine if i hashed the
condition of the receiving,,,while (ScibRegs.SCIFFTX.bit.TXFFST != 0);

also if you familiar with 97J60 controller,,,,its working only when i hash
the condition of the receiving,,,, the interrupt flag,,,,like here,,,
////////
while(!DataRdyUART());
c = ReadUART();
//////////////

// working only when i hash while(!DataRdyUART());,,,although its suppose to
be before Read instruction,,,,, so strange, i dont know why,,,,

the HW connection is cross,
Tx->Rx
Rx->Tx
just two pins connected

any help will be highly appreciated,,,

BR
Hasan

The 2024 Embedded Online Conference