Ericforwang / android-serialport-api

Automatically exported from code.google.com/p/android-serialport-api
0 stars 0 forks source link

MCU can not receive the data #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,I try to build a communication between the tablet PC and the MCU with PL2303 
chip. My tablet PC use Android 4.0 system. My MCU is a 51 series. I choose the 
setting '/dev/ttyUSB0' and 'Baud rate 1200' on tablet PC. I tried the 
'Loopback' and 'Send 01010101', but the MCU can not receive any data. Does 
anyone know what is the problem?

The program in the MCU.
Crystal oscillator 11.0595 MHz

#include <REG52.H>
#include <stdio.h>
unsigned char b;

void main (void)
 {
        SCON = 0x50;               
    TMOD|= 0x20;                  
    PCON|=0x80;                                                           TH1 = 0xD0;
        TL1 = 0xD0;         
    TR1=1; 
        ES   = 1;       
    EA   = 1; 

        P0=0xff;
    b=0xff; 

    while(1)
    { 

      if (RI)       
      {  RI=0;      
         b=SBUF;    
         P0=b;
       }  
 } 
}

Original issue reported on code.google.com by 01bffe8...@gmail.com on 26 Nov 2012 at 9:06

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by cedric.p...@gmail.com on 20 Feb 2013 at 5:26