@@fatihinanc
Out of the millions of chips out there, you guessed correctly!
Working on the same? Did you figure it out...
@@chicken,
i2c just uses P1.6 and P1.7 I believe?
void i2c_init(unsigned char addr, unsigned char prescale){
//P1.6 SCL / P1.7 SDA
P1SEL |= BIT6 | BIT7;
P1SEL2 |= BIT6 | BIT7;
//...
}
Isn't P1.5 just used for SPI?
I will try your suggestion. Think the whole thing stranded when I do that.
As a general note I'm trying to see the Interrupt on my little DSO202 oscilloscope, but not really getting around with that thing.
Maybe the problem is that the pin is pulled high with 1.2kOhm resistor?
Will return with more findings, thanks for thinking with me :-)
EDIT:
I got it working, due to your hints/ideas.
For future reference this is quite simply it...
void main(void){
//setup...
for(;{
//issue i2c command...
//P1.6 SCL disable
P1SEL &= ~BIT6;
P1SEL2 &= ~BIT6;
P1IE |= BIT6; // interrupt
P1IES |= BIT6; // falling edge (default)
P1IFG &= ~BIT6; // flag clear
__bis_SR_register(LPM4_bits); // sleep
//-----------------------------------------------------------/
P1IE &= ~BIT6; // !interrupt
//P1.6 SCL re-enable
P1SEL |= BIT6;
P1SEL2 |= BIT6;
//read i2c data
}
}
#pragma vector=PORT1_VECTOR
__interrupt void ISR_P1(void){
if(P1IFG & BIT6){
P1IFG &= ~BIT6; // clear flag
__bic_SR_register_on_exit(LPM4_bits); // clear LPM bits, returns to main after last LPMx
}
}
Thanks again!