Chunhee Song wrote: > > Hello, > > I am trying to send 2 different bytes data in sequence from PC to PIC > hardware using > serial communication. I am using interrupt function. since 2 these data > are of use in sequence, I use flag bit. When pic gets the first data, > counter sets 1 and flag bit is 1. when pic gets the second data, counter > sets2 and flag bit is 0. when pic gets the third data, counter sets 3 and > flag is 1. And so on. There is a time delay in every two data bytes. > Since the PC will most likely send the second byte directly after the first why not try... IRQ routine ; save interupt regs movf RCREG,W ; get 1st byte movwf Direction Wait btfss PIR1,RCIF ; (5) wait for next received data goto Wait movf RCREG,W ; get 2nd byte movwf DutyCycle ; process data ; reset interrupt flags ; restore interrupt regs retfie -- Best regards Tony http://www.picnpoke.com mailto:sales@picnpoke.com