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.

TMS320F28388D: Certain GPIO pins not outputting, regardless of intial configuration

Part Number: TMS320F28388D

Hello

I have CPU2 set to be the main core for several GPIO pins to be configured as output.  Some behave properly, such as GPIO12, which I can write a high or low when using a command such as GPIO_writePin(12 ,1) OR GPIO_writePin(12, 0).  Doing a GPIO_readPin(12) will return correctly whatever I wrote to the pin. 

However, no matter what settings I am choosing for other pins such as GPIO9-11, I am not able to change the output to those pins.  It's always 1, sometimes always 0.  I have ensured that these output pins are not tied to a different output elsewhere which may be forcing either low or high from the other side.

Currently GPIO12 -- the pin that works -- has the following initial settings:

GPIO_setPinConfig(GPIO_12_GPIO12);
GPIO_setDirectionMode(12, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(12, GPIO_PIN_TYPE_STD);
GPIO_setMasterCore(12, GPIO_CORE_CPU2);  

I am using similar settings for pins 9-11.  However, even if I change any of the pad options (ie, GPIO_PIN_TYPE_PULLUP) it makes no difference.

Is there something I'm missing, such as some initial settings that may be disabling or forcing an output to these certain GPIOs?    

Thanks

  • Ok I have an update, but still leads to a different question.

    For clarification, in our existing CPU1 GPIO initialization routine, we set ownership of certain pins to CPU2.  So in that CPU1 init, we call GPIO_setMasterCore(9, GPIO_CORE_CPU2); .... up to GPIO_setMasterCore(12, GPIO_CORE_CPU2);

    In that same CPU1 initialization routine mentioned above, pin 12 configurations are set BEFORE the setMasterCore command -- GPIO_setPinConfig, GPIO_setDirectionMode, and
    GPIO_setPadConfig.  This is true only for pin 12.   For pins 9-11, those set configurations are invoked in the CPU2 GPIO initialization routine, which runs after CPU1 initialization of course.

    It does seem that in order for the configurations of pins to be committed, it has to be done before setMasterCore.  Is there a way to alter the pin configurations after this setMasterCore command?  I would prefer not to alter any existing CPU1 code if possible.

  • It appears I may be mistaken about one aspect.  Further investigation shows that any GPIO configuration (such as whether a pin is in or out) can only be done from CPU1 regardless of when setmaster is invoked. 

    Is there a way to alter a GPIO pin direction (INPUT or OUTPUT) from CPU2 if the direction has not been set at all by CPU1? 

  • Hi Phillip Shen,

    Yes, you are right, the GPIO control registers are only accessible from CPU1. Once the master core is selected, the data registers of the master core can control the GPIOs. But still, the control registers would remain accessible to CPU1 only.

    Regards,

    Veena