- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Im extremely new to the infineon product line.
i recently ordered the 1100 boot kit board, and ive been playing with the online simulator.
i cant seem to get the simulator to turn on a simple output using the GPIO.h functions. i even used the examples provided with the DAVE 4 program but i cant seem to find any support documents to see where im going wrong.
i initialized the pin by the following
P0_5_set_mode(OUTPUT_OD_GP);
and tried to turn on the output as follows
P0_5_set();
P0_5_reset();
P0_5_toggle();
none of these give me an open drain output. can someone post a code example or explain what i may be doing wrong? also, if anyone could help define all of the GPIO functions like read();, reset();, etc. i would greatly appreciate it.
Solved! Go to Solution.
- Labels:
-
XMC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @atvmainiac,
I believe you are trying to program the example codes present on the XMC1100 Boot Kit homepage.
Blinky Example with Apps uses DAVE APPS in the project. The configurable parameters are set in the APP GUI. For example, for a DIGITAL_IO APP, the configurator looks as shown in the picture below. You may open this by double-clicking on the APP.
Open-drain mode can drive only low voltage. An external pull-up resistor is required to drive high voltage. If you want to use open-drain mode, make sure you have an external pull-up resistor. Else you may use push pull mode, which is capable of driving both low and high voltages. You may find these information in the APP Help (Right click on the APP -> App Help. Information regarding the configurable parameters may be found in the "App Configuration Parameters"].
Using APIs in Blinky Example and Blinky Example with Apps: You may find these functions in xmc_gpio.h
- Initialising GPIO: void XMC_GPIO_Init(XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_CONFIG_t *const config)
- Toggling GPIO: __STATIC_INLINE void XMC_GPIO_ToggleOutput(XMC_GPIO_PORT_t *const port, const uint8_t pin)
- Setting GPIO: __STATIC_INLINE void XMC_GPIO_SetOutputHigh(XMC_GPIO_PORT_t *const port, const uint8_t pin)
- Resetting GPIO: __STATIC_INLINE void XMC_GPIO_SetOutputLow(XMC_GPIO_PORT_t *const port, const uint8_t pin)
- Setting output mode: void XMC_GPIO_SetMode(XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_MODE_t mode)
You may set the mode to push pull by using the macro XMC_GPIO_MODE_OUTPUT_PUSH_PULL and open drain by using XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN. This can be set during initialization or you may use XMC_GPIO_SetMode function. Refer to the below code snippets:
#define LED1 P0_5
XMC_GPIO_CONFIG_t gpio_output_config =
{
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL,
.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH,
};
XMC_GPIO_Init(LED1, &gpio_output_config);
or
#define LED1 P0_5
XMC_GPIO_SetMode(LED1, XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
Refer to Blinky Example and Blinky Example with Apps code examples for detailed implementation.
Regards,
Nikhil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @atvmainiac,
I believe you are trying to program the example codes present on the XMC1100 Boot Kit homepage.
Blinky Example with Apps uses DAVE APPS in the project. The configurable parameters are set in the APP GUI. For example, for a DIGITAL_IO APP, the configurator looks as shown in the picture below. You may open this by double-clicking on the APP.
Open-drain mode can drive only low voltage. An external pull-up resistor is required to drive high voltage. If you want to use open-drain mode, make sure you have an external pull-up resistor. Else you may use push pull mode, which is capable of driving both low and high voltages. You may find these information in the APP Help (Right click on the APP -> App Help. Information regarding the configurable parameters may be found in the "App Configuration Parameters"].
Using APIs in Blinky Example and Blinky Example with Apps: You may find these functions in xmc_gpio.h
- Initialising GPIO: void XMC_GPIO_Init(XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_CONFIG_t *const config)
- Toggling GPIO: __STATIC_INLINE void XMC_GPIO_ToggleOutput(XMC_GPIO_PORT_t *const port, const uint8_t pin)
- Setting GPIO: __STATIC_INLINE void XMC_GPIO_SetOutputHigh(XMC_GPIO_PORT_t *const port, const uint8_t pin)
- Resetting GPIO: __STATIC_INLINE void XMC_GPIO_SetOutputLow(XMC_GPIO_PORT_t *const port, const uint8_t pin)
- Setting output mode: void XMC_GPIO_SetMode(XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_MODE_t mode)
You may set the mode to push pull by using the macro XMC_GPIO_MODE_OUTPUT_PUSH_PULL and open drain by using XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN. This can be set during initialization or you may use XMC_GPIO_SetMode function. Refer to the below code snippets:
#define LED1 P0_5
XMC_GPIO_CONFIG_t gpio_output_config =
{
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL,
.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH,
};
XMC_GPIO_Init(LED1, &gpio_output_config);
or
#define LED1 P0_5
XMC_GPIO_SetMode(LED1, XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
Refer to Blinky Example and Blinky Example with Apps code examples for detailed implementation.
Regards,
Nikhil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, i knew i had something wrong. the way you explained this makes much more sense inline with other IDEs and MCUs ive used in the past. much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After further review of the help link, i realized my understanding of open drain was completely off. i i had the anode of the LED tied to %V, and cathode to the pin, uswing the pin as my gnd refernce. i did not realize that i had it backwards, and my logic was that the MCU provided my path to ground. i realize now that this is not quite the case. to clarify, the xmc1100 does have an internal oull up, but its not big enough to drive a higher load. correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @atvmainiac,
A pin has both pull-up and pull-down devices. You may see that in Figure 18-1 in XMC1100 Reference Manual. So, based on the mode chosen (open drain or push-pull), pull-down and/or pull-up devices will be operational.
Regarding load:
Refer to table 3.2.1 Input/Output Characteristics in XMC1100 Data Sheet. This table summarises all the parameter values defined for operating conditions. In XMC1100, Port 1 pins support high current driving capability.
The maximum current per pin or maximum current per high current pins define the maximum current driving capability of that respective pin. Any load which is attempted to be driven directly from the MCU pin should be in compliance with these values.
Regards,
Nikhil