This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCF8316A: How to program I2C address of two drivers?

Part Number: MCF8316A

Finally my motor control board with two MCF8316A is ready to test.

Two months ago I posted a thread here. But it was locked before I can confirm the suggested solution is workable or not.

Now I know the initial I2C address is 0x01. To change the I2C address of the 1st MCF8316A, I have to let the 2nd MCF8316A go to sleep. According to the data sheet, pin SPEED can be set to high (3.3V) and wait for 200ms for it to wake and enter STANDBY mode. Or, set SPEED pin low (0V) and wait for 200ms for it to enter SLEEP mode.

So, here is the testing procedures:

1. 1st MCF8316A.SPEED = 1

2. 2nd MCF8316A.SPEED = 0

3. wait for 300ms

4. set 1st MCF8316A.DEVICE_CONFIG.I2C_TARGET_ADDR = 0x40

5. write shadow registers to EEPROM

6. power cycle (I found the new I2C address will take effect only after the power is cycled)

But it seems not working. Now both chips seems to be at address 0x40.

Does anyone has this experience? Any suggestion?

  • Hi!

    I'll get back to you soon

    Regards,

    Vishnu

  • Hi Robert,

    Thanks for your patience and clearly explaining the problem statement. I'm assuming you are working on production device (not the pre-production device) and both devices (Device #1 and #2) are connected to the same I2C bus. My guess is that Device #2 is not in sleep mode. Is device #2 drawing few µA of current from the power supply? Also, did you configure Device mode select [DEV_MODE] to Sleep mode? 

    Regards,

    Vishnu

  • I purchased the MCF8316A chips recently from e-store (within two months), they should be production device. Yes, both devices are connected to the same I2C bus. It is very difficult to isolate and measure the current for each chip due to tight PCB layout. And I did notice the default DEV_MODE could be not in SLEEP mode. So, I also tested "DEV_MODE = 1"...

    I did another test yesterday. In order to isolate possible issues, I removed the 2nd chip from PCB. Now there is only one MCF8316A. Then I tried to let it go to SLEEP mode. But no matter the SPEED pin is 0V or 3.3V, I can still access this chip through I2C bus. It can not be accessed only when VM (24V in my case) is disconnected. Before the test, I wrote shadow registers to EEPROM, power-cycle, then read back to confirm the registers are modified as expected. So I ensure DEV_MODE is set to 1b before this test.

  • Hi Robert, 

    Some of our team members are out of office on travel for customer visits - so responses may be delayed. 

    For this E2E post, will sync up with team members & try to get you a response by early next week

    Best Regards, 
    Andrew 

  • Robert,

    If you are using a common power supply to power up both devices, you should see the supply current drop by almost 50% when one device is in standby and other device in sleep mode.

    Here are the steps I recommend you to follow.

    1. Device #1: Write DEV_MODE to "Standby" mode in EEPROM.

    2. Device #2: Pull SPEED pin to 3.3V and Write DEV_MODE to "Sleep" mode in EEPROM.

    2. After programming the EEPROM of both devices, turn off the power supply. Pull SPEED pin of device #2 to GND and turn on the power supply of both devices. Device #1 will be in standby mode and device #2 will be in sleep mode.

    3. Now you can communicate only to device #1. To wake up device #2, pull SPEED pin to 3.3V and power cycle the device. 

    Hope this helps.

    Regards,

    Vishnu

  • Please help me to confirm the question before doing the test: Is the SPEED pin detection for Standby/Sleep mode is checked only at the moment the power is applied, or it is continuously checked after power is turned on?

    From the data sheet, I think it should be continuously checked. But the recommended steps imply it is only checked once at boot-up.

  • Robert,

    SPEED pin for Standby/Sleep mode detection is checked only during boot-up.

    Regards,

    Vishnu

  • Since the 2nd device is already removed from PCB, I do a quick test and find that SPEED pin seems not be able to be detected correctly.

    In my system, the SPEED pin are connected to GPIO pin of Raspberry Pi. Raspberry Pi is powered by a 12V power supply and both MCF8316As are powered by a 24V power supply. The 12V and 24V power supplies are independent from each other.

    I turn on 12V power supply and set the GPIO pin (connected to MCF8316A.SPEED) low by using a simple testing program running on Raspberry Pi. I measure the GPIO voltage level by a multimeter to ensure it is around 0 voltage. After a few seconds, I turn on 24V to power on MCF8316As. And then I run a I2C probing program "i2cdetect" to detect all active devices on the I2C bus. It shows that there is a device active at 0x40 which is the slave address configured in EEPROM. Then I run my motor control  program, it can also access MCF8316A's registers correctly.

    No idea why it can work, it should not. Then, I turn off 24V. Now "i2cdetect" shows nothing active on the I2C bus. Then I set GPIO (SPEED) pin high and do the same test again. MCF8316A is active on 0x40 again.

    So, the SPEED pin is not correctly detected when powering on MCF8316A.

  • Robert,

    Before doing this test, did you write DEV_MODE to "Sleep" mode in EEPROM? 

    Regards,

    Vishnu

  • DEV_MODE is Standby mode. I suppose it can be changed to Sleep mode with SPEED pin in held low.

  • Robert,

    No, it cannot be changed to sleep mode by pulling the SPEED pin to GND. 

    Condition to enter sleep mode is that DEV_MODE should be programmed to "Sleep mode" AND Speed pin should be held LOW.

    Regards,

    Vishnu. 

  • I have tested and confirmed that SPEED can be used to wakeup device only when DEV_MODE is set o "Sleep mode". Unfortunately, after I soldered the device # 2 back to PCB, it can't be detected. I have tried several times, no luck. There must be something wrong with my circuit (probably soldering issue).

    Anyway, now I understand how to update i2c address for multiple MCF8316A. Btw, I think the data sheet should be revised with the followings:

    1) The detection timing of SPEED pin i.e. checked only when boot-up.

    2) DEV_MODE must be set to "Sleep mode" for SPEED pin to wake it up. And SPEED pin can not be used to put the device into Sleep mode if DEV_MODE is set to "Standby mode".