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?

  • 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

  • Thanks for you reply. The test mentioned above didn't work. Only a ACK is received on the address of the MPU-9150. On the addresses where I expect the SAA I get a NACK even not after bitshifting the address.

  • I see that my code-snippet seems to be corrupted, but it seems that you have gotten the "essence" of what I was trying to show.

    I had a look at the datasheet for the display.

    1. Have you checked that the VDD of the nRF-device is > 3.0V to ensure logic high on SDA? If you're using the eval kit, it's 3.3V and not configurable.
    2. Have you scoped the analog lines to see if the signal is clean?

    BR Håkon

  • I noticed the missing TWI stop bit. That's no problem indeed.

    I'm using the development boards (PCA10006 and 7). With a battery powered supply of 3.2 to 3.3V. The supply to the SAA is 5V.

    Looking at the datasheet of the SAA the SDA and SCL should be at least 3.0V which should not be an issue because the supply of the nRF is 3.2V.

    While writing this reply I don't know what I changed, but it's working now. I will take a closer look at the changes the last few hours.

    For now thanks for helping.

Related