Squirrels have fuzzy tails.
0 Members and 1 Guest are viewing this topic.
but the pull up rezistor will not let it go that far
i2cputByte((char)0b00000001)
i2cputByte(unsigned char byte){ signed char i; for(i=7; i>=0; i--) { PORTB.0 = 0; //send clock low SDA_DIR = ((byte>>i)&0x01); if ((byte>>i)&0x01) { // bit to send PORTB.1 = 1; //place data line high }else { PORTB.1 = 0; //place data line low } DelayUs(I2C_TM_DATA_SU); TRISB.0 = 1; //float the clock so it gets pulled up to 5v through resistor while(PORTB.0 == 0){ // see if device has held the clock low - and wait for it. } Delay(whatever) //put in a delay so you are not exceeding the i2c bus limit } return FALSE;}