I have an array unsigned char ABC[5]={0x04,0x01,0x05,0x10,0x00}; I want to transmit to RS232 use SBUF, for(i=0;i<=4;i++) SBUF=ABC[i]; but it's not work. Can anyone teach me how to do it? thanks so much!!!
Remember: each byte takes a finite time to transmit - you have to wait for one to finish before starting the next...
unsigned char ABC[5]={0x04,0x01,0x05,0x10,0x00}; I want to transmit to RS232 use SBUF, You must set TMOD, SCON ..... for(i=0;i<=4;i++) { SBUF=ABC[i]; while(TI==0); TI=0; }