Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

EK-TM4C1294XL: GPIO is not going to zero

Part Number: EK-TM4C1294XL

Hi,

I am fairly new to this but I am basically trying to have a gpio charge up a tank circuit and then  go off, so I can look at the resonance in my tank circuit. However, when my gpio is in high state it is at 3.3V and when it is in my low state i am reading 1.8V. I would need that to be zero so it doesn't disturb my resonance reading. There is nothing connected to the board except for a multi-meter.

This is my code.

I had tried to set to zero using GpiopinWrite (commented out) same problem, this time i tried to switch to a pull down from a pull up, same problem. Any Ideas?

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "inc/hw_types.h"
#include "inc/hw_timer.h"
#include "inc/hw_ints.h"
#include "driverlib/timer.h"
#include "driverlib/interrupt.h"
#include "utils/uartstdio.h"
#include "driverlib/pin_map.h"

void NonPreciseTimer(int value){
    int i;
    i = 0;
    while(i!=value){
        ++i;
    }

}

int
main(void)
{
    // Enables Pin A
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    //check if pin A is enabled
    while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOA));
    {
    }
    //Enable the charging pin
    GPIODirModeSet(GPIO_PORTA_BASE, GPIO_INT_PIN_0, GPIO_DIR_MODE_OUT);
    GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_INT_PIN_0, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
    //GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_0, GPIO_PIN_0);
    //Non-precise delay to ensure tank circuit is charged
    NonPreciseTimer(1000000);
    //turn the pin off
    GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_INT_PIN_0, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPD);
    //GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_0, 0x0);

  • Is it not likely that your "tank circuit" is responsible for that "residual"  (1V8) voltage?

    Would not a "Quick/Eased" check result from your (temporarily) "Breaking the connection to the tank - and repeating both (Output High & Low) measures?"

    Most such tank circuits "oscillate" - especially so - when the tank's inductor is "deprived" of current.

    No mention is made of your,  "Frequency of operation or the current w/in the tank's inductor."     Both would prove useful.

    A "Note of CAUTION" should be added - any "direct connection" of an MCU's GPIO to such "tank circuit" ... (MAY) expose the GPIO to "Out of Spec" voltage transients - which may permanently damage that GPIO.

    It is far more "normal/customary" to impose "protective, buffering components" between the "Driving GPIO" and your (even small) "Tank Circuit."

    The MCU is a "precision device" which is designed to process & manipulate data - they are (never) famed as,  "Beasts of Burden!"     (Able to generate or react well to "unwanted surges!")

  • well right not i don't have that tank circuit connected at all. I am just testing the pin with a multi-meter for now, nothing is connected to the board except the multi-meter.
    When i end up having it be connected there will be a diode in place to prevent that
  • Then it is expected that the "tank circuit" has (already) "Done Damage."
    How have you connected your diode? Again - it proves UNWISE to "direct connect" a GPIO to such "tank circuit."
  • You need to look at the schematic of the EK-TM4C1294XL board. It is in the back of the User's Guide :
    www.ti.com/.../spmu365c.pdf
    GPIO Port A pin 0 is used as the UART receive and is connected to U20 through jumper J4 and a zero Ohm resistor. The pin on U20 has a pull-up roughly equal in strength to the pull-down on the TM4C1294. That results in the 1.8V. You can remove the JP4 jumpers and you should see the pin go low.

    Be careful when using these digital pins to drive analog circuitry. Make sure you limit the current and kick back voltages.
  • CB1,
    Thank you for posting the warning about connecting to the tank circuit. I was composing my response and you were faster.
  • I never connected it, I try to test things before i connect them so i noticed this before that circuit was ever connected to anything. literally the board hasn't come in contact with my tank circuit or any other circuit at all. My tank circuit has already been built and tested on an arduino so the diode has been there the whole time, which means if i even had connected it it wouldn't have done any damage. but just to be clear, i never connected it.

  • Thank you, That was exactly it one i removed the jumper everything worked, ill just use different pins.
  • Even using "different pins" - ANY direct MCU GPIO connection to an inductive circuit (even long pcb traces contain inductance) proves "RISKY!"

    A "push-pull" transistor circuit - or a "Gate Driver" - intended for a Power FET - would "protect your MCU" WHILE providing added current (both source & sink) - to the tank circuit.

    Just before your MCU (appears) to have survived "thus far" - your operation in this manner INVITES trouble! (which may arrive SOONER rather than Later...)
  • Bob,

    Thank you - you may recall that firm/I do NOT employ '129 - nor did I look @ poster's code - instead "seized upon what could reasonably be assumed" to be "damage" caused by the "directly connected" tank circuit.

    Poster seems "bound/determined" to now MAKE that connection - which is unwise as it stresses the MCU (and may kill that GPIO) as well as proves "insufficient" in both voltage/current output - to adequately drive (most) tank circuits...

    Your post surely warrants its,  "This Resolved" - however the "LIKE-less Forum" crüe have failed miserably in conveying the "emptiness" of poster's "Verifying" their "Confirmation of other's guidance!"    This happens in abundance - along w/the always impressive:  "TM4Cxyz:  TM4Cxyz"    Much Work clearly remains...