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.

How to read/write the AM335x pins; role of pin mux mode

How are pins written-to and read-from in the AM335x? Is it necessary to set the pin mux mode?

How is the pin mux mode set? Can someone point me to the chapter and verse in the documentation, on all this?

What would be some good examples in the StarterWare to study?

Thanks

  • Pin multiplexing is selected with bits 3:0 of the respective CONF_<module> register which are described in the CONTROL_MODULE registers section of the TRM. 

    See the CONTROL_MODULE register descriptions in Table 9-10 of the TRM beginning with address offset 800h.

    Regards,
    Paul

  • I did know about that particular documentation, but I thought that the CONTROL_MODULE registers were for setting the pin functionality, and it still looks that way to me (I have my pin mux set up in mux.h and pin_mux.h). But how is data written-out/read-from pins, when they are actually being used? I have some pins in my design that are of all Modes, from 0 to 7, except 6. Does one have to set the Mode to be able to write to pins of that Mode? Are there separate registers for writing the actual pins? I have not been able to find documentation that explains this, but it is probably extremely obvious once one knows how; it is just a big mystery to me right now.


  • Most pins default to GPIO mode which provides direct register control of input/output functions.  The other modes pin multiplexing modes connect pins to various internal peripheral controllers which do not provide direct register control.

    Read the GPIO section in the TRM to understand the requirements for configuring the pins via the GPIO modules.

    Regards,
    Paul

  • Thanks; I am beginning to gather that one does not have to set any pin mux Mode to write to pins of that Mode; am I right? For example, in Mode 0, I have gpmc_ad0 - 15 selected in green in the pin mux utility, and in Mode 7, I have gpio0[31] (and many more) in blue (selected, ball available). The design has been output to mux.h and pin_mux.h. To read and write from these, I gather I only concern myself with gpmc_ad0 - 15 and gpio0[31], and how they work, is that right? What about green, "Selected"? If it's not in blue ("Selected, Ball Available"), am I going to be able to access those pins? gpmc_ad0 - 15 are in the rows for balls U7 - U13 (that's given, fixed and unchangeable in pin mux).

    So far I realize I have to first run the MUX_EVM() macro from pin_mux.h that sets up all the control registers. Is that the only place where I have to concern myself with the Mode number?

     

  • So far I realize I have to first run the MUX_EVM() macro from pin_mux.h that sets up all the control registers. Is that the only place where I have to concern myself with the Mode numbers?

  •  

    The blue cells in the Mode7 column are selected by default.  When you select any other mode for a pin it turns the respective cell green.

    The best way to use the pin mux tool is to right click on the peripheral interface you are tying to configure and then left click on view pins.  This opens another window which allows you to select one of the valid IO Sets for that peripheral interface.  For example, you can select GPMC IO SET #16 it will automatically select all pins associated with this IO Set.  If you do not need all the pins for your specific use case, like chip selects 3 and 4 , you can use these pins for other purposes as long as they are part of another valid IO Set.  In this case you would deselect the GPMC signals not required and they would revert back to GPIO mode if not previously selected for another mode.

    Regards,
    Paul

     

  • >The blue cells in the Mode7 column are selected by default.  When you select any other mode for a pin it turns the respective cell green.

    So does that mean I'll be able to access the pin(s) via programming control? That's OK, right?

    What about:

    So far I realize I have to first run the MUX_EVM() macro from pin_mux.h that sets up all the control registers. Is that the only place where I have to concern myself with the Mode numbers?

    And then, is this right?:

    I gather that one does not have to set any pin mux Mode number to write to pins of that Mode; am I right? For example, in Mode 0, I have gpmc_ad0 - 15 selected in green in the pin mux utility, and in Mode 7, I have gpio0[31] (and many more) in blue (selected, ball available). The design has been output to mux.h and pin_mux.h. To read and write from these, I gather I only concern myself with gpmc_ad0 - 15 and gpio0[31], and how they work, is that right?

  • Hi,

    I only have read the first message, sorry if things have already been pointed out. First of all I suppose you are using Staterware (cf your first message).

    I join you my CCS project pinMUX_ICE I did to show how to use mux.h and pinmux.h generated files from the Pin Mux Mux Utility. It is based on SYS/BIOS: 0550.pinMUX_ICE.rar. This project is meant for an ICE board, but pinmuxing is board independent.

    Hopefully that will help you ;)

    Cheers,
    Paul

  • Please look at this video, it will teach you everything about GPIO:
    http://www.youtube.com/watch?v=wui_wU1AeQc

     

  • Thanks for the replies...