Hi Everyone,

i am very new to pic programming and also new to picbasic.
however, i have a school project that i am suppose to program the PIC16F688 to send and recieve data from a gyroscope (MG1101). However, i do not know where to start. I currently have the PICBasis PRO Compiler an the USB programmer. I als have the LAB-X4 board.

What I am suppose to do is at follows:
1 Set up loop for 8 times
2 Drive clock SCL to high
3 Delay for data setup time and clk freq requirements
4 Read Data SDA
5 Drive clock SCL low
6 Shift data into a reg
7 Delay for clk freq requirements
8 Do 8 times (Go back to step 2)

This routine dictates the fasted clock time (bit time) for the 2-wire clock
(SCL). Adding the start and stop bit times along with the required delays
produces an effective clock time that is slower.

SCL clocking example: A typical 8-bit RISC microcontroller running at 5 MHz
internal clock rate (200ns period) would perform these steps in approx. 4
instructions. Each instruction would take 3 internal clock cycles which
equals a total of 12 us. The maximum SCL clock frequency per Table 1 is 400
KHz (12.5us). Therefore, minimal delays would be necessary within the
firmware routine to operate at the maximum SCL frequency on the 2-wire bus.

Could someone kindly help me with programming this PIC.

Thanks,
BEN