spartekus
Member level 5
- Joined
- May 27, 2010
- Messages
- 81
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Duisburg, Germany
- Activity points
- 1,918
Hi all,
i have an i2c program(dspic33f), if i write adress of slave directly, it works well, i get the data,
but if i want to change adress with 2 buttons(as u can see on code). i read zero as data.
and i checked I2C1TRN register, it gets the adress which i am sending, but I2C1RCV is zero. where would be problem? any suggestions?
sequence[2] is array element which i sent to device(I2C1TRN).
// if(!bt2 & !bt1)
// sequence[2] = 0x91;
// else if(!bt2 & bt1)
// sequence[2] = 0x93;
// else if(bt2 & !bt1)
// sequence[2] = 0x95;
// else if(bt2 & bt1)
// sequence[2] = 0x9B;
thanks a lot
i have an i2c program(dspic33f), if i write adress of slave directly, it works well, i get the data,
but if i want to change adress with 2 buttons(as u can see on code). i read zero as data.
and i checked I2C1TRN register, it gets the adress which i am sending, but I2C1RCV is zero. where would be problem? any suggestions?
sequence[2] is array element which i sent to device(I2C1TRN).
// if(!bt2 & !bt1)
// sequence[2] = 0x91;
// else if(!bt2 & bt1)
// sequence[2] = 0x93;
// else if(bt2 & !bt1)
// sequence[2] = 0x95;
// else if(bt2 & bt1)
// sequence[2] = 0x9B;
thanks a lot
Last edited: