XMC™ Forum Discussions
Sort by:
XMC™
Hi all,Is it at all possible to combine multiple gating or trigger signals for a given ADC request source? In other words, is it possible to configure...
Show More
Hi all,
Is it at all possible to combine multiple gating or trigger signals for a given ADC request source? In other words, is it possible to configure, for instance, a queue source, such that triggers A and B can both activate it? Thank you in advance.
Best regards,
Andrey Show Less
Is it at all possible to combine multiple gating or trigger signals for a given ADC request source? In other words, is it possible to configure, for instance, a queue source, such that triggers A and B can both activate it? Thank you in advance.
Best regards,
Andrey Show Less
XMC™
Hello ,I have problems with the VCOM Interface . We use an XMC4200 Controller and send data all the time to the host PC . It serves well.If the user c...
Show More
Hello ,
I have problems with the VCOM Interface . We use an XMC4200 Controller and send data all the time to the host PC . It serves well.
If the user cut the USB- cable , the USBD_VCOM_SendData App hang's . In the moment we use the watchdog timer in this case, but that's not a good solution.
The programm details :
if (USBD_VCOM_Connect() == USBD_VCOM_STATUS_SUCCESS)
{
if (USBD_VCOM_IsEnumDone()!= 0)
{
memcpy(send_ram, lcd_ram, 81); // Load contents to send
USBD_VCOM_SendData((const int8_t *)&send_ram[0], 81);
}
}
is there a better way to end the program , if cabel is disconnect while data is send ?
thank you in advance Show Less
I have problems with the VCOM Interface . We use an XMC4200 Controller and send data all the time to the host PC . It serves well.
If the user cut the USB- cable , the USBD_VCOM_SendData App hang's . In the moment we use the watchdog timer in this case, but that's not a good solution.
The programm details :
if (USBD_VCOM_Connect() == USBD_VCOM_STATUS_SUCCESS)
{
if (USBD_VCOM_IsEnumDone()!= 0)
{
memcpy(send_ram, lcd_ram, 81); // Load contents to send
USBD_VCOM_SendData((const int8_t *)&send_ram[0], 81);
}
}
is there a better way to end the program , if cabel is disconnect while data is send ?
thank you in advance Show Less
XMC™
Hello,I tried to get a SPI communication and I found this excampler here.But there is no "Chip-Select" Signal at P0.9.Thank you for any help!Berndvoid...
Show More
Hello,
I tried to get a SPI communication and I found this excampler here.
But there is no "Chip-Select" Signal at P0.9.
Thank you for any help!
Bernd
void initSPI(void) {
/* SPI Master initialization */
uint32_t spiFdrStep = 0, spiFsclk = 500000;//500000;
uint8_t spiBrgPdiv = 0;
/* if PPPEN = 0
* fsclk = fsys x STEP/1024 x 1/2 x 1/PDIV+1
*
* if PPPEN = 1
* fsclk = fsys x 1/2 x STEP/1024 x 1/2 x 1/PDIV+1
*/
/* Calculate settings for desired fsclk, PPPEN = 1 */
while(1) {
spiFdrStep = (spiFsclk * 1024 * 2 * 2 * (spiBrgPdiv+1)) / SystemCoreClock;
if(!((0 <= spiFdrStep) && (spiFdrStep < 1024))) {
spiBrgPdiv++;
} else {
break;
}
}
/* Disable clock gating to USIC0 */
SCU_GENERAL->PASSWD = 0x000000C0UL; /* disable bit protection */
SCU_CLK->CGATCLR0 |= SCU_CLK_CGATCLR0_USIC0_Msk;
SCU_GENERAL->PASSWD = 0x000000C3UL; /* enable bit protection */
// Enable the module kernel clock and the module functionality
USIC0_CH0->KSCFG |= (1ul << USIC_CH_KSCFG_MODEN_Pos) | (1ul << USIC_CH_KSCFG_BPMODEN_Pos);
// Configuration of Channel Control Register, set USIC to SSC.SPI
USIC0_CH0->CCR |= (SPI_MODE << USIC_CH_CCR_MODE_Pos);
// Configure Fractional Divider Register
USIC0_CH0->FDR |= (spiFdrStep << USIC_CH_FDR_STEP_Pos) | (NORMAL_DIVIDER_MODE << USIC_CH_FDR_DM_Pos);
// Configure Baud Rate Generator Register */
USIC0_CH0->BRG |= (1ul << USIC_CH_BRG_PPPEN_Pos)
| (spiBrgPdiv << USIC_CH_BRG_PDIV_Pos)
| (0ul << USIC_CH_BRG_PCTQ_Pos)
| (9ul << USIC_CH_BRG_DCTQ_Pos);
USIC0_CH0->PCR_SSCMode |= (1ul << USIC_CH_PCR_SSCMode_MSLSEN_Pos) // Enables/disables the generation of the master slave select signal
| (1ul << USIC_CH_PCR_SSCMode_SELINV_Pos) // Active low for CS
| (1ul << USIC_CH_PCR_SSCMode_SELCTR_Pos) // Direct select
| (PORT0_9 << USIC_CH_PCR_SSCMode_SELO_Pos)// Activate SELO0
| (1ul << USIC_CH_PCR_SSCMode_MCLK_Pos); // Master Clock Enable
// Configure Shift Control Register
USIC0_CH0->SCTR |= (1ul << USIC_CH_SCTR_SDIR_Pos) // Shift out MSB first
| (0ul << USIC_CH_SCTR_DSM_Pos) // Data Shift Mode
| (SPI_MODE << USIC_CH_SCTR_TRM_Pos) // Transmission Mode
| (7ul << USIC_CH_SCTR_FLE_Pos) // Frame Length
| (7ul << USIC_CH_SCTR_WLE_Pos); // Word Length
// Configure Transmission Control Status
USIC0_CH0->TCSR |= (0ul << USIC_CH_TCSR_FLEMD_Pos) // FLE Mode
| (0ul << USIC_CH_TCSR_WLEMD_Pos) // WLE Mode
| (0ul << USIC_CH_TCSR_SELMD_Pos) // Select Mode
| (0ul << USIC_CH_TCSR_SOF_Pos) // Start Of Frame
| (0ul << USIC_CH_TCSR_EOF_Pos) // End Of Frame
| (0ul << USIC_CH_TCSR_TDV_Pos) // Transmit Data Valid
| (1ul << USIC_CH_TCSR_TDSSM_Pos) // TBUF Data Single Shot Mode
| (1ul << USIC_CH_TCSR_TDEN_Pos); // TBUF Data Enable
USIC0_CH0->TBCTR &= ~(USIC_CH_TBCTR_SIZE_Msk | USIC_CH_TBCTR_DPTR_Msk);
USIC0_CH0->TBCTR |= ((0x05 << USIC_CH_TBCTR_SIZE_Pos)|(0x00 << USIC_CH_TBCTR_DPTR_Pos));
// Set P0.15 as Input, MISO
P0_15_set_mode(INPUT);
//Select DX0B
USIC0_CH0->DX0CR |= (1ul << USIC_CH_DX0CR_DSEL_Pos) | (1ul << USIC_CH_DX0CR_INSW_Pos);
// Set P0.14 as Onput, MOSI
P0_14_set_mode(OUTPUT_PP_AF6);
// Set P0.7 as Output, SCLK
P0_7_set_mode(OUTPUT_PP_AF6);
// Set P0.9 as Output, SELECT
P0_9_set_mode(OUTPUT_PP_AF6);
} Show Less
I tried to get a SPI communication and I found this excampler here.
But there is no "Chip-Select" Signal at P0.9.
Thank you for any help!
Bernd
void initSPI(void) {
/* SPI Master initialization */
uint32_t spiFdrStep = 0, spiFsclk = 500000;//500000;
uint8_t spiBrgPdiv = 0;
/* if PPPEN = 0
* fsclk = fsys x STEP/1024 x 1/2 x 1/PDIV+1
*
* if PPPEN = 1
* fsclk = fsys x 1/2 x STEP/1024 x 1/2 x 1/PDIV+1
*/
/* Calculate settings for desired fsclk, PPPEN = 1 */
while(1) {
spiFdrStep = (spiFsclk * 1024 * 2 * 2 * (spiBrgPdiv+1)) / SystemCoreClock;
if(!((0 <= spiFdrStep) && (spiFdrStep < 1024))) {
spiBrgPdiv++;
} else {
break;
}
}
/* Disable clock gating to USIC0 */
SCU_GENERAL->PASSWD = 0x000000C0UL; /* disable bit protection */
SCU_CLK->CGATCLR0 |= SCU_CLK_CGATCLR0_USIC0_Msk;
SCU_GENERAL->PASSWD = 0x000000C3UL; /* enable bit protection */
// Enable the module kernel clock and the module functionality
USIC0_CH0->KSCFG |= (1ul << USIC_CH_KSCFG_MODEN_Pos) | (1ul << USIC_CH_KSCFG_BPMODEN_Pos);
// Configuration of Channel Control Register, set USIC to SSC.SPI
USIC0_CH0->CCR |= (SPI_MODE << USIC_CH_CCR_MODE_Pos);
// Configure Fractional Divider Register
USIC0_CH0->FDR |= (spiFdrStep << USIC_CH_FDR_STEP_Pos) | (NORMAL_DIVIDER_MODE << USIC_CH_FDR_DM_Pos);
// Configure Baud Rate Generator Register */
USIC0_CH0->BRG |= (1ul << USIC_CH_BRG_PPPEN_Pos)
| (spiBrgPdiv << USIC_CH_BRG_PDIV_Pos)
| (0ul << USIC_CH_BRG_PCTQ_Pos)
| (9ul << USIC_CH_BRG_DCTQ_Pos);
USIC0_CH0->PCR_SSCMode |= (1ul << USIC_CH_PCR_SSCMode_MSLSEN_Pos) // Enables/disables the generation of the master slave select signal
| (1ul << USIC_CH_PCR_SSCMode_SELINV_Pos) // Active low for CS
| (1ul << USIC_CH_PCR_SSCMode_SELCTR_Pos) // Direct select
| (PORT0_9 << USIC_CH_PCR_SSCMode_SELO_Pos)// Activate SELO0
| (1ul << USIC_CH_PCR_SSCMode_MCLK_Pos); // Master Clock Enable
// Configure Shift Control Register
USIC0_CH0->SCTR |= (1ul << USIC_CH_SCTR_SDIR_Pos) // Shift out MSB first
| (0ul << USIC_CH_SCTR_DSM_Pos) // Data Shift Mode
| (SPI_MODE << USIC_CH_SCTR_TRM_Pos) // Transmission Mode
| (7ul << USIC_CH_SCTR_FLE_Pos) // Frame Length
| (7ul << USIC_CH_SCTR_WLE_Pos); // Word Length
// Configure Transmission Control Status
USIC0_CH0->TCSR |= (0ul << USIC_CH_TCSR_FLEMD_Pos) // FLE Mode
| (0ul << USIC_CH_TCSR_WLEMD_Pos) // WLE Mode
| (0ul << USIC_CH_TCSR_SELMD_Pos) // Select Mode
| (0ul << USIC_CH_TCSR_SOF_Pos) // Start Of Frame
| (0ul << USIC_CH_TCSR_EOF_Pos) // End Of Frame
| (0ul << USIC_CH_TCSR_TDV_Pos) // Transmit Data Valid
| (1ul << USIC_CH_TCSR_TDSSM_Pos) // TBUF Data Single Shot Mode
| (1ul << USIC_CH_TCSR_TDEN_Pos); // TBUF Data Enable
USIC0_CH0->TBCTR &= ~(USIC_CH_TBCTR_SIZE_Msk | USIC_CH_TBCTR_DPTR_Msk);
USIC0_CH0->TBCTR |= ((0x05 << USIC_CH_TBCTR_SIZE_Pos)|(0x00 << USIC_CH_TBCTR_DPTR_Pos));
// Set P0.15 as Input, MISO
P0_15_set_mode(INPUT);
//Select DX0B
USIC0_CH0->DX0CR |= (1ul << USIC_CH_DX0CR_DSEL_Pos) | (1ul << USIC_CH_DX0CR_INSW_Pos);
// Set P0.14 as Onput, MOSI
P0_14_set_mode(OUTPUT_PP_AF6);
// Set P0.7 as Output, SCLK
P0_7_set_mode(OUTPUT_PP_AF6);
// Set P0.9 as Output, SELECT
P0_9_set_mode(OUTPUT_PP_AF6);
} Show Less
XMC™
I've configured GPDMA to transfer data from memory to the Transmit Buffer (TBUF) register in USIC.USIC.CCR.TBIEN is set to 1 and USIC.INPR.TBINP is se...
Show More
I've configured GPDMA to transfer data from memory to the Transmit Buffer (TBUF) register in USIC.
USIC.CCR.TBIEN is set to 1 and USIC.INPR.TBINP is set to 1 as to generate service request 1 to DMA when TBUF is empty.
USIC is configured for SPI master operation. The Receive Buffer (RBUF) is read by software while not empty.
Unfortunately, no DMA transaction occurs unless I trigger one by writing to USIC.FMR.SIO1. If repeatedly triggered for each word in this way, all data is transferred to TBUF correctly.
Why doesn't the USIC trigger the DMA request on its own once TBUF is empty? Show Less
USIC.CCR.TBIEN is set to 1 and USIC.INPR.TBINP is set to 1 as to generate service request 1 to DMA when TBUF is empty.
USIC is configured for SPI master operation. The Receive Buffer (RBUF) is read by software while not empty.
Unfortunately, no DMA transaction occurs unless I trigger one by writing to USIC.FMR.SIO1. If repeatedly triggered for each word in this way, all data is transferred to TBUF correctly.
Why doesn't the USIC trigger the DMA request on its own once TBUF is empty? Show Less
XMC™
Hello,does anybody know whether there are plans to release an XMC4700 kit with external RAM on board like the XMC4500 hexagon kits?I know the XMC4700 ...
Show More
Hello,
does anybody know whether there are plans to release an XMC4700 kit with external RAM on board like the XMC4500 hexagon kits?
I know the XMC4700 already comes with more internal RAM and flash memory, but 352 KB RAM are still limiting for some applications.
Regards, Leo Show Less
does anybody know whether there are plans to release an XMC4700 kit with external RAM on board like the XMC4500 hexagon kits?
I know the XMC4700 already comes with more internal RAM and flash memory, but 352 KB RAM are still limiting for some applications.
Regards, Leo Show Less
XMC™
Hi all,as far as I see, there is no way to1. Detect whether a conversion is running.2. Abort a running conversion.Did I miss anything or is this true?...
Show More
Hi all,
as far as I see, there is no way to
1. Detect whether a conversion is running.
2. Abort a running conversion.
Did I miss anything or is this true?
If the latter: That's bad, because if you are not sure whether a conversion is running, you have to do a timed wait for longer than one conversion would take. Show Less
as far as I see, there is no way to
1. Detect whether a conversion is running.
2. Abort a running conversion.
Did I miss anything or is this true?
If the latter: That's bad, because if you are not sure whether a conversion is running, you have to do a timed wait for longer than one conversion would take. Show Less
XMC™
Hello to all,I'm using 4500 relax kit lite and I want to implement a low power mode and chose deep sleep. During which I disable PLL and VCO and then ...
Show More
Hello to all,
I'm using 4500 relax kit lite and I want to implement a low power mode and chose deep sleep. During which I disable PLL and VCO and then when it's powered back on I use this to reactivate them but they won't, what am I doing wrong?
SCU_PLL->PLLCON0&=0x1111111D;
SCU_PLL->PLLCON0&=0x111E1111;
Thanks,
Ahmed Show Less
I'm using 4500 relax kit lite and I want to implement a low power mode and chose deep sleep. During which I disable PLL and VCO and then when it's powered back on I use this to reactivate them but they won't, what am I doing wrong?
SCU_PLL->PLLCON0&=0x1111111D;
SCU_PLL->PLLCON0&=0x111E1111;
Thanks,
Ahmed Show Less
XMC™
Hi ~I have success test write a txt file in Micro SD card with non RTOS option on DAVE4But when I choose Use RTOS , Code will pending on SemStatus = ...
Show More
Hi ~
I have success test write a txt file in Micro SD card with non RTOS option on DAVE4
But when I choose Use RTOS , Code will pending on SemStatus = osMutexWait(FATFS_MutexProtectId, osWaitForever) of
res = f_mount(&fs, "0:", 1);,Did anyone have got this problem?
Case official example code is non RTOS.
Show Less
I have success test write a txt file in Micro SD card with non RTOS option on DAVE4
But when I choose Use RTOS , Code will pending on SemStatus = osMutexWait(FATFS_MutexProtectId, osWaitForever) of
res = f_mount(&fs, "0:", 1);,Did anyone have got this problem?
Case official example code is non RTOS.
XMC™
Hello,I am new to Dave and to XMC boards and I'm trying to program my XMC4500 to output a simple, square wave, with a frequency of 20kHz and a certain...
Show More
Hello,
I am new to Dave and to XMC boards and I'm trying to program my XMC4500 to output a simple, square wave, with a frequency of 20kHz and a certain duty cycle.
I might be wrong, but from what I read, I believe I can use the DACWG001 App to achieve what I want. I just can't figure out how.
Can someone help please? Show Less
I am new to Dave and to XMC boards and I'm trying to program my XMC4500 to output a simple, square wave, with a frequency of 20kHz and a certain duty cycle.
I might be wrong, but from what I read, I believe I can use the DACWG001 App to achieve what I want. I just can't figure out how.
Can someone help please? Show Less
XMC™
Hi,I am not able to run the FATFS App. I tried to generate a new project and to include this App, but I always get the same error. Can anyone help me?...
Show More
Hi,
I am not able to run the FATFS App. I tried to generate a new project and to include this App, but I always get the same error.
Can anyone help me? I need this App for my Bootloader. Show Less
I am not able to run the FATFS App. I tried to generate a new project and to include this App, but I always get the same error.
Can anyone help me? I need this App for my Bootloader. Show Less