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.
I'm starting with HAL Code Generator aiming to define the pinout of RM57L843 for my application. The datasheet of this part number informs that some balls can be used as general purpose IOs when the available functions of them are not being used, as shown in the attached figure (extracted from page 23 of the datasheet). Also, the same document says that if the function of a ball not being defined, this one will assumes its main function.
Based on this, I want to know how I can define at HAL Code Generator that a single ball will be used as a simple GPIO and not with one of its possible functions?
Best regard,
Edgard.
Hi Edgard,
Configure the pinmuxing for DMM in the "PINMUX" tab in HALCoGen, and then select GIO as the Pin Mode under the DMM tab. You can also configure the direction in this tab.
Then in your code use GIO API to control the pin, e.g.,
gioToggleBit(dmmPORT, 4).
Please let me know if you have any questions.
Hi, Sahin.
In the "PINMUX" tab I must to let all the options of the intended pin unselected?
I tried also to select "GIO" in the tab "DMM", but I noticed that the generated files from the HALCoGen don't change. Is it normal?
Best regards,
Edgard
Hi Edgard,
I discussed this with my colleague, DMM is not supported by HALCoGen for this device. You will need to configure the registers manually in code. You can find the necessary register definitions and API by going to Help > Help Topics > Search and entering "DMM"
For pinmuxing, you will want to select DMM function for each ball, e.g., for ball W6:
The following threads may also help:
https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/333066?gio-functionality-for-dmmPORT
https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/256827
Hi, Sahin.
I used DMM just as an example, but my question is generic for any other interface that can be multiplexed. Do I need to check any function of an specific ball even though I want to use it as a GPIO or I must to let it blank?
Best regards.
Edgard
My doubt remains: how can I define in HALCoGen's PinMux that I want to use a pin simply as GPIO? Have I, necessarily, to set one option in PinMux tab, go to the tab of this selected function and define, one pin at a time, who will be GPIO?
Moreover, how can I check that the final function of each pin was defined as I desired?
I once used the PixMux tool to help me in multiplexing functions of another family of microcontrollers (AM437x) and it was much more friendly and easy to know, exactly, how I was configuring each pin...
Best regards,
Edgard
Hi Edgard,
Yes, you will have to define the pinmux for each pin otherwise the default pinmux will be used which is the first column in HALCoGen. You can enable/disable pins for an entire peripheral at the top of the tab, if that helps.
You can verify the pinmux by looking inside HL_pinmux.c.
If a module has GIO capability, you can configure it as GIO in the port tab, and configure pull control, direction, initial output value, etc.
Once you have done that you will need to click File > Generate Code (F5) in order to generate the code with these changes.
Hi Sahin.
I noticed that the files *.c of each interface that suport GIO configuration bring modification on internal register's values that show that the pin was effectively configured as GIO.
However, one issue remains: and how about NHET, eCAP and ADEVT pins? The datasheet informs that they can be used as GIO but the HALCoGen Tool doens't show this option in these ports tab. To use them as GIO, should I have to do some configuration?
Best regards,
Edgard
Hi Edgard,
In the past I've used NHET pins as GIO simply by configuring the pin using GIO API in my application. It should be the same for the other modules.
To be explicit:
gioSetDirection(hetPORT1, 0x1); gioSetBit(hetPORT1, 0, 0);
If you run into any issues with this please let me know.
Hi, Sahin.
Thank you for the explanations! Facing any issue, I will be reporting here.
Regards,
Edgard