Re: UART1_Read_text problem
Posted: 25 Jul 2013 17:19
hello, Marina
using ATmega16 - 14,745600 MHz
Sending to ATmega hex code, for example -- 20 21 22 23 24 25 26 27 28 29 30 0D 0A
Using C code -- UART_Read_Text(uart_rd_txt, "0", 13);
UART_Write_Text(uart_rd_txt);
Receive -- with errors --> 20 21 22 23 24 25 26 27 28 29
0D 0A 20 21 22 23 24 25 26 27 28 29
0D 0A 20 21 22 23 24 25 26 27 28 29
0D 0A 20 21 22 23 24 25 26 27 28 29
0D 0A 20 21 22 23 24 25 26 27 28 29
..................
Using C code -- UART_Read_Text(uart_rd_txt, 0x30, 13);
UART1_Write_Text(uart_rd_txt);
Receive -- bad code --> 49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
............
Using C code -- UART_Read_Text(uart_rd_txt, 48, 13);
UART_Write_Text(uart_rd_txt);
Receive --bad code --> 49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
........
/*at code start have:
UART_Write_Text("Init");
UART_Write(13); //0x0D
UART_Write(10); //0x0A
*/
//48 -- 0x30 -- "0"
this code like black box ((((
UART_Read_Text(x, y, z);
I tried it all day ((((
using ATmega16 - 14,745600 MHz
Sending to ATmega hex code, for example -- 20 21 22 23 24 25 26 27 28 29 30 0D 0A
Using C code -- UART_Read_Text(uart_rd_txt, "0", 13);
UART_Write_Text(uart_rd_txt);
Receive -- with errors --> 20 21 22 23 24 25 26 27 28 29
0D 0A 20 21 22 23 24 25 26 27 28 29
0D 0A 20 21 22 23 24 25 26 27 28 29
0D 0A 20 21 22 23 24 25 26 27 28 29
0D 0A 20 21 22 23 24 25 26 27 28 29
..................
Using C code -- UART_Read_Text(uart_rd_txt, 0x30, 13);
UART1_Write_Text(uart_rd_txt);
Receive -- bad code --> 49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
............
Using C code -- UART_Read_Text(uart_rd_txt, 48, 13);
UART_Write_Text(uart_rd_txt);
Receive --bad code --> 49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
49 6E 96 74 0D 0A
........
/*at code start have:
UART_Write_Text("Init");
UART_Write(13); //0x0D
UART_Write(10); //0x0A
*/
//48 -- 0x30 -- "0"
this code like black box ((((
UART_Read_Text(x, y, z);
I tried it all day ((((