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.
Hello Guys,
we have an issue with the INIT of GPIO23 as output GPIO.
From technical reference manual for 28004X: TMS320F28004x Technical Reference Manual sprui33a.pdf
NOTE: GPIO22 and GPIO23 are in a special analog mode at reset, and must be reconfigured for GPIO use by clearing their bits in GPAAMSEL.
I verified DCDCCTL: DCDCEN = 0x00 ( DC-DC not used ).
My code is as following:
ANALOG_Subsystem.DCDCCTL.AsWord &= ~0x0001; // Write 0 to enable bit.
IOModule.GPIO_CTRL.GPAAMSEL.Items.GPIO_23 = 0;
IOModule.GPIO_CTRL.GPAODR.Items.GPIO_23 = 0;
IOModule.GPIO_CTRL.GPAPUD.Items.GPIO_23 = GPIO_PU_DISABLE;
IOModule.GPIO_CTRL.GPAGMUX2.Items.GPIO_23 = 0;
IOModule.GPIO_CTRL.GPAMUX2.Items.GPIO_23 = 0; // use as I/O
IOModule.GPIO_CTRL.GPADIR.Items.GPIO_23 = 1;
But it seems the output is not working as expected. Clearing or toggling is not executed by the pin.
For GPIO22 I did succeed with the same procedure.
Where I'm wrong or what did I miss?
Thanks in advance,
Marco
Hi Frank,
1. and 2. I read the paragraph about the frequency limitation on that pin. We have a LED connected to that pin that we want to toggle with max. 5 Hz.
I connected a 100k pullup resistor on the pin.
The cathode of a green LED is connected via a 1k series resistor to the pin => the pin has to sink some current (therefore logically low active) to get the LED activated.
But the pin is always at high level. Even setting the gpio-toggle bit within CCS does not have any effect.
3. Yes we have our own header files as we have a lot of different projects that are several years old with the 240x-DSPs to newest piccolos and we reuse existing code.
Regards,
Marco
Frank,
after having checked the init process as well as compared our own header files to the device datasheet and the C2000Ware examples I can now state the correct functionality of the pin with the init procedure stated above.
The SW was absolutely correct but a very small amount of solder did short 2 pads in another region of the HW and as a result always tied the GPIO to a 3.3V level.
Thanks for your support.
Regards,
Marco