XMC™ Forum Discussions
text.format{('custom.tabs.no.results')}
Sort by:
XMC™
hi i want to use the GPIO pin as the interrupt generator. i went through the manual and came to know that ERU can be used for configuring it as interr...
Show More
hi
i want to use the GPIO pin as the interrupt generator. i went through the manual and came to know that ERU can be used for configuring it as interrupt generator.
but i am unable to implement it. please help for solving the issue. Show Less
i want to use the GPIO pin as the interrupt generator. i went through the manual and came to know that ERU can be used for configuring it as interrupt generator.
but i am unable to implement it. please help for solving the issue. Show Less
XMC™
Hello,I am trying to use the XMC4800 for my EtherCAT application. I need to know the XMC4800 supports Wake on LAN (WoL) on EtherCAT ports like LAN9252...
Show More
Hello,
I am trying to use the XMC4800 for my EtherCAT application. I need to know the XMC4800 supports Wake on LAN (WoL) on EtherCAT ports like LAN9252. I checked the documents and could not find any information about this.
Thanks
Mark Show Less
I am trying to use the XMC4800 for my EtherCAT application. I need to know the XMC4800 supports Wake on LAN (WoL) on EtherCAT ports like LAN9252. I checked the documents and could not find any information about this.
Thanks
Mark Show Less
XMC™
Hi,I have an XMC 4700.I have a 6kHz sine wave connected to P14.1.I am using the ADC_MEASUREMENT_ADV app and the COUNTER_APP.I would like to count the ...
Show More
Hi,
I have an XMC 4700.
I have a 6kHz sine wave connected to P14.1.
I am using the ADC_MEASUREMENT_ADV app and the COUNTER_APP.
I would like to count the number of times the sine wave crosses zero. The zero offset is 2056U.
I have enabled the "generate boundary flag" in the app, set the lower and upper boundary to Group Boundary 0 and 1 respectively.
I have connected the "bound_fl_channel_A" to "counter_input".
I can not get the counter to detect a zero crossing. It appears that the ADC signal is continuously outside the boundary, regardless of where I set the boundary.
This is based on my investigation - the channel event is triggered every ADC conversion "If result outside band" is selected, regardless of boundary level.
I set the boundary with this command:
Does anyone have any ideas as to what I'm doing wrong?
I also have tried using the Event_Generator and Event_Detector apps and using an interrupt to increase a counter instead of the Counter APP but nothing has worked.
My configuration is as follows:
and for the Counter APP:
I have an XMC 4700.
I have a 6kHz sine wave connected to P14.1.
I am using the ADC_MEASUREMENT_ADV app and the COUNTER_APP.
I would like to count the number of times the sine wave crosses zero. The zero offset is 2056U.
I have enabled the "generate boundary flag" in the app, set the lower and upper boundary to Group Boundary 0 and 1 respectively.
I have connected the "bound_fl_channel_A" to "counter_input".
I can not get the counter to detect a zero crossing. It appears that the ADC signal is continuously outside the boundary, regardless of where I set the boundary.
This is based on my investigation - the channel event is triggered every ADC conversion "If result outside band" is selected, regardless of boundary level.
I set the boundary with this command:
XMC_VADC_GROUP_SetBoundaries(GLOBAL_ADC_0.group_ptrs_array[ADC_MEASUREMENT_ADV_0.group_index]->group_handle, 0U, 2056U);
Does anyone have any ideas as to what I'm doing wrong?
I also have tried using the Event_Generator and Event_Detector apps and using an interrupt to increase a counter instead of the Counter APP but nothing has worked.
My configuration is as follows:
/********************************* Channel_A ADC Channel configuration structure ********************************/
static const XMC_VADC_CHANNEL_CONFIG_t ADC_MEASUREMENT_ADV_0_Channel_A_ch_config =
{
.input_class = (uint32_t) XMC_VADC_CHANNEL_CONV_GROUP_CLASS0,
.lower_boundary_select = (uint32_t) XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND0,
.upper_boundary_select = (uint32_t) XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND1,
.event_gen_criteria = (uint32_t) XMC_VADC_CHANNEL_EVGEN_INBOUND,
.sync_conversion = (uint32_t) false, /* Sync feature disabled*/
.alternate_reference = (uint32_t) XMC_VADC_CHANNEL_REF_INTREF, /* Internal reference selected */
.result_reg_number = (uint32_t) 0, /* GxRES[0] selected */
.result_alignment = (uint32_t) XMC_VADC_RESULT_ALIGN_RIGHT, /* Result alignment - Right Aligned*/
.broken_wire_detect_channel = (uint32_t) XMC_VADC_CHANNEL_BWDCH_VAGND, /* No Broken wire mode select*/
.broken_wire_detect = (uint32_t) false, /* No Broken wire detection*/
.invert_boundary_flag_ch0 = (uint32_t) false,
.invert_boundary_flag_ch1 = (uint32_t) false,
.invert_boundary_flag_ch2 = (uint32_t) false,
.invert_boundary_flag_ch3 = (uint32_t) false,
.flag_output_condition_ch0 = (uint32_t) false,
.flag_output_condition_ch1 = (uint32_t) false,
.flag_output_condition_ch2 = (uint32_t) false,
.flag_output_condition_ch3 = (uint32_t) false,
.boundary_flag_mode_ch0 = (uint32_t) 1,
.boundary_flag_mode_ch1 = (uint32_t) 0,
.boundary_flag_mode_ch2 = (uint32_t) 0,
.boundary_flag_mode_ch3 = (uint32_t) 0,
.channel_priority = (uint32_t) true, /* Highest Priority: 1 selected*/
.alias_channel = (int8_t) XMC_VADC_CHANNEL_ALIAS_CH1 /* Channel is Aliased*/
};
/*Channel_A Result configuration structure*/
static const XMC_VADC_RESULT_CONFIG_t ADC_MEASUREMENT_ADV_0_Channel_A_res_config =
{
.data_reduction_control = (uint32_t) 0,
.post_processing_mode = (uint32_t) XMC_VADC_DMM_REDUCTION_MODE,
.wait_for_read_mode = (uint32_t) false,
.part_of_fifo = (uint32_t) false , /* No FIFO */
.event_gen_enable = (uint32_t) false /* Disable Result event */
};
/* Channel_A ADC channel Handle */
const ADC_MEASUREMENT_ADV_CHANNEL_t ADC_MEASUREMENT_ADV_0_Channel_A_handle =
{
.ch_num = (uint8_t) 0,
.group_index = (uint8_t) 0,
.ch_handle = (XMC_VADC_CHANNEL_CONFIG_t*) &ADC_MEASUREMENT_ADV_0_Channel_A_ch_config,
.res_handle[0] = (XMC_VADC_RESULT_CONFIG_t*) &ADC_MEASUREMENT_ADV_0_Channel_A_res_config,
};
and for the Counter APP:
/************************************** PULSE_CNT *********************************************/Show Less
/* Event configuration for counter instance PULSE_CNT */
XMC_CCU4_SLICE_EVENT_CONFIG_t PULSE_CNT_event0_config =
{
.mapped_input = XMC_CCU4_SLICE_INPUT_H,
.edge = XMC_CCU4_SLICE_EVENT_EDGE_SENSITIVITY_FALLING_EDGE,
.level = XMC_CCU4_SLICE_EVENT_LEVEL_SENSITIVITY_ACTIVE_LOW,
.duration = XMC_CCU4_SLICE_EVENT_FILTER_DISABLED
};
/*Configuration structure for CCU4 Counter for PULSE_CNT */
COUNTER_CCU4_CONFIG_t PULSE_CNT_ccu4_config =
{
.global_handle = (GLOBAL_CCU4_t*) &GLOBAL_CCU4_0,
.kernel_ptr = (XMC_CCU4_MODULE_t*) (void*) CCU43_BASE,
.slice_ptr = (XMC_CCU4_SLICE_t*) (void*) CCU43_CC40,
.event0_config = (XMC_CCU4_SLICE_EVENT_CONFIG_t*) &PULSE_CNT_event0_config,
.count_dir_event_config = NULL,
.gating_event_config = NULL,
.shadow_mask = (uint32_t)XMC_CCU4_SHADOW_TRANSFER_SLICE_0,
.count_match_value = (uint16_t) 11840,
.countdir_event = XMC_CCU4_SLICE_EVENT_NONE,
.gating_event = XMC_CCU4_SLICE_EVENT_NONE,
.count_match_node_id = XMC_CCU4_SLICE_SR_ID_0,
.count_rollover_node_id = XMC_CCU4_SLICE_SR_ID_0,
.event_edge_det_node_id = XMC_CCU4_SLICE_SR_ID_0,
.event1_node_id = XMC_CCU4_SLICE_SR_ID_0,
.event2_node_id = XMC_CCU4_SLICE_SR_ID_0,
.state = COUNTER_STATUS_UNINITIALIZED,
.kernel_number = (uint8_t) 3,
.slice_number = (uint8_t) 0,
.intr_count_match = (bool) false,
.intr_count_rollover = (bool) false,
.intr_evt_edge_detect = (bool) false,
.intr_event1_detect = (bool) false,
.intr_event2_detect = (bool) false,
.init_start = (bool) true
};
XMC™
Hi, I downloaded a clean version of the SPI_EXAMPLE_XMC45 App and after (and also before) generating the code, I started the app but it failed to ac...
Show More
Hi,
I downloaded a clean version of the SPI_EXAMPLE_XMC45 App and
after (and also before) generating the code, I started the app but it failed to access the Flash memory.
In the EraseSector() function the call to the N25Q03_StatusRead function (main.c:142) returns status == 255 but status == 2 is expected.
Does anyone have an idea what I need to do make this work. Do I need some other hardware settings?
Thank you in advance
Kuros Show Less
I downloaded a clean version of the SPI_EXAMPLE_XMC45 App and
after (and also before) generating the code, I started the app but it failed to access the Flash memory.
In the EraseSector() function the call to the N25Q03_StatusRead function (main.c:142) returns status == 255 but status == 2 is expected.
Does anyone have an idea what I need to do make this work. Do I need some other hardware settings?
Thank you in advance
Kuros Show Less
XMC™
I read that fopen, fread etc.. are not working (https://www.infineonforums.com/threads/5508-fopen-in-DAvE-4.3-%28erno-88%29-Socket-operation-on-non-socket...
Show More
I read that fopen, fread etc.. are not working (https://www.infineonforums.com/threads/5508-fopen-in-DAvE-4.3-%28erno-88%29-Socket-operation-on-non-socket) is there any other way to read a file from my PC ?
I am writing a bootloader and the client (it sends hex file to the bootloader from CAN bus). My client program shall read a hex file of the main application and send it to the bootloader.
Without standart library functions, how people get hex files?
Bests,
İpek. Show Less
I am writing a bootloader and the client (it sends hex file to the bootloader from CAN bus). My client program shall read a hex file of the main application and send it to the bootloader.
Without standart library functions, how people get hex files?
Bests,
İpek. Show Less
XMC™
Hello!I want to take periodic readings from an analogue angle sensor using the XMC1100. In order to minimize power I need to put the XMC1100 to sleep ...
Show More
Hello!
I want to take periodic readings from an analogue angle sensor using the XMC1100. In order to minimize power I need to put the XMC1100 to sleep mode and then wake it up for some measurements with the angle sensor and then put it to sleep again.
I am able to bring down the power consumption by gating off the peripherals that I do no need. I then use the deep sleep function and execute the command WFI();
With this, the XMC goes to sleep, however I am unable to wake it up. What is the simplest way to wake up the XMC? A little code example would be very helpful in this regard. As far as I understand, it is not possible to wake up the XMC using some digital pin for an external interrupt (like a toggle button which can wake it up when pressed).
Any help would be appreciated 🙂 Show Less
I want to take periodic readings from an analogue angle sensor using the XMC1100. In order to minimize power I need to put the XMC1100 to sleep mode and then wake it up for some measurements with the angle sensor and then put it to sleep again.
I am able to bring down the power consumption by gating off the peripherals that I do no need. I then use the deep sleep function and execute the command WFI();
With this, the XMC goes to sleep, however I am unable to wake it up. What is the simplest way to wake up the XMC? A little code example would be very helpful in this regard. As far as I understand, it is not possible to wake up the XMC using some digital pin for an external interrupt (like a toggle button which can wake it up when pressed).
Any help would be appreciated 🙂 Show Less
XMC™
Hi!I'm using SPI on USIC0_CH1 of a xmc4800 144x196 chip and when i use the function XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1) i always get 0.On the osc...
Show More
Hi!
I'm using SPI on USIC0_CH1 of a xmc4800 144x196 chip and when i use the function XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1) i always get 0.
On the oscilloscope i see that both MISO and MOSI are carrying data, so why the read function gives 0?
Here there is my code
These are the pins i'm using for SPI:
P2.2 MISO
P3.5 MOSI
P2.4 SCLK
P2.3 CS Show Less
I'm using SPI on USIC0_CH1 of a xmc4800 144x196 chip and when i use the function XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1) i always get 0.
On the oscilloscope i see that both MISO and MOSI are carrying data, so why the read function gives 0?
Here there is my code
uint16_t frame_out = 0x5555;
uint16_t read = 0;
/*Enable Slave Select line 0*/
XMC_SPI_CH_EnableSlaveSelect(XMC_SPI0_CH1, XMC_SPI_CH_SLAVE_SELECT_0);
XMC_SPI_CH_Transmit(XMC_SPI0_CH1, frame_out, XMC_SPI_CH_MODE_STANDARD);
/*Wait till the byte has been transmitted*/
while((XMC_SPI_CH_GetStatusFlag(XMC_SPI0_CH1) & XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION) == 0U);
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION);
while((XMC_SPI_CH_GetStatusFlag(XMC_SPI0_CH1) & XMC_SPI_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICATION) == 0U);
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, XMC_SPI_CH_STATUS_FLAG_RECEIVE_INDICATION);
read = XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1);
/*Disable Slave Select line */
XMC_SPI_CH_DisableSlaveSelect(XMC_SPI0_CH1);
These are the pins i'm using for SPI:
P2.2 MISO
P3.5 MOSI
P2.4 SCLK
P2.3 CS Show Less
XMC™
I am new in this field and I have to write an application with a short deadline. My application suppose to wait for a message from CAN bus;if message ...
Show More
I am new in this field and I have to write an application with a short deadline.
My application suppose to wait for a message from CAN bus;
if message received before timeout, my application shall get the program as hex (piece by piece of course) (with mdt maybe? ) and write it to flash.
If no message is received and timeout occurred, my application shall run the program that is loaded to flash previously.
I considered using CAN BSL but(correct me if I am wrong) it loads program to SRAM and runs from there too. Since I need my program to be flashed, CAN BSL is useless for me..
I need a suggestions maybe tips;
Can I configure CAN BSL mode ? If yes maybe I can modify it to load from to flash instead of SRAM ?
Or in CAN BSL mode, after data is loaded to SRAM maybe I can move it to flash ? But I am not sure how to do that..
Or maybe I can write all bootlaoder myself, a bootloader that listens can bus(I can do that) and loads program to flash (don't know how to).. And in that case won't use can bsl, which bsl mode shall I use?
You see I am a bit confused.. Please help 🙂
I use XMC1400 boot kit, I have latest versions of memtool, dave and segger j-link Show Less
My application suppose to wait for a message from CAN bus;
if message received before timeout, my application shall get the program as hex (piece by piece of course) (with mdt maybe? ) and write it to flash.
If no message is received and timeout occurred, my application shall run the program that is loaded to flash previously.
I considered using CAN BSL but(correct me if I am wrong) it loads program to SRAM and runs from there too. Since I need my program to be flashed, CAN BSL is useless for me..
I need a suggestions maybe tips;
Can I configure CAN BSL mode ? If yes maybe I can modify it to load from to flash instead of SRAM ?
Or in CAN BSL mode, after data is loaded to SRAM maybe I can move it to flash ? But I am not sure how to do that..
Or maybe I can write all bootlaoder myself, a bootloader that listens can bus(I can do that) and loads program to flash (don't know how to).. And in that case won't use can bsl, which bsl mode shall I use?
You see I am a bit confused.. Please help 🙂
I use XMC1400 boot kit, I have latest versions of memtool, dave and segger j-link Show Less
XMC™
Hi,I want to start the ADC by a timer. It works just as well. The ADC should then perform 3,5 or 7 conversions. Then an interrupt is to be triggered.I...
Show More
Hi,
I want to start the ADC by a timer. It works just as well. The ADC should then perform 3,5 or 7 conversions. Then an interrupt is to be triggered.
I am currently using ADC_SCAN_APP with 3 channels.
I get the results with the following commands:
val[0] = ADC_MEASUREMENT_ADV_GetResult(&ADC_MEASUREMENT_ADV_Channel_A_handle);
val[1] = ADC_MEASUREMENT_ADV_GetResult(&ADC_MEASUREMENT_ADV_Channel_B_handle);
val[2] = ADC_MEASUREMENT_ADV_GetResult(&ADC_MEASUREMENT_ADV_Channel_C_handle);
Channels A, B and C are all connected to the same analog port.
But how can I increase the number of conversions?
What settings do I have to make in the ADC_QEUE_APP?
Thank you very much!
Norgmis Show Less
I want to start the ADC by a timer. It works just as well. The ADC should then perform 3,5 or 7 conversions. Then an interrupt is to be triggered.
I am currently using ADC_SCAN_APP with 3 channels.
I get the results with the following commands:
val[0] = ADC_MEASUREMENT_ADV_GetResult(&ADC_MEASUREMENT_ADV_Channel_A_handle);
val[1] = ADC_MEASUREMENT_ADV_GetResult(&ADC_MEASUREMENT_ADV_Channel_B_handle);
val[2] = ADC_MEASUREMENT_ADV_GetResult(&ADC_MEASUREMENT_ADV_Channel_C_handle);
Channels A, B and C are all connected to the same analog port.
But how can I increase the number of conversions?
What settings do I have to make in the ADC_QEUE_APP?
Thank you very much!
Norgmis Show Less
XMC™
Hi,I'm currently experiencingbehavior of the VADC background source that does not fit with my expectation 😉I have multiple channels of both VADC Grou...
Show More
Hi,
I'm currently experiencingbehavior of the VADC background source that does not fit with my expectation 😉
I have multiple channels of both VADC Groups added to the background source and I'm using FIFOs on most of them.
During startup I have to check one of the channels multiple times before the RTOS starts up and I noticed that my code gets stuck there waiting for the VALID Flag after the first read.
Further Investigation revealed that BRSPND has one pending bit left, which seems to prevent reloading of BRSSEL into BRSPND.
The reason for this seems to be that the Result Register of this Channel has the Wait-For-Read Flag set as suggested when a FIFO is used (it is not set on the other channels). If I use the debugger to clear the Valid Flag, the BRSPND Register is reloaded and the application continues.
That raises a couple of questions:
Regards,
Lukas Show Less
I'm currently experiencingbehavior of the VADC background source that does not fit with my expectation 😉
I have multiple channels of both VADC Groups added to the background source and I'm using FIFOs on most of them.
During startup I have to check one of the channels multiple times before the RTOS starts up and I noticed that my code gets stuck there waiting for the VALID Flag after the first read.
Further Investigation revealed that BRSPND has one pending bit left, which seems to prevent reloading of BRSSEL into BRSPND.
The reason for this seems to be that the Result Register of this Channel has the Wait-For-Read Flag set as suggested when a FIFO is used (it is not set on the other channels). If I use the debugger to clear the Valid Flag, the BRSPND Register is reloaded and the application continues.
That raises a couple of questions:
- Why does a WFR flag block the complete queue/source and not just this channel?
- Is this intentional?
- How can this be avoided?
- What exactly does WFR do with ADC FIFOs? Why does it need to be set on the Input Stage and not on the Output stage? What happens if this is reversed?
- Is there a simple way to trigger a complete BRSPND reload - Writing to BRSMR/LDEV does not do it, although the RM says it does.
Regards,
Lukas Show Less
Trending discussions