XMC™ Forum Discussions
XMC™
On the website for the XMC4700 microcontroller the feature "EEPROM Emulation" is mentioned, but looking at the reference manual it would seem this is ...
Show More
On the website for the XMC4700 microcontroller the feature "EEPROM Emulation" is mentioned, but looking at the reference manual it would seem this is only for EtherCAT configuration data.
My question is:
Can the EEPROM emulation be used for other purposes if EtherCAT is not needed? If yes, how large is the storage? Show Less
My question is:
Can the EEPROM emulation be used for other purposes if EtherCAT is not needed? If yes, how large is the storage? Show Less
XMC™
Hi, I have just started to work with infineon xmc 1400 boot kit. After reading through some of its docs and DAVE APP examples, I was able to transmit ...
Show More
Hi,
I have just started to work with infineon xmc 1400 boot kit. After reading through some of its docs and DAVE APP examples,
I was able to transmit and receive packets on the can node connected to the on-board transceiver( pins 4.8 and 4.9).
I am trying to now activate can node on the other pins, like 0.4 and 0.5. However, I dont seem to get any raw signal on the scope from the tx and rx pins (0.4 and 0.5)
and also no packets transmitted when connecting via external transceiver module.
Posting my code below here, which tries to transmit a packet on can node 0 configured to use pins 0.4 and 0.5 to send a packet every second.
Any help would be appreciated. Thanks
I have just started to work with infineon xmc 1400 boot kit. After reading through some of its docs and DAVE APP examples,
I was able to transmit and receive packets on the can node connected to the on-board transceiver( pins 4.8 and 4.9).
I am trying to now activate can node on the other pins, like 0.4 and 0.5. However, I dont seem to get any raw signal on the scope from the tx and rx pins (0.4 and 0.5)
and also no packets transmitted when connecting via external transceiver module.
Posting my code below here, which tries to transmit a packet on can node 0 configured to use pins 0.4 and 0.5 to send a packet every second.
Any help would be appreciated. Thanks
Show Less
#include//Declarations from DAVE Code Generation (includes SFR declaration)
/**
* @brief main() - Application entry point
*
* Details of function
* This routine is the application entry point. It is invoked by the device startup code. It is responsible for
* invoking the APP initialization dispatcher routine - DAVE_Init() and hosting the place-holder for user application
* code.
*/
#define OneSec 1000000U
void LED_Toggle();
int main(void)
{
DAVE_STATUS_t status;
CAN_NODE_STATUS_t txStatus;
uint32_t timerStatus;
status = DAVE_Init(); /* Initialization of DAVE APPs */
if(status != DAVE_STATUS_SUCCESS)
{
/* Placeholder for error handler code. The while loop below can be replaced with an user error handler. */
XMC_DEBUG("DAVE APPs initialization failed\n");
while(1U)
{
}
}
timerStatus = SYSTIMER_CreateTimer(OneSec,SYSTIMER_MODE_PERIODIC,(void*)LED_Toggle,NULL);
if(timerStatus != 0U)
{
//Timer created successfully
//Start the timer
status = SYSTIMER_StartTimer(timerStatus);
}
/* Placeholder for user application code. The while loop below can be replaced with user application code. */
while(1U)
{
}
}
void LED_Toggle()
{
volatile CAN_NODE_STATUS_t txStatus;
volatile uint32_t status = 0x00;
DIGITAL_IO_SetOutputHigh(&DIGITAL_IO_0);
status = CAN_NODE_MO_GetStatus ( (void*)CAN_NODE_0.lmobj_ptr[0]);
txStatus = CAN_NODE_MO_Transmit(CAN_NODE_0.lmobj_ptr[0]);
if(txStatus == CAN_NODE_STATUS_SUCCESS)
DIGITAL_IO_ToggleOutput(&DIGITAL_IO_0); //Tx Success LED P4.2
DIGITAL_IO_ToggleOutput(&DIGITAL_IO_1); //Timer LED P4.0
}
void EventHandler_CanNode_0()
{
uint32_t status = 0x00;
XMC_CAN_MO_t* lmsgobjct_ptr_1 = CAN_NODE_0.lmobj_ptr[0]->mo_ptr; // CAN_NODE_0 transmit message object pointer
status = CAN_NODE_MO_GetStatus((void*)CAN_NODE_0.lmobj_ptr[0]);
if(status & XMC_CAN_MO_STATUS_TX_PENDING){
CAN_NODE_MO_ClearStatus((void*)CAN_NODE_0.lmobj_ptr[0],XMC_CAN_MO_RESET_STATUS_TX_PENDING);
//Clear the flag
DIGITAL_IO_SetOutputHigh(&DIGITAL_IO_0);
}
// Check for Node error
if ( CAN_NODE_GetStatus(&CAN_NODE_0) & XMC_CAN_NODE_STATUS_ALERT_WARNING )
{
//Clear the flag
CAN_NODE_DisableEvent(&CAN_NODE_0,XMC_CAN_NODE_EVENT_ALERT);
}
}
XMC™
Hi.Because we have a board with 2 XMC's and only 2 lines to the outside (SWDIO + SWDCLK), we need a possibility to program both XMC's individually. Is...
Show More
Hi.
Because we have a board with 2 XMC's and only 2 lines to the outside (SWDIO + SWDCLK), we need a possibility to program both XMC's individually.
Is it possible to programm (and also debug) two XMC1400 over the same SWD, if we switch them (SWDIO + SWDCLK) in parallel?
On the XMC1400, there is not JTAG, where we have the possibility for a daisy chain.
If it is possible, how can i access one of the XMC's over Segger JLink and how can I distinguish them?
Thanks. Show Less
Because we have a board with 2 XMC's and only 2 lines to the outside (SWDIO + SWDCLK), we need a possibility to program both XMC's individually.
Is it possible to programm (and also debug) two XMC1400 over the same SWD, if we switch them (SWDIO + SWDCLK) in parallel?
On the XMC1400, there is not JTAG, where we have the possibility for a daisy chain.
If it is possible, how can i access one of the XMC's over Segger JLink and how can I distinguish them?
Thanks. Show Less
XMC™
I am looking into the possibility to detect when the system clock PLL loses lock.The reference manual states: "The PLL may become unlocked, caused by ...
Show More
I am looking into the possibility to detect when the system clock PLL loses lock.
The reference manual states: "The PLL may become unlocked, caused by a break of the crystal or the external clock line. In such a case, an NMI trap is generated if it were enabled."
But where can this be enabled to generate the NMI? I have looked at all the SCU registers but have not been able to find an enable bit. This is also not set by default.
In the default configuration I end up with a Bus Error fault if I stop the external crystal. This is not described in the reference manual.
How can this safety feature be used? Show Less
The reference manual states: "The PLL may become unlocked, caused by a break of the crystal or the external clock line. In such a case, an NMI trap is generated if it were enabled."
But where can this be enabled to generate the NMI? I have looked at all the SCU registers but have not been able to find an enable bit. This is also not set by default.
In the default configuration I end up with a Bus Error fault if I stop the external crystal. This is not described in the reference manual.
How can this safety feature be used? Show Less
XMC™
Is there a possibility to migrate a DAVE Project from a XMC4200 to XMC4400? My application needs more RAM so I will use the XMC4400 instead. Both is L...
Show More
Is there a possibility to migrate a DAVE Project from a XMC4200 to XMC4400?
My application needs more RAM so I will use the XMC4400 instead. Both is LQFP64.
Best regards,
Tobias Show Less
My application needs more RAM so I will use the XMC4400 instead. Both is LQFP64.
Best regards,
Tobias Show Less
XMC™
Hello,When I installed the 'Infineon-Memtool-DT-v04_77-EN' memtool from Infineon, I got an error when it started installing the DAS part.I got the fol...
Show More
Hello,
When I installed the 'Infineon-Memtool-DT-v04_77-EN' memtool from Infineon, I got an error when it started installing the DAS part.
I got the following error: 'Unable to create file'. I was running the setup as an administrator.
Manually installing v6 or v7 of the DAS files gave same error.
I'm using Windows 10/64bit operating system.
Someone an idea?
Thanks.
Wim Show Less
When I installed the 'Infineon-Memtool-DT-v04_77-EN' memtool from Infineon, I got an error when it started installing the DAS part.
I got the following error: 'Unable to create file'. I was running the setup as an administrator.
Manually installing v6 or v7 of the DAS files gave same error.
I'm using Windows 10/64bit operating system.
Someone an idea?
Thanks.
Wim Show Less
XMC™
Hi All,I would like to know that limitation of interrupt duration.especially I would like to know high pulse duration of falling edge.I might found th...
Show More
Hi All,
I would like to know that limitation of interrupt duration.
especially I would like to know high pulse duration of falling edge.
I might found that correctly contents in below file.
p.47 3.2-3.2.1-Table20 Standard pad parameters
Infineon-XMC4700-XMC4800-DS-v01_00-EN.pdf
is it correct? Show Less
I would like to know that limitation of interrupt duration.
especially I would like to know high pulse duration of falling edge.
I might found that correctly contents in below file.
p.47 3.2-3.2.1-Table20 Standard pad parameters
Infineon-XMC4700-XMC4800-DS-v01_00-EN.pdf
is it correct? Show Less
XMC™
Hi,
how to generate sine wave in pattern generation mode.
how to generate sine wave in pattern generation mode.
XMC™
Hey everybody,i would like to generate a SINE-WAVE with the DAC and DMA use. Unfortunately I couldn´t get it to work.I use Dave and the XMC_4700. I wa...
Show More
Hey everybody,
i would like to generate a SINE-WAVE with the DAC and DMA use. Unfortunately I couldn´t get it to work.
I use Dave and the XMC_4700. I want to use the XMC-Library and not the apps.
I think the problem is, that the trigger isn´t working
This is my actual Code:
#include
#include
#include
#include
#define DATA_LENGTH 120
//Instanzen
XMC_DMA_CH_CONFIG_t dma_ch_config;
//Functions
void GPDMA0_0_IRQHandler(void);
//LookUp-Table for the Sine-Wave
static uint32_t WAVE_SINE[DATA_LENGTH]= {
0x7ff, 0x86a, 0x8d5, 0x93f, 0x9a9, 0xa11, 0xa78, 0xadd, 0xb40, 0xba1,
0xbff, 0xc5a, 0xcb2, 0xd08, 0xd59, 0xda7, 0xdf1, 0xe36, 0xe77, 0xeb4,
0xeec, 0xf1f, 0xf4d, 0xf77, 0xf9a, 0xfb9, 0xfd2, 0xfe5, 0xff3, 0xffc,
0xfff, 0xffc, 0xff3, 0xfe5, 0xfd2, 0xfb9, 0xf9a, 0xf77, 0xf4d, 0xf1f,
0xeec, 0xeb4, 0xe77, 0xe36, 0xdf1, 0xda7, 0xd59, 0xd08, 0xcb2, 0xc5a,
0xbff, 0xba1, 0xb40, 0xadd, 0xa78, 0xa11, 0x9a9, 0x93f, 0x8d5, 0x86a,
0x7ff, 0x794, 0x729, 0x6bf, 0x655, 0x5ed, 0x586, 0x521, 0x4be, 0x45d,
0x3ff, 0x3a4, 0x34c, 0x2f6, 0x2a5, 0x257, 0x20d, 0x1c8, 0x187, 0x14a,
0x112, 0xdf, 0xb1, 0x87, 0x64, 0x45, 0x2c, 0x19, 0xb, 0x2,
0x0, 0x2, 0xb, 0x19, 0x2c, 0x45, 0x64, 0x87, 0xb1, 0xdf,
0x112, 0x14a, 0x187, 0x1c8, 0x20d, 0x257, 0x2a5, 0x2f6, 0x34c, 0x3a4,
0x3ff, 0x45d, 0x4be, 0x521, 0x586, 0x5ed, 0x655, 0x6bf, 0x729, 0x794
};
int main(void)
{
//DMA configuration
XMC_DMA_CH_CONFIG_t dma_ch_config =
{
.block_size=sizeof(WAVE_SINE),
.src_addr = (uint32_t)&(WAVE_SINE[0]),
.dst_addr = (uint32_t)&(DAC->DAC0DATA),
.src_transfer_width = XMC_DMA_CH_TRANSFER_WIDTH_32,
.dst_transfer_width = XMC_DMA_CH_TRANSFER_WIDTH_32,
.src_address_count_mode = XMC_DMA_CH_ADDRESS_COUNT_MODE_INCREMENT,
.dst_address_count_mode = XMC_DMA_CH_ADDRESS_COUNT_MODE_NO_CHANGE,
.src_burst_length = XMC_DMA_CH_BURST_LENGTH_8,
.dst_burst_length = XMC_DMA_CH_BURST_LENGTH_8,
.transfer_flow = XMC_DMA_CH_TRANSFER_FLOW_M2P_DMA,
.transfer_type = XMC_DMA_CH_TRANSFER_TYPE_MULTI_BLOCK_SRCADR_CONTIGUOUS_DSTADR_RELOAD,
.dst_handshaking = XMC_DMA_CH_DST_HANDSHAKING_HARDWARE,
.dst_peripheral_request = DMA0_PERIPHERAL_REQUEST_DAC_SR0_1,
.enable_interrupt = true
};
XMC_DMA_Init(XMC_DMA0);
XMC_DMA_CH_Init(XMC_DMA0, 1, &dma_ch_config);
XMC_DMA_CH_EnableEvent(XMC_DMA0,1, XMC_DMA_CH_EVENT_BLOCK_TRANSFER_COMPLETE);
/* Start DMA transfer */
// XMC_DMA_CH_SetEventHandler(XMC_DMA0, 1, dma_ch0_event_handler);
XMC_DMA_CH_Enable(XMC_DMA0,1);
/* Enable DMA event handling */
NVIC_SetPriority(GPDMA0_0_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 63, 0));
NVIC_EnableIRQ(GPDMA0_0_IRQn);
//DAC0 configuration
XMC_DAC_CH_CONFIG_t dac_handle =
{
.data_type = XMC_DAC_CH_DATA_TYPE_UNSIGNED, // es wurde unsigned datatyp ausgewählt
.output_negation = XMC_DAC_CH_OUTPUT_NEGATION_DISABLED, // Festlegen ob 4095 HIGH sind oder LOW
.output_offset = 0U,
.output_scale = XMC_DAC_CH_OUTPUT_SCALE_NONE,
};
XMC_DAC_CH_Init(XMC_DAC0, 0U, &dac_handle); // Initialisierung des DACs man muss &dac_handle machen weil die Funktion Init ein Zeiger ist, und mit & wird bestimmt wohin er zeigt
XMC_DAC_CH_StartDataMode(XMC_DAC0,0U,XMC_DAC_CH_TRIGGER_INTERNAL,100U);
//XMC_DAC_CH_EnableEvent(XMC_DAC0,0U);
//NVIC_EnableIRQ(DAC0_0_IRQn);
while(1U)
{
//Infinity LOOP
}
}
void GPDMA0_0_IRQHandler(void)
{
XMC_DMA_CH_ClearEventStatus(XMC_DMA0, 1, XMC_DMA_CH_EVENT_BLOCK_TRANSFER_COMPLETE);
}
Thank you!!
Matix
Show Less
i would like to generate a SINE-WAVE with the DAC and DMA use. Unfortunately I couldn´t get it to work.
I use Dave and the XMC_4700. I want to use the XMC-Library and not the apps.
I think the problem is, that the trigger isn´t working
This is my actual Code:
#include
#include
#include
#include
#define DATA_LENGTH 120
//Instanzen
XMC_DMA_CH_CONFIG_t dma_ch_config;
//Functions
void GPDMA0_0_IRQHandler(void);
//LookUp-Table for the Sine-Wave
static uint32_t WAVE_SINE[DATA_LENGTH]= {
0x7ff, 0x86a, 0x8d5, 0x93f, 0x9a9, 0xa11, 0xa78, 0xadd, 0xb40, 0xba1,
0xbff, 0xc5a, 0xcb2, 0xd08, 0xd59, 0xda7, 0xdf1, 0xe36, 0xe77, 0xeb4,
0xeec, 0xf1f, 0xf4d, 0xf77, 0xf9a, 0xfb9, 0xfd2, 0xfe5, 0xff3, 0xffc,
0xfff, 0xffc, 0xff3, 0xfe5, 0xfd2, 0xfb9, 0xf9a, 0xf77, 0xf4d, 0xf1f,
0xeec, 0xeb4, 0xe77, 0xe36, 0xdf1, 0xda7, 0xd59, 0xd08, 0xcb2, 0xc5a,
0xbff, 0xba1, 0xb40, 0xadd, 0xa78, 0xa11, 0x9a9, 0x93f, 0x8d5, 0x86a,
0x7ff, 0x794, 0x729, 0x6bf, 0x655, 0x5ed, 0x586, 0x521, 0x4be, 0x45d,
0x3ff, 0x3a4, 0x34c, 0x2f6, 0x2a5, 0x257, 0x20d, 0x1c8, 0x187, 0x14a,
0x112, 0xdf, 0xb1, 0x87, 0x64, 0x45, 0x2c, 0x19, 0xb, 0x2,
0x0, 0x2, 0xb, 0x19, 0x2c, 0x45, 0x64, 0x87, 0xb1, 0xdf,
0x112, 0x14a, 0x187, 0x1c8, 0x20d, 0x257, 0x2a5, 0x2f6, 0x34c, 0x3a4,
0x3ff, 0x45d, 0x4be, 0x521, 0x586, 0x5ed, 0x655, 0x6bf, 0x729, 0x794
};
int main(void)
{
//DMA configuration
XMC_DMA_CH_CONFIG_t dma_ch_config =
{
.block_size=sizeof(WAVE_SINE),
.src_addr = (uint32_t)&(WAVE_SINE[0]),
.dst_addr = (uint32_t)&(DAC->DAC0DATA),
.src_transfer_width = XMC_DMA_CH_TRANSFER_WIDTH_32,
.dst_transfer_width = XMC_DMA_CH_TRANSFER_WIDTH_32,
.src_address_count_mode = XMC_DMA_CH_ADDRESS_COUNT_MODE_INCREMENT,
.dst_address_count_mode = XMC_DMA_CH_ADDRESS_COUNT_MODE_NO_CHANGE,
.src_burst_length = XMC_DMA_CH_BURST_LENGTH_8,
.dst_burst_length = XMC_DMA_CH_BURST_LENGTH_8,
.transfer_flow = XMC_DMA_CH_TRANSFER_FLOW_M2P_DMA,
.transfer_type = XMC_DMA_CH_TRANSFER_TYPE_MULTI_BLOCK_SRCADR_CONTIGUOUS_DSTADR_RELOAD,
.dst_handshaking = XMC_DMA_CH_DST_HANDSHAKING_HARDWARE,
.dst_peripheral_request = DMA0_PERIPHERAL_REQUEST_DAC_SR0_1,
.enable_interrupt = true
};
XMC_DMA_Init(XMC_DMA0);
XMC_DMA_CH_Init(XMC_DMA0, 1, &dma_ch_config);
XMC_DMA_CH_EnableEvent(XMC_DMA0,1, XMC_DMA_CH_EVENT_BLOCK_TRANSFER_COMPLETE);
/* Start DMA transfer */
// XMC_DMA_CH_SetEventHandler(XMC_DMA0, 1, dma_ch0_event_handler);
XMC_DMA_CH_Enable(XMC_DMA0,1);
/* Enable DMA event handling */
NVIC_SetPriority(GPDMA0_0_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 63, 0));
NVIC_EnableIRQ(GPDMA0_0_IRQn);
//DAC0 configuration
XMC_DAC_CH_CONFIG_t dac_handle =
{
.data_type = XMC_DAC_CH_DATA_TYPE_UNSIGNED, // es wurde unsigned datatyp ausgewählt
.output_negation = XMC_DAC_CH_OUTPUT_NEGATION_DISABLED, // Festlegen ob 4095 HIGH sind oder LOW
.output_offset = 0U,
.output_scale = XMC_DAC_CH_OUTPUT_SCALE_NONE,
};
XMC_DAC_CH_Init(XMC_DAC0, 0U, &dac_handle); // Initialisierung des DACs man muss &dac_handle machen weil die Funktion Init ein Zeiger ist, und mit & wird bestimmt wohin er zeigt
XMC_DAC_CH_StartDataMode(XMC_DAC0,0U,XMC_DAC_CH_TRIGGER_INTERNAL,100U);
//XMC_DAC_CH_EnableEvent(XMC_DAC0,0U);
//NVIC_EnableIRQ(DAC0_0_IRQn);
while(1U)
{
//Infinity LOOP
}
}
void GPDMA0_0_IRQHandler(void)
{
XMC_DMA_CH_ClearEventStatus(XMC_DMA0, 1, XMC_DMA_CH_EVENT_BLOCK_TRANSFER_COMPLETE);
}
Thank you!!
Matix