Hi how many bits need to be set for GPIOPCTL? As per page 686 there are total 32 bits. But previously i have come across something like 16 bits need to be set in order to enable alternate functions?
Thanks
Nabila
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.
Hi how many bits need to be set for GPIOPCTL? As per page 686 there are total 32 bits. But previously i have come across something like 16 bits need to be set in order to enable alternate functions?
Thanks
Nabila
Hi Nabila.
In TM4C123, the alternate functions are now a 4-bit field per pin. Thus for 8 pins of every port it is now a total of 32 bits. Please note that it is one nibble per pin.
Regards
Amit Ashara
Thank you very much Amit.
So if i want to enable GPIO on PA7, i need to write the following right?
GPIO_PORTA_PCTL_R &= 0x0FFFFFFF; // 4) PCTL GPIO on PA7(28-31)
Thanks
Nabila
Hello Nabila,
If you want to enable GPIO on PA7 then you need to set the corresponding AFSEL register bit to 0 and the PCTL nibble for the pin as 0.
GPIO_PORTA_PCTL_R &= 0x0FFFFFFF;
GPIO_PORTA_AFSEL_R &= 0x7F;
Regards
Amit Ashara