winavr code for avr mega8. The program get data from serial port in interrupt function. And then out put the data to 74ls595 (serial to parallel IC) for controlling relay output.