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);