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.

LAUNCHXL-F280049C: read, set and print gpio's

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: C2000WARE

Hey, 

How I can set gpio to be INPUT/OUTPUT and How I can read gpio?
and In CCS ide what is the correct way to print outputs for example in Arduino I print with serial ?

Many thanks!

  • Hello Shahar,

    You can refer to the examples provided in C2000Ware for GPIO examples (C2000Ware_5_01_00_00\driverlib\f28004x\examples\gpio). You can also take a look at the device TRM to look at the control registers for GPIO, but in general:

    • Use GPyMUX1/2 and GPyGMUX1/2 to control whether the pin is used by GPIO or another peripheral
    • Use GPyPUD to enable/disable pullups
    • Use GPyDIR to control direction of the pin
    • Use GPyDAT to read the value of the GPIO pin
    • GPyDAT, GPySET, GPyCLEAR, and GPyTOGGLE can be used to control the pin if in output mode

    For the above configurations, it is best to use the provided driverlib functions since they will include error checking as needed and have been developed by our software team (see the examples above for the usage of these).

    For printing outputs in CCS you should be able to print using normal means (i.e. sprintf), but you can also look at the values of variables in the Expressions window since JTAG allows for this.