The TWI problems continue ...

Hello all,

for the last few weeks I am trying to workout the i2c protocol with the sensor and the nrf52dk , so far none of the solution that I have considered work. More can be seen here: https://devzone.nordicsemi.com/f/nordic-q-a/84978/twi-reading-and-writing-basics/363652#363652

I am thinking can the speed of the processor be too fast for the sensor prototype, like the wires to the board may be too long, for example, for example, the same prototype works on the Arduino's Atmel omega just ok... 

Therefore, to test this out my question is, how to reduce the speed of the i2c to less than 100kHz and how to reduce the speed of the processor? Indeed, if you have other suggestions please do not hesitate.

Thank you in advance, looking forward to your suggestions, ideas, how to tackle this further.

Best.

Parents
  • Hello,

    how to reduce the speed of the i2c to less than 100kHz

    That is not possible, unfortunately. Please see:

    https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twi.html?cp=4_2_0_48_7_9#register.FREQUENCY

    100kHz is the lowest possible.

    how to reduce the speed of the processor?

    Why would you want to do that? I don't see how that would solve anything.

    If you are using 100kHz TWI, then the length of the wires should not be an issue (unless you are using several meters of wire). Try attaching a logic analyzer to it, and see whether you get the expected result on the TWI. You will most likely see that the data at the end of your wires are the same as you are sending, as 100kHz isn't really that fast. 

    Looking quickly through the ticket that you linked to, I don't really think that the speed is related, but I guess you want to see whether that could be the issue, because it is not working.

    Perhaps you want to try the twi_scanner example, and see whether the sensor responds when the twi_scanner() example cycles through all the TWI addresses.

    Best regards,

    Edvin

Reply
  • Hello,

    how to reduce the speed of the i2c to less than 100kHz

    That is not possible, unfortunately. Please see:

    https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twi.html?cp=4_2_0_48_7_9#register.FREQUENCY

    100kHz is the lowest possible.

    how to reduce the speed of the processor?

    Why would you want to do that? I don't see how that would solve anything.

    If you are using 100kHz TWI, then the length of the wires should not be an issue (unless you are using several meters of wire). Try attaching a logic analyzer to it, and see whether you get the expected result on the TWI. You will most likely see that the data at the end of your wires are the same as you are sending, as 100kHz isn't really that fast. 

    Looking quickly through the ticket that you linked to, I don't really think that the speed is related, but I guess you want to see whether that could be the issue, because it is not working.

    Perhaps you want to try the twi_scanner example, and see whether the sensor responds when the twi_scanner() example cycles through all the TWI addresses.

    Best regards,

    Edvin

Children
No Data
Related