This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF51422 communicating with SAA1064 via TWI/I2C

The last few weeks I'm working with the nRF51422 and run in to several TWI/I2C issues. All of them I could solve except an issue with a SAA1064 7segment display driver from NXP.

Depending the device selection the I2C address of the SAA1064 should be 0x70, 0x72,0x74 or 0x76. When communicating non of these address will return an ACK. I'm using sd_twi_hw_master.c.

I do have TWI/I2C running because I can communicate with the MPU-9150 and an other sensor. But it fails on the SAA1064.

Is there maybe a small difference/issue with TWI and I2C?

Does anybody know where to look to solve this issue?

Parents
  • Hi,

    The address on the bus will be shifted >> 1 when it's inputted to the NRF_TWIx->ADDRESS register. Have you tried sending (TWI_ADDRESS<<1)?

    Also, if you loop through, you can check the ERRORSRC to see if you "hit" the right address, will be something like this:

    for (uint8_t i = 0; i<=0xff; i++) { retval = twi_master_transfer(i, dummy, sizeof(dummy)); if (NRF_TWI1->ERRORSRC) // Clear error source reg by writing '1' to error bits NRF_TWI1->ERRORSRC = NRF_TWI1->ERRORSRC; else // Set breakpoint here or similar actual_address = i; }

    Have you scoped the TWI-lines to see if there is any NACK/ACK on the bus?

    A side note regarding TWI/I2C: The I2C name was trademarked until recently, but the actual bus-implementation was not protected. Therefore you could avoid paying fees by calling it a TWI-module.

    BR Håkon

Reply
  • Hi,

    The address on the bus will be shifted >> 1 when it's inputted to the NRF_TWIx->ADDRESS register. Have you tried sending (TWI_ADDRESS<<1)?

    Also, if you loop through, you can check the ERRORSRC to see if you "hit" the right address, will be something like this:

    for (uint8_t i = 0; i<=0xff; i++) { retval = twi_master_transfer(i, dummy, sizeof(dummy)); if (NRF_TWI1->ERRORSRC) // Clear error source reg by writing '1' to error bits NRF_TWI1->ERRORSRC = NRF_TWI1->ERRORSRC; else // Set breakpoint here or similar actual_address = i; }

    Have you scoped the TWI-lines to see if there is any NACK/ACK on the bus?

    A side note regarding TWI/I2C: The I2C name was trademarked until recently, but the actual bus-implementation was not protected. Therefore you could avoid paying fees by calling it a TWI-module.

    BR Håkon

Children
No Data
Related