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/F28M35H52C: Understanding ControlCard Example adc_soc_c28.c (v220)

Part Number: F28M35H52C

Tool/software: Code Composer Studio

I've been working through the example files and trying to adapt them for use on a customer's PCB that has (unhelpfully) scrambled the pin usage - I've edited the set_pinout_f28m35x.x /.h files and am mstarting to get somewhere (I think).  The idea is that I can take examples and compile them for my changed pin utilization, however, some of the examples configure additional pins.  I'm looking at the adc_soc_c28.c program and it has the following lines in it which I think set up PortA pins in some way.  Can someone please help me decipher what these lines (lines 62-71) do...

// Step 2. Initialize GPIO:
// This example function is found in the F28M35x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// InitGpio(); // Skipped for this example
EALLOW;
GpioG1CtrlRegs.GPADIR.bit.GPIO0 = 1; //Set as output
GpioG1CtrlRegs.GPADIR.bit.GPIO8 = 1; //Set as output
GpioG1CtrlRegs.GPAMUX1.bit.GPIO0 = 1; //Set mux to EPWM1A
GpioG1CtrlRegs.GPAMUX1.bit.GPIO8 = 3; //Set mux to ADCSOCAn
EDIS;

  • Hi Ted,

    The first two lines are setting the GPIO as an output, as said in the comments.

    The second two lines are setting the mux values for each specific GPIO, which in turn selects the function of these GPIOs. See below from the TRM:

    Hope this helps,

    Kevin