Hi...I'm interfacing a switch with tm4c123h5qc ..i need to connect the switch to power suply..can i give 5v or 3.3v??
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.
Hi...I'm interfacing a switch with tm4c123h5qc ..i need to connect the switch to power suply..can i give 5v or 3.3v??
k Thank you..now i just display some chracter on lcd if i press the switch..I have done coding but not able to get the output..
main()
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);
GPIOPinTypeGPIOInput(GPIO_PORTK_BASE, GPIO_PIN_0 | GPIO_PIN_1| GPIO_PIN_2 | GPIO_PIN_3);
while(1)
{
GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_3, 0x08);
if((GPIOPinRead(GPIO_PORTK_BASE,GPIO_PIN_3)) == 1);
{
LCD_Delay(6000);
LCDCM_enWrLCDStrng("Bangalore",3,5);
}
}
please help if i have done wrong configuration..
"I have done the coding but not able to get the output" This is likely because you skipped the debugging.
To your first question. My suggestion is that despite the fact that most (see previous post) GPIO are 5v tolerant i would if given the choice use 3.3V for interfaces to the MCU. 5V tolerant is the same as 5V and can mean different things to different people and different MCU vendors. If the choice exists use the safest most native to the MCU option available. In this case 3.3V.
To your debugging (or lack thereof) issue...i suggest first the write is not relevant since the GPIO is an input. hook up the debugger and see what the code is doing. Is the if statement ever reading true, then debug the LCD functions if the if statement is always false dig in to the GPIO registers and find out why the GPIO is not behavior as you wish.
Along with, "Debugging AWOL" we have a, "Truth in Advertising" issue too - have we not?
"Switch interface with tm4c123h5qc" was poster's title - that's well detailed & answered (by Dexter).
We now vector off to an (endless) stream of disjointed, add-on issues - of only the slightest (if that) relation to the posted subject. Is this good? Proper? How ever will each/every "follow on" poster find their "Lcd issue" with a subject/title so, "Off topic?"
And - will not the "forum search organizers" have to expend (needless) extra efforts (if they can even catch this) to properly classify this meandering post?
Tacit encouragement is not the way to correct... Rules/Regulations - Templates - or run-amuck postings - there is a choice!