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.

AM3352: Switching I2C1 pin mux after CPU boot

Guru 15190 points

Part Number: AM3352

Hi,

We are using AM3352 and would like to switch the I2C1 pin assignment by software after CPU boot.
 
According to the AM335x data sheet, I2C1_SCL and I2C1_SDA can be assigned to multiple device pins. We also understand that the pin function is configured by the Control Module Pad Control Registers described in the AM335x TRM.
 
Our target configurations are as follows.
 
Configuration 1:
I2C1_SCL = E17
I2C1_SDA = E18
 
Configuration 2:
I2C1_SCL = J15
I2C1_SDA = H17
 
We would like to switch between these two configurations after boot by changing the Pad Control Registers.
 
Our assumed sequence is as follows.
1. Stop I2C1 communication.
2. Confirm that the I2C transfer is completed and the bus is idle.
3. Disable the I2C1 controller if required.
4. Remove the previous pins from the I2C1 function.
5. Configure the previous pins so that they do not drive the external bus.
6. Configure the new pins as I2C1_SCL and I2C1_SDA.
7. Confirm that SCL and SDA are stable High.
8. Enable I2C1 and resume communication.
 
Could you please confirm the following points?
 
1. Is it allowed to switch the I2C1_SCL and I2C1_SDA pin mux after boot by updating the Pad Control Registers?
 
2. Is the above sequence acceptable?
 
3. For the previously used pins, should we configure them so that they do not drive the external bus, instead of driving them as GPIO High or Low?
 
4. Is there any required wait time after changing the Pad MUX settings? We could not find a fixed wait-time requirement in the data sheet or TRM.
 
5. Should we avoid assigning both pin groups to the I2C1 function at the same time?
 
We understand that I2C signals require external pull-up resistors, and the AM335x Schematic Checklist recommends 4.7 kOhm pull-ups on I2C_DATA and I2C_CLK connected to the correct I/O voltage rail.
 
Best regards,
Conor
  • Hi Conor,

    1. Re-routing peripheral pins isn't typically performed after boot. Isn't there an option in your project to use another I2C peripheral such as e.g. I2C2 instead?

    2. Pin mux must be done before enabling a peripheral, so yes, you may need to stop the peripheral before re-muxing.

    3. Re-muxing to GPIO should be fine (assuming GPIO peripheral wasn't configured, it defaults to inputs)

    4. As already noted, this is not a typical procedure and time requirements are not characterized 

    5. And yes, one peripheral must be routed to one group of pins only.

    I2C pullup resistors can be adjusted later if needed. Values will depend mainly on transmission speed and I/O supply voltage (1.8 or 3.3 V)

    Regards,

    Stan