Home arrow Support arrow Forums

Luminary Micro Forums

khanh2

Fresh Boarder

2010/02/09 09:34

how to

hi,

i have with me the lm3s1968 and have read through some of the c example codes through keil Uvision. i can't seem to figure out how the pins are assigned in each code example, like what is used to assign a pin to a function? i'm new to this, really need help.

thanks

h.k

login or register to reply

TI Bobby

Moderator

2010/02/09 13:31

Re:how to

Taking a look at the uart_echo example:

In the function main, after setting the system clock and configuring the RIT display, UART0 is configured to use GPIO A0 and GPIO A1 as the RX and TX pins. The first thing that is done is to enable both of the peripherals (UART0 and GPIOA) with a call SysCtlPeripheralEnable().

You will then see a call to GPIOPinTypeUART(), which configures the GPIO port to be controlled by the UART. This is all that is required to enable GPIO A0/A1 to work as UART pins.

Depending on the peripheral you are working with, there are additional GPIO APIs that setup GPIO pins for use with SSI, I2C, etc.

Hope this helps.
--Bobby

login or register to reply