Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/09/04 16:05
Read: times


 
#80814 - strange Uart transfer!
Hail! i'm again experiencing problems with Uart.

i'll give more details :

i connected 11.059Mhz clock (to get 9600 baud rate)
here is my configuration of Uart :

TR1 = 0;
SCON = 0x50; //REN = 1, Sm0 = 0 Sm1 = 1
TMOD = 0x20; //Timer1 in mode 2 ( 8-bit Auto reload)
TH1 = 0xFD; // for getting baud of 9600.
TL1 = 0x00; //start value.
TR1 = 1;

than i made function which sends an array of data :
void send(int to_send[],int len)
{
int i=0;
TI=1;
while (i<len)
{
while(!TI); // protection
TI=0; //clearing the flag.
SBUF=to_send[i]; //sending.
i++;
}
}

then i'm sending two arrays :

code const int A[] = {0x1E,0x0,0x0C,0x7F,0x0,0x2,0x1,0x3};
code const int B[] = {0x1E,0x0,0x0C,0x1,0x0,0x1A,0x0,0x1,0x0,0x1,0x0A,0x30,0x35,0x34,0x35,0x34,0x33,0x34,0x38,0x30,0x35,0x5,0x1,0x1,0x5,0x81,0x1,0x0,0x0,0x1,0x1,0x40};

send(A,sizeof (A)/sizeof(int));
send(B,sizeof(B)/sizeof(int));

i pluged the Trx through Max232 to COM1 in my PC and got this results :
each line represent new try (i mean i did reset and caputred the data again)
please avoid the "*" and the ","

*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,1,30,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,FF,E7,0,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,FF,FE,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,FF,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,20,0,0,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,F8,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,60,FF,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,1,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,1,FF,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,1,E,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,F8,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,1,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,40,4,
*1E,0,C,7F,0,2,1,3, *1E,0,C,1,0,1A,0,1,0,40,0,

as you see the A array transferd perfectly , but B...
only half of the array was transfered and even the "transfered part" have some mistakes in it lasts bytes.

anyone seen problem like that before? maybe someone can help me?


List of 16 messages in thread
TopicAuthorDate
strange Uart transfer!            01/01/70 00:00      
   RE: strange Uart transfer!            01/01/70 00:00      
   RE: strange Uart transfer!            01/01/70 00:00      
   RE: strange Uart transfer!            01/01/70 00:00      
      RE: strange Uart transfer!            01/01/70 00:00      
         RE: strange Uart transfer!            01/01/70 00:00      
         RE: strange Uart transfer!            01/01/70 00:00      
            RE: strange Uart transfer! - Steve            01/01/70 00:00      
               RE: strange Uart transfer! - Steve            01/01/70 00:00      
                  RE: strange Uart transfer! - Steve            01/01/70 00:00      
                     hypoterminal            01/01/70 00:00      
         RE: strange Uart transfer!            01/01/70 00:00      
            RE: strange Uart transfer!            01/01/70 00:00      
         RE: strange Uart transfer!            01/01/70 00:00      
         RE: strange Uart transfer!            01/01/70 00:00      
   RE: strange Uart transfer!            01/01/70 00:00      

Back to Subject List