XMC™ Forum Discussions
XMC™
Hi, I am working on ADC in XMC4100 platform.I am facing problem in starting ADC Conversion (background). LDEV (load event) bit is not getting set. I t...
Show More
Hi, I am working on ADC in XMC4100 platform.
I am facing problem in starting ADC Conversion (background). LDEV (load event) bit is not getting set. I tried setting it from debugging mode also but it's still 0 (not set). Please help. Is there any prerequisite for setting this bit ? Show Less
I am facing problem in starting ADC Conversion (background). LDEV (load event) bit is not getting set. I tried setting it from debugging mode also but it's still 0 (not set). Please help. Is there any prerequisite for setting this bit ? Show Less
XMC™
Hi, I would like to know what are the prerequisites for using the timer in Capture mode. I want to count the number of rising edges of the external pw...
Show More
Hi, I would like to know what are the prerequisites for using the timer in Capture mode. I want to count the number of rising edges of the external pwm signal using capture mode. Please help.
Show Less
XMC™
Hi, I am working on XMC1100 boot kit i am unable to Connect the Boot kit in Keili done following settings in keil v5in flash->Configure Flash Tool...
Show More
Hi,
I am working on XMC1100 boot kit i am unable to Connect the Boot kit in Keil
i done following settings in keil v5
in flash->Configure Flash Tools -> Debug Tab -> Changed J-LINK/J-TRACE Cortex in settings change the port From JTAG to SW, I am not getting IDCODE how can i fix it ?? Show Less
I am working on XMC1100 boot kit i am unable to Connect the Boot kit in Keil
i done following settings in keil v5
in flash->Configure Flash Tools -> Debug Tab -> Changed J-LINK/J-TRACE Cortex in settings change the port From JTAG to SW, I am not getting IDCODE how can i fix it ?? Show Less
XMC™
Here are the steps to reproduce my problem :1- Erase Logical Sector S22- Before the erase is finished, power-cycle the device. Flash memory in Sector ...
Show More
Here are the steps to reproduce my problem :
1- Erase Logical Sector S2
2- Before the erase is finished, power-cycle the device. Flash memory in Sector 2 is now corrupted.
3- The code won't run to Main after the power-cycle when sector 2 is corrupted.
4- To recover from this, erase logical Sector 2 using infineon MemTool
Is this a normal behaviour? It does not happen if I power-cycle while logical sector S4 is being erased. I put all my code in S8, and the interruption vector are in S0 as required.
Thanks,
Cedric Show Less
1- Erase Logical Sector S2
2- Before the erase is finished, power-cycle the device. Flash memory in Sector 2 is now corrupted.
3- The code won't run to Main after the power-cycle when sector 2 is corrupted.
4- To recover from this, erase logical Sector 2 using infineon MemTool
Is this a normal behaviour? It does not happen if I power-cycle while logical sector S4 is being erased. I put all my code in S8, and the interruption vector are in S0 as required.
Thanks,
Cedric Show Less
XMC™
Are the two units of the DMA module of XMC4500 able to transfer data concurrently?
XMC™
Hi, I am working XMC 4100 CAN module, I have created a project for CAN node 0 with pins 1.4 (TX) 1.5 (RX).It's working flawlessly, but when I con...
Show More
Hi,
I am working XMC 4100 CAN module, I have created a project for CAN node 0 with pins 1.4 (TX) 1.5 (RX).It's working flawlessly, but when I configure the NODE1 with the pins 2.7 (TX) and 2.6(RX), it's showing nothing on CRO Please help me what might be the reason for it. Show Less
I am working XMC 4100 CAN module, I have created a project for CAN node 0 with pins 1.4 (TX) 1.5 (RX).It's working flawlessly, but when I configure the NODE1 with the pins 2.7 (TX) and 2.6(RX), it's showing nothing on CRO Please help me what might be the reason for it. Show Less
XMC™
Hello, I have the following problem: I implemented a CAN Transmit FIFO containing 11 message objects static allocated to one message list in numerical...
Show More
Hello,
I have the following problem: I implemented a CAN Transmit FIFO containing 11 message objects static allocated to one message list in numerical order. The CAN Fifo is used by the XCP Protocol to transmit a set of DAQ-Messages with each event (every 1000ms, burst of x messages). When I configure the XCP to send a set of 4 messages each 1000ms everything is ok, but when I try to send 5 or more messages each 1000ms it works for about 20-30message and then I get an error (my function detects TXRQ not reset and returns FUNC_RETURN_ERROR). When I check the registers with the debugger all TXRQ bits of the message Objects are set but no message Object has the TXEN1 bit set (which should be done by Hardware after submitting the message of the previous object in the FIFO).
To update the Content of the FIFO my software uses the SEL-pointer within the MOFGPR-register of the FIFO base object (the SEL pointer is pointing to the next message object in the FIFO where the Software can put new data in). Before updating the Message object pointed to by the SEL of the base object I clear the MSGVAL bit. After setting up the new frame data I set the NEWDAT bit, reset the RTSEL bit and set the MSGVAL bit again. After that I set the TXRQ bit to enable the object for transmission when the CUR pointer of the base object is set to this object and the Hardware sets the TXEN1 bit.
Is it a problem when MSGVAL bit is reset when the Hardware moves the CUR pointer to this object and tries to set the TXEN1-Bit? Or is the problem the reset of the RTSEL bit after configuring the message object? I havent found anything for this topic within the user manual...
I paste the code of the transmit function down below. The parameter objIdx is the Index of the FIFO base object.
I have the following problem: I implemented a CAN Transmit FIFO containing 11 message objects static allocated to one message list in numerical order. The CAN Fifo is used by the XCP Protocol to transmit a set of DAQ-Messages with each event (every 1000ms, burst of x messages). When I configure the XCP to send a set of 4 messages each 1000ms everything is ok, but when I try to send 5 or more messages each 1000ms it works for about 20-30message and then I get an error (my function detects TXRQ not reset and returns FUNC_RETURN_ERROR). When I check the registers with the debugger all TXRQ bits of the message Objects are set but no message Object has the TXEN1 bit set (which should be done by Hardware after submitting the message of the previous object in the FIFO).
To update the Content of the FIFO my software uses the SEL-pointer within the MOFGPR-register of the FIFO base object (the SEL pointer is pointing to the next message object in the FIFO where the Software can put new data in). Before updating the Message object pointed to by the SEL of the base object I clear the MSGVAL bit. After setting up the new frame data I set the NEWDAT bit, reset the RTSEL bit and set the MSGVAL bit again. After that I set the TXRQ bit to enable the object for transmission when the CUR pointer of the base object is set to this object and the Hardware sets the TXEN1 bit.
Is it a problem when MSGVAL bit is reset when the Hardware moves the CUR pointer to this object and tries to set the TXEN1-Bit? Or is the problem the reset of the RTSEL bit after configuring the message object? I havent found anything for this topic within the user manual...
I paste the code of the transmit function down below. The parameter objIdx is the Index of the FIFO base object.
Show Less
/**
* @brief Update data and length of TX message object and set Transmit Request for selected message
* @note -
* @param[in] objIdx Index of the HW message object (0..63 for a XMC4500)
* @param[in] length Number of data bytes the message object contains (0..8)
* @param[in] data Pointer to data array
* @retval Status of operation: FUNC_RETURN_OK if data in message object is updated, else FUNC_RETURN_ERROR
*/
sint32_t MCAN0_UpdateMsgObjTxDataAndTransmit(uint8_t objIdx, uint8_t length, const uint8_t * data)
{
sint32_t status = FUNC_RETURN_OK;
uint32_t objIdx_intern = objIdx;
CAN_MO_TypeDef * msgObj = (CAN_MO_TypeDef *)CAN_MO0_BASE;
// *** Check parameter ***
// Check objIdx
if ( objIdx_intern >= MCAN0_MSG_OBJ_CNT )
{
status = FUNC_RETURN_ERROR;
}
else if ( length > 8 )
{
status = FUNC_RETURN_ERROR;
}
else
{ // Parameter ok..
if ( (msgObj[objIdx_intern].MOSTAT & CAN_MO_MOSTAT_DIR_Msk) != 0 )
{
// DIR Bit in MOSTAT is set -> transmit message object
if ( (msgObj[objIdx_intern].MOFCR & CAN_MO_MOFCR_MMC_Msk) != 0 )
{
// Fifo or Gateway Source...
if ( (msgObj[objIdx_intern].MOFCR & CAN_MO_MOFCR_MMC_Msk) == (((uint32_t)2<{
// Transmit Fifo Base Object
uint32_t next, sel, top, bot;
sel = (msgObj[objIdx_intern].MOFGPR & CAN_MO_MOFGPR_SEL_Msk) >> CAN_MO_MOFGPR_SEL_Pos;
top = (msgObj[objIdx_intern].MOFGPR & CAN_MO_MOFGPR_TOP_Msk) >> CAN_MO_MOFGPR_TOP_Pos;
bot = (msgObj[objIdx_intern].MOFGPR & CAN_MO_MOFGPR_BOT_Msk) >> CAN_MO_MOFGPR_BOT_Pos;
if ( sel == top )
{
next = bot;
}
else
{
next = sel+1U; // TODO: msg-objects could be out of order in case of dynamic list linking!
}
if ( (msgObj[sel].MOSTAT & CAN_MO_MOSTAT_TXRQ_Msk) != 0 )
{
// Message object is busy TODO
status = FUNC_RETURN_ERROR;
}
else
{
uint8_t i;
uint32_t tmp;
msgObj[objIdx_intern].MOFGPR &= ~(uint32_t)CAN_MO_MOFGPR_SEL_Msk;
msgObj[objIdx_intern].MOFGPR |= (uint32_t)(((uint32_t)next<
objIdx_intern = sel;
// Reset Message Object valid bit
msgObj[objIdx_intern].MOCTR = CAN_MO_MOCTR_RESMSGVAL_Msk;
// Configure data length
tmp = msgObj[objIdx_intern].MOFCR & ~CAN_MO_MOFCR_DLC_Msk; // clear old settings
msgObj[objIdx_intern].MOFCR = tmp | (((uint32_t)length << CAN_MO_MOFCR_DLC_Pos) & CAN_MO_MOFCR_DLC_Msk);
// Configure Data registers
for ( i = 0U; i < length; i++ )
{
if (i < 4U)
{
uint32_t pos = (uint32_t)i*8UL;
uint32_t mask = CAN_MO_MODATAL_DB0_Msk << ((uint32_t)i*8UL);
uint8_t dataByte = data;
msgObj[objIdx_intern].MODATAL = msgObj[objIdx_intern].MODATAL & ~mask; // delete old byte
msgObj[objIdx_intern].MODATAL |= ((uint32_t)dataByte << pos) & mask;
}
else
{
uint32_t pos = ((uint32_t)i-4UL)*8UL;
uint32_t mask = CAN_MO_MODATAL_DB0_Msk << (((uint32_t)i-4UL)*8UL);
uint8_t dataByte = data;
msgObj[objIdx_intern].MODATAH = msgObj[objIdx_intern].MODATAH & ~mask; // delete old byte
msgObj[objIdx_intern].MODATAH |= ((uint32_t)dataByte << pos) & mask;
} // if(i < 4)
} // for ( i = 0U; i < length; i++ )
// Set NEWDAT bit
msgObj[objIdx_intern].MOCTR = CAN_MO_MOCTR_SETNEWDAT_Msk;
// Reset RTSEL and Set MSGVAL bits
msgObj[objIdx_intern].MOCTR = (CAN_MO_MOCTR_RESRTSEL_Msk |
CAN_MO_MOCTR_SETMSGVAL_Msk );
if( (msgObj[objIdx_intern].MOSTAT & CAN_MO_MOSTAT_TXRQ_Msk) != 0U )
{
status = FUNC_RETURN_ERROR;
}
else
{
// set TXRQ bit
msgObj[objIdx_intern].MOCTR = CAN_MO_MOCTR_SETTXRQ_Msk;
}
} // if ( (msgObj[objIdx_intern].MOSTAT & CAN_MO_MOSTAT_TXRQ_Msk) != 0 ) ... else
}
else
{
// not supported...
status = FUNC_RETURN_ERROR;
}
}
} // if ( (msgObj[objIdx_intern].MOSTAT & CAN_MO_MOSTAT_DIR_Msk) != 0 )
else
{
// selected an RX Message Object for TX operation
status = FUNC_RETURN_ERROR;
}
}
return status;
} // sint32_t MCAN0_UpdateMsgObjTxDataAndTransmit(uint8_t objIdx, uint8_t length, const uint8_t * data)
XMC™
Hi, The Application note AP32289 has example for HALL and MCM modes, but there's example for the Quadrature Decoder mode. I need urgently of a ex...
Show More
Hi,
The Application note AP32289 has example for HALL and MCM modes, but there's example for the Quadrature Decoder mode.
I need urgently of a example of how to program the POSIF in the Quadrature Decoder mode using the XMClib.
Thanks,
Ari. Show Less
The Application note AP32289 has example for HALL and MCM modes, but there's example for the Quadrature Decoder mode.
I need urgently of a example of how to program the POSIF in the Quadrature Decoder mode using the XMClib.
Thanks,
Ari. Show Less
XMC™
I am trying to use DAVE to create a program that uses the quadrature to read the position of an encoder. In the Dave help a GLOBAL_POSIF APP is mentio...
Show More
I am trying to use DAVE to create a program that uses the quadrature to read the position of an encoder. In the Dave help a GLOBAL_POSIF APP is mentioned but I cannot load it in DAVE. What am doing wrong?
I have also tried to use a digital I/O to trigger an interrupt, but could not find any way to connect the 2 APPs. Show Less
I have also tried to use a digital I/O to trigger an interrupt, but could not find any way to connect the 2 APPs. Show Less
XMC™
Hi,This is weired issue that I have been facing from past so many days. I am working on XMC4100 UART (USIC1_CH1). Whenever I send any string from my U...
Show More
Hi,
This is weired issue that I have been facing from past so many days. I am working on XMC4100 UART (USIC1_CH1). Whenever I send any string from my UART, its first character is always different character like these. I wonder if anybody here faced the same issue. I'll be glad if someone helps me to resolve this. Show Less
This is weired issue that I have been facing from past so many days. I am working on XMC4100 UART (USIC1_CH1). Whenever I send any string from my UART, its first character is always different character like these. I wonder if anybody here faced the same issue. I'll be glad if someone helps me to resolve this. Show Less
Trending discussions