> I am having a very diffictult time getting an at89c2051 to send characters to a PC via the serial port. I'm using a MAX235 (no ext components), as the RS232 driver.
> The problem is, the PC doesn't recognize anything the 89c2051 sends out (not even garbage). I've used a logic probe to verify data is actually being sent and appears on the RS232 side of the MAX235.
> I've tested the PC port by connecting TX to RX going through the MAX235, and it checks out OK. The distance from the 89c2051 to the PC is only about a foot, so I don't think the line length is the problem.
> I'm pretty much stumped at this point and would appreciate any pointers, advice, etc.
>
> Below is the program I'm using (P1_7 is used to blink an LED so that I know it's running).
>
> #include <at89x2051.h>
>
> //#define BAUD 19200
> //#define RELOAD 253 //19200
> #define RELOAD 192 //300
> //#define RELOAD 250 //9600
>
> void main(){
> int x,j;
>
> TCON=0;
> TH1=RELOAD;
> TMOD=32; //Timer 1=8 bit auto reload
> PCON=128; //Double baud rate
> //PCON=0; //don't Double baud rate
> SCON=64; //Enable serial
> TR1=1;
> P1_7=0;
>
> while(1){
> for(j=0;j<5;j++){
> TI=0;
> SBUF='A';
> while(TI==1){}
> for(x=0;x<10000;x++){}
> }
> TH1--;
> if(P1_7==0){
> P1_7=1;
> } else {
> P1_7=0;
> }
> }
> }
>
> --
>
http://www.piclist.com hint: The list server can filter out subtopics
> (like ads or off topics) for you. See
http://www.piclist.com/#topics
>
>