strange Hi to all, when I set break point on portB bit 4 other pins turn on too and shift_left doesn't work I worked on it whole day and I gave up. I appreciate if any one can see what I am doing wrong. I am not sure if what I put together is real SPI interface what I wanted to do is to make spi interface. here is partial code. I am using 18f452 with mplab ccs plugin thanks Andre #include <18F252.h> #device ADC=8 #fuses HS,NOWDT,NOPROTECT,NOLVP #use delay(clock=4000000) // #use rs232(baud=1200, xmit=PIN_C6, rcv=PIN_C7,errors) // #define MICROSOFT TRUE #define MOUSE_SYSTEMS FALSE #DEFINE LEFT_BUTTON PIN_B6 #DEFINE RIGHT_BUTTON PIN_B7 #DEFINE X_CHANNEL 0 #DEFINE Y_CHANNEL 1 #define PS2_CLK_OUT PIN_B4 // #define PS2_DATA_OUT PIN_B5 // #define PS2_CLK_IN PIN_B1 // #define PS2_DATA_IN PIN_B0 // #define LED PIN_C3 void ps2_out(BYTE data) { BYTE i; output_low(PS2_CLK_OUT); // start bit on for(i=1;i<=8;++i) { output_bit(PS2_DATA_OUT, shift_left(data,1,0)); output_high(PS2_CLK_OUT); // <= I set break point here output_low(PS2_CLK_OUT); } output_low(PS2_DATA_OUT); delay_ms(11); } -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist