XMC™ Forum Discussions
Hello,
I've a MTB project on PSoC6 (CYCPROTO-062-4343W) ported to the XMC7200 (XMC72_EVK), where the MCU uses an UART to communicate with a modem. The project employs FreeRTOS and has a UART IRQ (with interrupt priority value 6), where it sets a semaphore on receiving data. The code runs fine on PSoC6 but not on XMC7200. The reason being: it is not possible to set the interrupt priority on the XMC7200 using the API:
void cyhal_uart_enable_event(cyhal_uart_t *obj, cyhal_uart_event_t event, uint8_t intr_priority, bool enable);
As the priority remained at the default value 0, trying to set the semaphore in the IRQ will cause an assertion in FreeRTOS Source/portable/COMPONENT_CM7_TOOLCHAIN_GCC_ARM/port.c line 775
configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );
I have attached a sample project that can be used to reproduce the error. The project can also be built for PSoC6.
Thanks!
Show LessI'm trying to interface Ethernet on my XMC4500 device.
I'm unable to find Ethernet Peripheral in Modus Toolbox Configurator.
I couldn't find the Ethernet Peripheral option in both XMC4500 Relax Kit BSP and custom BSP that I'd created for XMC4500 device.
Show Less
Hi,
I have some questions in AP32302 example code. DSD_XMC_Lib_Resolver is one project in AP32302. According to the program description, it can run on the board of KIT_ XMC44_ AE3_ 001.
In the initialize program, P1_9 is clock out:
XMC_GPIO_Init(XMC_GPIO_PORT1,9, &dsd_clk_out);
But in the schematic diagram of MOT_GPDLV-V2:
Now according to the circuit schematic diagram P1_9 is connected to CLKOUT of ADS1205, is that right?(Clock generated on both sides)
DSD_XMC_Lib_Resolver can run on the board of KIT_ XMC44_ AE3_ 001 really?
Show LessHi,
I´m trying to get the EMUX running on a XMC4300 Relax Board.
When starting the firmware, the EMUX pins gets configured / switched high / low depending on the first channel I select. But afterwards nothing happens any more on this pins 😞
Any idea what could be wrong?
Achim
Show LessHello community,
I am using XMC 2Go Kit and I set the XMC1100 UART as TX and RX on pins 2.1 and 2.2. If I use the XMC4200 as VCOM port, I can send from my terminal DATA (I see with oscilloscope) but I can not send data in the other direction (from XMC1100 P2.1-> XMC4200). Measuring with OSci, the pin P2.1 is pulled high from external (I assume xcm4200 is doing it and it appears stuck high).
If I set another pin as transmitter (for example P0.14), it works.
Could you please support me?
MY code to use UART:
-----------------------------------------------------------------------------------
void UART_config_P2_1_P2_2(void) {
XMC_UART_CH_Init(XMC_UART0_CH0, &uart_config); // UART0, channel 0
XMC_UART_CH_EnableMasterClock(XMC_UART0_CH0);
XMC_UART_CH_Start(XMC_UART0_CH0);
XMC_UART_CH_SetInputSource(XMC_UART0_CH0, XMC_UART_CH_INPUT_RXD, USIC0_C0_DX0_DX3INS); // P2.2 input RXD USIC0_C0_DX3_P2_2
//XMC_GPIO_Init(P2_2, &uart_rx); // XMC_GPIO_MODE_INPUT_TRISTATE
//XMC_GPIO_Init(P2_1, &uart_tx); // XMC_GPIO_MODE_OUTPUT_ALT6
XMC_GPIO_SetMode(P2_2, XMC_GPIO_MODE_INPUT_TRISTATE); // XMC_GPIO_MODE_INPUT_TRISTATE
XMC_GPIO_SetMode(P2_1, XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT6 ); // XMC_GPIO_MODE_OUTPUT_ALT6
while(1) {
XMC_UART_CH_Transmit(XMC_UART0_CH0, 0xFFFF);
while (!(XMC_UART_CH_GetStatusFlag(XMC_UART0_CH0) & XMC_UART_CH_STATUS_FLAG_TRANSMITTER_FRAME_FINISHED));
}
}
-----------------------------------------------------------------------------------
Show LessI referred to the following post : Modustoolbox vs. DAVE to come to conclusion that new projects are recommended to be developed on Modus Toolbox instead of Dave.
I'm trying to create a generic project for XMC4000 series micro-controller in Modus Toolbox for my custom board but I'm unable to figure out how.
I can only see project for different development/evaluation board.
Is their a problem in my Modus Toolbox installation?
Show Less
Hey Everyone,
I have an application where I need to configure UART (P1.5 & P1.6) and I2C (P0.8 & P2.1) using same USIC Channel 0 on XMC1302. I know there are 2 channel available but one USIC channel is dedicated for another use in the application. At some points in the application I need to talk to peripherals over UART and others over I2C. This Swap depends on the use input for eg. Input Signal High and/or Low
Goes High:
When signal goes High send some bytes of data over the UART TX and wait till I get the ACK (ASC RX Interrupt) and the swap to the I2C communication. This has to happen fast and effectively.
High:
After swapping to the I2C will have to communicate till the signal stays high.
Low:
When the signal goes low, immediately required to stop the I2C and swap to the UART and do TX-RX.
I have Initialize and reinitialize the UART and I2C where required but it seems to be some configuration mismatch that I am reading incorrect data. That is how I am doing the swapping:
Switch to UART
NVIC_DisableIRQ(USIC0_0_IRQn); // Disable the Interrupt for Ch0
NVIC_ClearPendingIRQ(USIC0_0_IRQn); // Clear the Interrupt for Ch0
// De-Initializing the I2C Registers
CH_I2C->KSCFG = 0x00000000UL;
CH_I2C->FDR = 0x00000000UL;
CH_I2C->BRG = 0x00000000UL;
CH_I2C->SCTR = 0x00000000UL;
CH_I2C->TCSR = 0x00000000UL;
CH_I2C->CCR = 0x00000000UL;
CH_I2C->PCR = 0x00000000UL;
// Re-Initializing for UART
//Kernel State Configuration Register - Module Disable + Bit Protection for MODEN
CH_UART->KSCFG |= (1U << USIC_CH_KSCFG_MODEN_Pos) |
(1U << USIC_CH_KSCFG_BPMODEN_Pos);
CH_UART->FDR = 2U << USIC_CH_FDR_DM_Pos;
CH_UART->FDR = (811U << USIC_CH_FDR_STEP_Pos);
CH_UART->BRG = (4U << USIC_CH_BRG_PDIV_Pos) |
(0U << USIC_CH_BRG_PCTQ_Pos)|
(10U << USIC_CH_BRG_DCTQ_Pos);
CH_UART->SCTR = (1U << USIC_CH_SCTR_PDL_Pos) |
(1U << USIC_CH_SCTR_TRM_Pos) |
(7U << USIC_CH_SCTR_FLE_Pos) |
(7U << USIC_CH_SCTR_WLE_Pos);
CH_UART->TCSR = (1U << USIC_CH_TCSR_TDEN_Pos) |
(1U << USIC_CH_TCSR_TDSSM_Pos);
CH_UART->PCR_ASCMode = (1U << USIC_CH_PCR_ASCMode_SMD_Pos) |
(0U << USIC_CH_PCR_ASCMode_STPB_Pos) |
(6U << USIC_CH_PCR_ASCMode_SP_Pos) |
(1U << USIC_CH_PCR_ASCMode_TSTEN_Pos) |
(0U << USIC_CH_PCR_ASCMode_RSTEN_Pos);
CH_UART->TBCTR = (1U << USIC_CH_TBCTR_LIMIT_Pos);
CH_UART->RBCTR = (1U << USIC_CH_RBCTR_LIMIT_Pos) |
(1U << USIC_CH_RBCTR_SIZE_Pos) |
(1U << USIC_CH_RBCTR_LOF_Pos) |
(1U << USIC_CH_RBCTR_RNM_Pos) |
(3U << USIC_CH_RBCTR_RCIM_Pos);
CH_UART->CCR = (2U << USIC_CH_CCR_MODE_Pos) |
(0U << USIC_CH_CCR_TSIEN_Pos) |
(1U << USIC_CH_CCR_RIEN_Pos);
CH_UART->INPR = (0U << USIC_CH_INPR_RINP_Pos);
NVIC_EnableIRQ(USIC0_0_IRQn);
Switch to I2C
NVIC_DisableIRQ(USIC0_0_IRQn); // Disable the Interrupt for Ch0
NVIC_ClearPendingIRQ(USIC0_0_IRQn); // Clear the Interrupt for Ch0
// De-Initializing the UART Registers
CH_UART->KSCFG = 0x00000000UL;
CH_UART->FDR = 0x00000000UL;
CH_UART->SCTR = 0x00000000UL;
CH_UART->TCSR = 0x00000000UL;
CH_UART->CCR = 0x00000000UL;
CH_UART->PCR_ASCMode = 0x00000000UL;
CH_UART->TBCTR = 0x00000000UL;
CH_UART->RBCTR = 0x00000000UL;
CH_UART->INPR = 0x00000000UL;
//Re-Initializing for I2C
//Kernel State Configuration Register - Module Enable + Bit Protection for MODEN
CH_I2C->KSCFG |= (1U << USIC_CH_KSCFG_MODEN_Pos) |
(1U << USIC_CH_KSCFG_BPMODEN_Pos);
CH_I2C->FDR = (2U << USIC_CH_FDR_DM_Pos) |
(320U << USIC_CH_FDR_STEP_Pos);
CH_I2C->BRG = (0U << USIC_CH_BRG_PDIV_Pos) |
(0U << USIC_CH_BRG_PCTQ_Pos)|
(24U << USIC_CH_BRG_DCTQ_Pos);
CH_I2C->SCTR = (1U << USIC_CH_SCTR_PDL_Pos) |
(1U << USIC_CH_SCTR_TRM_Pos) |
(1U << USIC_CH_SCTR_SDIR_Pos) |
(63U << USIC_CH_SCTR_FLE_Pos) |
(7U << USIC_CH_SCTR_WLE_Pos);
CH_I2C->TCSR = (1U << USIC_CH_TCSR_TDEN_Pos) |
(1U << USIC_CH_TCSR_TDSSM_Pos);
//Configuration of Protocol Control Register
CH_I2C->PCR_IICMode = (1U << USIC_CH_PCR_IICMode_STIM_Pos);
//Configuration of Channel Control Register
CH_I2C->CCR = (4U << USIC_CH_CCR_MODE_Pos);
Any suggestions and help would be appreciated. Thanks.
Show Lesswe want to test , what is the difference in performance in using single and dual core of m7 only(cm7_0 and cm7_1), we have xmc 7200 evaluation kit, kindly give code to test it . and how to shut one core (cm7_0) and run code on other
thanks
Show Less
I'm in the process of porting the BLDC_HALL code for XMC13 to our custom XMC1404 board.
Till now I have changed the IRQ_type in XMC1400.h and CCU8 peripheral setting: in compare match setting changed invert_out0,1,2 etc to selector_out0.
I tried to compile the code and it is compiling without issue. Has anyone attempted to port the BLDC code to XMC14?
Also why is XMC1400 not fully supported by infineon. In DAVE apps POSIF section is completely missing. Show Less