port set/reset

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
After P1_5_reset() why LED is ON and after P1_5_set() why LED is off? On my eval board (xmc1100) in the debugger


#include

#include "XMC1100.h"
#include "GPIO.h"

int main(void)
{
P1_5_set_mode(OUTPUT_PP_GP);

P1_5_reset();

P1_5_set();

while(1);
}
0 Likes
3 Replies
Rick_Nardone
Employee
Employee
Hi jsmith65,

The GPIO pin is a low side switch, so when it is reset (0) then current flows through the LED so it is on. When the GPIO is set (1), then no current flows through the LED, so it is off. The LED schematic is shown in the XMC100 Boot Kit User' Guide.

Best,

Rick Nardone
0 Likes
Not applicable
What is the purpose of the internal pullups? (pad on the port)
0 Likes
Rick_Nardone
Employee
Employee
Hi jsmith65,

Internal pull-up resistors can be used on GPIO pins that are set as inputs. If configured, the GPIO input would be internally connected (pulled-up) to VDD through a 20KOhm - 50KOhm resistor.

The XMC MCUs also offer the option of internal pull-down resistors that can be used on GPIO pns that are configured as inputs. The pull-down resistor would internally connect the GPIO input to VSS (GND) through a 20KOhm - 50KOhm resistor.

The internal pull-up an pull-down resistors can be used to make sure a GPIO input is not floating.

You can find additional details about the XMC General Purpose I/O (GPIO) in the Reference Manual for the specific XMC Microcontroller you are working with.

Best,

Rick
0 Likes