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.

  • Resolved

AM1806: The way to change pinmux configuration runtime

Expert 5420 points

Replies: 2

Views: 35

Part Number: AM1806

Hi ,

Customer would like to switch pinmux configuration dynamically between I2C and GPIO.

Could you please share the procedure for it?

For example, currently they are thinking to follow the sequences below to switch pinmux configuration for pin G18 and G16. 

The order of each step is correct? There is no any mitting steps?

・Disable I2C

 ICMDR[0:IRS] =0

 ↓

・Change from I2C to GPIO

 ICPFUNC[0:PFUNC0]=1

 ↓

・Change IO configuration

 ICPDIR[1-0:PDIRx]=11b

 ↓

・Use pin G18 and G16 as GPIO

 ↓

・Switch back from GPIO to I2C

 ICPDIR[1-0:PDIRx] = 00b

 ICPFUNC[0:PFUNC0]=0

 ICMDR[5:IRS]=1

Thanks and Best regards,

Hata.

  • HaTa,

    AM18x devices do allow pin to be changed during runtime. There are two ways of doing this either at I2C module level or at SOC PINMUX level. With Pinmux register, you can change setting in PINMUX4[15:12] and PINMUX[11:8] to change the pin from I2C to GPIO and I2C module level this can be done using ICPFUNC as you are trying to do. From SOC perspective Disabling I2C, changing IO configuration sequence looks good.

    From application perspective besides changing the pin functionality, the application software may need to take other actions. For example, it needs to handle termination of ongoing transactions, interrupts enabled, cleaning DMA channels(if applicable) and close the peripheral drivers. I am not sure what component is connected to the I2C and if it is running in master or slave mode but you may need to have some messaging to external components to indicated I2C transactions are paused. 

    Regards,

    Rahul

    --------------------------------------------------------------------------------------------------------------------------------------
    Please click the
    This resolved my issue button on this post if the responses on this E2E thread answers your question.
    --------------------------------------------------------------------------------------------------------------------------------------

     

  • Expert 5420 points

    In reply to Rahul Prabhu:

    Hi Rahul

    Thanks for giving me a detailed information!

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.