Hi to all, I got basic spi running now I am having hard time to get odd parity bit 9-th bit working here is the code any help will appreciate. void ps2_out(BYTE data) { BYTE i; int temp=1,data_copy,count; data_copy=data; output_low(PS2_CLK_OUT); // start bit delay_us(35); for(i=0;i<8;++i) { output_bit(PS2_DATA_OUT, shift_left(&data,1,0)); OUTPUT_HIGH(PS2_CLK_OUT); // delay_us(35); output_low(PS2_CLK_OUT); delay_us(35); } data_copy &= 0x7f; //trim to 7 bit ASCII temp^=((data_copy) & 1); for (count = 0; count < 8; ++count) {temp ^= ((data_copy >> count) & 1);} if (temp==0){output_high(PS2_DATA_OUT);} // even if (temp==1){output_low(PS2_DATA_OUT);} // odd output_high(PS2_CLK_OUT); // stop bit delay_us(200); } thanks again Andre -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist