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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/15/05 18:06
Read: times


 
#101140 - i've modified the ISR
Responding to: ???'s previous message
i've modified the ISR. i remove the code that isn't need. the ISR looks:

void puerto_serial_event() interrupt 4{
    if(TI==1){          //if transmition occurs
        TI=0;           //clears TI
    }

    if (RI==1){       //if reception occurs
        RI=0;           //clears RI
        if(RB8){
            SM2=0;      //data mode 2
        }
        else{
            if(ind_trama>4){
                ind_trama=0;
            }
            trama[ind_trama]=SBUF;
            ind_trama++;
            SM2=1;      //data mode 1
        }
    }
}


but still have problems. so, i'll try to be more clear, so lets start again.

1st i'm new with sdcc, at89c52 and all this world of mcu's programming. thanks for the patience that you'll have with me.

well, to the facs.

i have 2 at89c52. i'll like to send from one to the other 5 bytes (char). the transmiter i'll name master and the reciver i'll name slave.

the master send the information to the slave by serial port, the slave must recive the information and verifiy it. i have problems with the communication, it seems like the master isn't transmting the info.

i'm innitializing the serial port with:

    ES=0;                   //disable serial port interrupt
    TI=0;                   //clears TI
    SCON=0xF0;              //uart mode 3 (9 bit), REN=1
    TMOD=TMOD|0x20;         //Timer 1 mode 2
    TH1=0xFD;               //19200 Bds
    TL1=0xFD; 				//19200 Bds
    ES=1;                   //enable serial port interrupt
    TR1=1;                  //run Timer 1


and the ISR is at the top of this message.

thanks 4 the help.


List of 20 messages in thread
TopicAuthorDate
Serial communication between 2 at89c52            01/01/70 00:00      
   I had a quick look and since I am not            01/01/70 00:00      
   pic?            01/01/70 00:00      
      again            01/01/70 00:00      
         re your ISR            01/01/70 00:00      
            i've modified the ISR            01/01/70 00:00      
               get it going with a PC at one end that g            01/01/70 00:00      
                  i'll try 2 do that            01/01/70 00:00      
               transmit            01/01/70 00:00      
                  sorry            01/01/70 00:00      
                     No, do it in the interrupt            01/01/70 00:00      
                        must be like this?            01/01/70 00:00      
                           should be            01/01/70 00:00      
                              thanks            01/01/70 00:00      
                     NO            01/01/70 00:00      
   problems again, pls help me            01/01/70 00:00      
      still don't get it            01/01/70 00:00      
   with only two processors why are you con            01/01/70 00:00      
      i've said            01/01/70 00:00      
         then this is a bad title.            01/01/70 00:00      

Back to Subject List