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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/23/03 15:52
Read: times


 
#55249 - RE: Serial Send interrupt concept
Responding to: ???'s previous message
hi,
How can i send a array[8] out byte by btye through serial interrupt method?
Put next byte(s) into SBUF inside interrupt routine, not in main cycle. Is it a problem, really?
also, may i use the poll TI method to send data, and use the interrupt method to receive data?
Indeed, it all may be done with some experience.
But I cannot imagine why things are so hard for you? Do it simple! As example (just idea, I have no time to check it with compiler):
{
uchar send_buf[8], *send_ptr;
int send_size;

// somewhere in main activate transmit:
ES=0;
send_prt=send_buf;
send_size=8;
TI=1;
ES=1;
while(send_size != 0) ;  // wait till transmit be done
// blabla
}

// inside serial interrupt routine
{
if (TI)
{
  TI=0;
  if (send_size)
  {
    SBUF= *send_ptr++;
    send_size--;
  }
}
if (RI)
{
//....
}
}


Good days!







}






List of 8 messages in thread
TopicAuthorDate
Serial Send interrupt concept            01/01/70 00:00      
   RE: Serial Send interrupt concept            01/01/70 00:00      
   RE: Serial Send interrupt concept            01/01/70 00:00      
      RE: Serial Send interrupt concept            01/01/70 00:00      
      RE: Serial Send interrupt concept            01/01/70 00:00      
   RE: Serial Send interrupt concept            01/01/70 00:00      
      RE: Serial Send interrupt concept            01/01/70 00:00      
         more serial drivers...            01/01/70 00:00      

Back to Subject List