I tried to do UART software. I have done the transmit code and receive code. It's like below
Transmit
- CODE: SELECT_ALL_CODE
TX1=0;
for(j=0;j<baud_delay;j++) continue;
for(i=0;i<=7;i++){
TX1=data;
data=data>>1;
for(j=0;j<baud_delay;j++) continue;}
TX1=1;
for(j=0;j<baud_delay;j++) continue;
Receive
- CODE: SELECT_ALL_CODE
while(RX1==1) continue;
data=0;
for(j=0;j<baud_delay;j++) continue;
for(i=0;i<=7;i++){
data=(data>>1)|(128*RX1);
for(j=0;j<baud_delay;j++) continue;}
Then I wan't to put the receive code into the RB0 Interrupt (INTF). I wan't do this because I don't want use while(RX==1).
This is interrupt part.
- CODE: SELECT_ALL_CODE
if(INTF==1){
GIE=0;
data=0;
for(j=0;j<baud_delay;j++) continue;
for(i=0;i<=7;i++){
data=(data>>1)|(128*RX1);
for(j=0;j<baud_delay;j++) continue;}
GIE=1;
INTF=0;
}
But, it's not running. Did somebody have explanation on this?