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.

CCS/TMS320F28379D: TMS320F28379D

Part Number: TMS320F28379D


Tool/software: Code Composer Studio

Hello, I have started to go through the 1-Day Workshop for the C2000. <http://processors.wiki.ti.com/index.php/C2000_One-Day_Workshop>

In the Lab1_cpu01 project, in the c code, there are these initialization lines for the LED:

GpioCtrlRegs.GPADIR.bit.GPIO31 = 1;
GPIO_SetupPinOptions(34, GPIO_OUTPUT, GPIO_PUSHPULL);

The GPIO_SetupPinOptions takes a parameter "pin" and it is set by the line above to 34. What is the relation of the number 34 to GPIO31? I cannot see where these two are related. If I want to change the GPIO, what does the "pin" argument get set to?

Thank you, 

David

  • David,

    When using the F28379D dual-core device, CPU1 initially controls all of the GPIO pins. Notice in the workshop manual on page 29, step 13, there are actually three lines of code that will configure the GPIO pins (see code listing in directions). Line 17 configures GPIO31 as an output, where GPIO31 is connected to LED D10. Line 18 configures GPIO34 as an output and line 19 assigns GPIO34 to be controlled by CPU2, where GPIO34 is connected to LED D9. In this lab exercise, LED D10 (connected to GPIO31 and controlled by CPU1) will blink at a rate of approximately 1 Hz, and LED D9 (connected to GPIO34 and controlled by CPU2) will blink at a faster rate (approximately 5 Hz). What might be a little confusing here is the use of header file bit fields (line 17) and function calls (lines 18 and 19). The GPIO configuration could have been done with either or both.

    You might also be interested in looking at lab 11 in the F28379D multi-day workshop:

    processors.wiki.ti.com/.../C2000_Multi-Day_Workshop

    Here the GPIO pins are configured in the CPU1 Gpio.c file. I hope this answers your question and if so, please click the green "Verified Answer" button. Thank you.

    - Ken
  • David,

    It's been a while since I have heard from you last. Therefore, I am assuming you were able to resolve your issue. If this isn’t the case, please reject this resolution or reply to this thread. If this thread locks, please make a new thread describing the current status of your issue. Thank you.

    - Ken