Hi Can someone please tell me how to set bits in these resistors?
GPIO_PORTF_DIR_R
GPIO_PORTF_DEN_R
GPIO_PORTF_PUR_R
Regards
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 Can someone please tell me how to set bits in these resistors?
GPIO_PORTF_DIR_R
GPIO_PORTF_DEN_R
GPIO_PORTF_PUR_R
Regards
Nabila
Hi Nabila,
Nabila Naorin said:these resistors?
Perhaps, do you mean "registers"?
Here is an example below.
HWREG(GPIO_PORTD_BASE + GPIO_O_DEN) |= 0x80;
You, can check other HWREG usage at gpio.c C API's.
HWREG macro can be found at \\inc\hw_types.h.
-kel
Sorry yes registers. I mean is there two bits that needs to be set in combination in order to generate some signal in any PIN? Like for PCTL there are four bits. I looked at the data sheet. But it is quite confusing.
Thanks
Nabila
Hi Nabila,
Are you using a Tiva Launchpad?
I guess you want to output signal to GPIO. I would advice you to read the GPIO section of Tivaware Peripheral Drivers Library User's Guide. There is also an example gpio code that your can review.
-kel
Yes i had a look at the document. It is not much relevant to what i am trying to do. Suppose for other registors like GPIOAMSEL how the different combination of bits trigger different output? How many comibinations are possible? How can i find the details about GPIOAMSEL,GPIOAFSEL
Regards
Nabila
Can anyone please explain me these:
GPIO_PORTF_DEN_R = 0x14; // 7) enable digital I/O on PF4, pf2
GPIO_PORTF_DATA_R=0x04; // set pf4 to 1
Thanks
Nabila
Hi Nabila,
In the datasheet section for GPIO, there is a table which explains the combination of the gpio registers and the effect of the register configuration on the output. For your reference see below;
If your question is how
GPIO_PORTF_DATA_R=0x04;
sets the Pin PF4 to 1, then you would need to look in the inc/tm4c*.h for the macro defitnition
Regards
Amit Ashara
Hi Nabila,
Refer, to your datasheet when trying to understand about registers. Do refresh your memory regarding hexadecimal and binary.
Nabila Naorin said:GPIO_PORTF_DEN_R = 0x14; // 7) enable digital I/O on PF4, pf2
This is correct. Refer to GPIODEN register.
Nabila Naorin said:GPIO_PORTF_DATA_R=0x04; // set pf4 to 1
This sets PF2 to 1, not PF4. Refer to GPIODATA register
-kel
Thank you Amit. One last thing, what about the AMSEL register? When do we need to set the bits of that register?
Thanks
Nabila
Hi Nabila,
The AMSEL register is required to be set when a analog function like ADC, ACMP or USB pins have to be used.
Regards
Amit Ashara
@Nabila.
No problem at all. You, can also check tutorials in the internet for Tiva Launchpad.
-kel