Jul 27, 2018
01:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 27, 2018
01:08 AM
Hello
I tried to get the UART working on Pins P0.6 / P0.7 but with no success. Same code is working for USIC0.C0 on Pins P2.0 /P2.6.
I think, the hardware of the board but nothing happens on output pin P0.6.
According to the datasheet, the initialization steps should be ok, but it seems there is something missing...
Best regards and thank you for your hints
Geri
I tried to get the UART working on Pins P0.6 / P0.7 but with no success. Same code is working for USIC0.C0 on Pins P2.0 /P2.6.
I think, the hardware of the board but nothing happens on output pin P0.6.
According to the datasheet, the initialization steps should be ok, but it seems there is something missing...
Best regards and thank you for your hints
Geri
void InitUartC0C1(void)
{
#define UART_RX P0_7
#define UART_TX P0_6
/* UART configuration */
const XMC_UART_CH_CONFIG_t uart_config = {
.baudrate = 115200,
.data_bits = 8U,
.parity_mode = XMC_USIC_CH_PARITY_MODE_NONE,
.stop_bits = 1U
};
XMC_UART_CH_Init(XMC_UART0_CH1, &uart_config);
XMC_UART_CH_SetInputSource(XMC_UART0_CH1,
XMC_UART_CH_INPUT_RXD,USIC0_C1_DX1_P0_7);
/* Start UART channel */
XMC_UART_CH_Start(XMC_UART0_CH1);
/* GPIO configuration */
const XMC_GPIO_CONFIG_t rx_conf = {
.mode = XMC_GPIO_MODE_INPUT_TRISTATE,
.input_hysteresis = XMC_GPIO_INPUT_HYSTERESIS_STANDARD
};
const XMC_GPIO_CONFIG_t tx_conf = {
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT7,
.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH
};
/* Configure GPIO, */
XMC_GPIO_Init(UART_TX,&tx_conf); /* UART TX */
XMC_GPIO_Init(UART_RX,&rx_conf); /* UART RX */
}
void main(void)
{
InitUartC0C1();
while(1)
{
XMC_UART_CH_Transmit(XMC_UART0_CH1, 0x12);
}
}
- Tags:
- IFX
2 Replies
Jul 27, 2018
08:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 27, 2018
08:29 AM
Hi,
I cannot see anything wrong in your program.
Actually I tested with a XMC1100 Bootkit and it is working fine, i.e. activity is seen in the LED connected to P0.6.
Regards,
Jesus
I cannot see anything wrong in your program.
Actually I tested with a XMC1100 Bootkit and it is working fine, i.e. activity is seen in the LED connected to P0.6.
Regards,
Jesus
Jul 27, 2018
02:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 27, 2018
02:40 PM
Hello Jesus
Thank you for your feedback! I tested with my Oscilloscope on two boards. Really strange. Will perform some further tests.
Best regards and thanks again
Geri
Thank you for your feedback! I tested with my Oscilloscope on two boards. Really strange. Will perform some further tests.
Best regards and thanks again
Geri