XMC™ Forum Discussions
I'm running the BLDC_SCALAR_HALL_XMC13 application. I blink an LED in the main() loop where I do low priority tasks.
When running at the nominal DC-link input voltage (~18V) the main loop executes anywhere from 100-500hz. Great!
However, when reducing the DC-link voltage, the main loop rate starts to vary wildly and then altogether stops executing from 11-15V.
Even stranger, it's starts executing again <11V.
All the while, the motor is running smoothly from 9-18V.
Does anyone have an idea where the main loop is getting hung up?
Thanks in advance. Josh.
Show LessHello,
I use ABM in my code, so I have some additional code that I need to add to the linker_script.ld file.
My problem is that when I press the GENERATE code button (after changing or adding an App) the changes in the linker_script.ld file are deleted and it returns to the original.
why is it happening?
thanks
Yehudit
Show LessHello,
Does anyone knows weather EtherCAT Master Sample Code ET9200 is free? And where can i download(if free)/buy it?
I don't find any download or buying Link here ''EtherCAT Technology Group | EtherCAT Master Sample Code ET9200''
Best regards,
Alireza
Show LessHi,
I have created a firmware to get the value of current on the 3-phases and voltage value on the collector of IGBTs depends on trigger received which are connected to the gate inputs of the IGBTs and to the digital input of microcontroller.
The role of the microcontroller is to start getting the value of voltage on the collector and current flowing in the phases connected to the induction load.
I tested 6 channels separately and firmware worked fine.
But the question is how to test the operation of my firmware in a complete scenario with 6-pwm signals and the result of the capturing data should be right like highlighted curve of this below graph of current signal:
Due to the condition I added in the firmware it will care to the increase and decrease of current flowing in the phases to capturing specific part highlighted in the figure.
I will be thankful if some one could guide me, how to create 6-pwm signal like what I mentioned in the graph to provide 3phase PWM inverter as I needed on the IGBT module.
How can I create PWM signals numbered 1,2,3 together? Is there any samples ready to use?
Thank you for your attention.
Best regards,
MoRo
Show Less
Does anyone know how to offer Bluetooth connectivity over a XMC4500 Relaxkit. What is the recommended hardware and software stack? How about just attaching a USB-BT500?
Thank you
Show LessDear Receiver,
If we use xmc1400 boot kit as a I2C master, and it connect to other 4 slave devices.
We use switch to decide I2C slave address. => 000, 001, 011, 100,
Then, if XMC1400 send a non-existence slave address (for example: 101) and no slave will react.
Next, we switch back the switch to normal address 100. We hope xmc1400 boot kit will transmit again.
At this moment, we found the I2C bus no matter SDA or SCLK become "high". It will always high and I2C bus halt.
We don't know what happen and we would like to use "I2C_MASTER_GetFlagStatus(xxx)" to know what kinds of error.
But we can't get it.
Could you please help me about above issue ?!
Thank you so much.
Show LessHow do I read the BMI in application code?
AN_201511_PL30_005 says "The XMC1000 device BMI value is read from memory location 0x10000E00".
Is there any example how to do it correctly in my app?
There is macro to set BMI - XMC1000_BmiInstallationReq. But nothing to safely read BMI in my app.
Any help?
Show LessBest regards,
I made a PCB containing SDRAM IS42S16400J, connected to microcontroller XMC4700 F144K1536. Wiring is direct copy from XMC4500 hexagon board. There are also some other components, but not on the same pins as RAM ofcourse.
I started testing RAM with original code from "XMClib v2.2.0 - XMC Peripheral Driver Library" that has been sent to me by LinglingG_46 as part of his answer to my question on link https://community.infineon.com/t5/DAVE/SDRAM-in-Dave-ver-4/m-p/401175#M6559 .
The only thing that I added is DAVE init code at the beginning of int main method:
DAVE_STATUS_t status;
status = DAVE_Init();
if (status != DAVE_STATUS_SUCCESS)
{
XMC_DEBUG("DAVE APPs initialization failed\n");
while(1U){ }
}
I have quite a few problems convincing RAM to work:
1.: Getting 16 bit only:
Writing and reading RAM sometimes dont work at all, but when it does, it does it "partialy". Let me elaborate:
- I write a value, let's say "0x87654321" to some memory location
- When I read it back, i get "0x87658765" - the first 16 bits are repeated in last 16 bits.
- I believe that there is something wrong with timing on the line that tells RAM which part of data should be on lines AD[15:0]
I susspect that some timing is not correct, but there is so much different settings that I'm totaly lost. Will return to that.
2.: 16 bits work "sometimes"
So, just to be able to continue, I changed part of test program so that it checks only first 16 bits.
I also converted status to error counter.
To "disperse" values in RAM I mutiplied "i" with some big prime called "factor" (also on writing :))
for (i = 0; i < TEST_SIZE ; i++)
{
mem_add = SDRAM_BASE + (4 * i);
value = *(volatile uint32_t *)(mem_add);
if ((value & 0xffff0000) != ((i * factor) & 0xffff0000))
{
//status = 1;
status ++;
}
}
Running this code repeatedly, I get somewhere arround 660.000 error, out of 2.097.152 samples (approx 1/3rd of time). But error rate is not consistent... 666890, 666594, 656867.
3.: Number of errors HIGHLY depends on DAVE code
This is probbably the funiest part:
If I just remark "DAVE init code" (everything in my first code snippet), I have only 3-5 errors.
And in this case errors are on exact memory addresses:
- 0x60000000 - first location in RAM
- 0x60200000 - at 1/4 of address space
- 0x60400000 - at 2/4 of address space
- 0x60600000 - at 3/4 of address space - not always
I don't know the fifth address, becouse i NEVER get 5 errors, if I have breakpint in line "status ++;"
Let me emphasyse that this testing code is the only thing in test project.
There is no Dave aps in this project. No "digital pins". No pins in "Manual pin mapping" no pins in "Pin Mapping perspective". Only other pins that are used in project are :
#define LED_R P1_10
#define LED_G P1_11
#define LED_SDCARD_R P0_11
#define LED_SDCARD_G P0_6
4.: My suspections
I higly suspect that there is somethnig wrong with timing. Maybe processor is working to fast, or something else is wrong?!?
I must addmit that I don't quite understand communication with SDRAM on low hardware level. I hoped that code from library will work and that I won't have to study RAM on hardware level.
While seraching for solution, I read alot, including entire EBU section in ReferenceManual of XMC4700. I tried different settings in code (section below). Most of settings didn't work at all, some setings didn't change anything.
I also tried with another PCB (I have two prototypes completley assembled). Second one works similary, but with much more errors.
Right now I'm clueless.
5.: SDRAM_CLK_B
Another detail got my attention: in both circuits, "XMC4500 hexagon" and "4800 Automation", there is a RAM pin CLK connected to two pins on microprocessor:
- directly to P5_8 as SRAM_CLK
- via 22E resistor to pin P6_4 as SDRAM_CLK_B
While first one is used in code, "SDRAM_CLK_B" is nowhere to be find. Is this OK?
6.: Conclusion:
As I said, I'm clueless right now.
I do not have a propeper measurement equipment at my hand, so I can't preform electical measurements. But i suspect somethinh in software anyhow.
Any help will be appreciated.
Thanx in advance and best regards to all,
Martin
Apendix: Settings part of code from library.
I think that here I should somehow "slow down" communication with RAM. Here I tried many things without success - Source: "XMClib v2.2.0 - XMC Peripheral Driver Library"
XMC_EBU_t *const ebumodule = (XMC_EBU_t *)EBU;
XMC_EBU_CONFIG_t ebuobj =
{
.ebu_clk_config.ebu_div2_clk_mode = XMC_EBU_DIV2_CLK_MODE_ON,
.ebu_mode_config.ebu_arbitration_mode = XMC_EBU_ARB_MODE_SOLE_MASTER_MODE,
.ebu_free_pins_to_gpio.address_pins_gpio = 0x1ff,
.ebu_free_pins_to_gpio.adv_pin_gpio = false
};
XMC_EBU_REGION_t ebureadwriteconfig =
{
.read_config.ebu_region_no = 0x0U,
.read_config.ebu_bus_read_config.ebu_burst_length_sync = XMC_EBU_BURST_LENGTH_SYNC_8_DATA_ACCESSES,
.read_config.ebu_bus_read_config.ebu_byte_control = XMC_EBU_BYTE_CONTROL_FOLLOWS_CONTROL_SIGNAL_TIMMING,
.read_config.ebu_bus_read_config.ebu_burst_flash_clock_feedback = XMC_EBU_BURST_FLASH_CLOCK_FEEDBACK_ENABLE,
.read_config.ebu_bus_read_config.ebu_device_addressing_mode = XMC_EBU_DEVICE_ADDRESSING_MODE_16_BITS,
.read_config.ebu_bus_read_config.ebu_device_type = XMC_EBU_DEVICE_TYPE_SDRAM,
.read_config.ebu_bus_read_config.address_cycles = 0xFU,
.read_config.ebu_bus_read_config.address_hold_cycles = 0xFU,
.read_config.ebu_bus_read_config.command_delay_lines = 0xFU,
.read_config.ebu_bus_read_config.ebu_ext_data = 0x0U,
.read_config.ebu_bus_read_config.ebu_freq_ext_clk_pin = 0x0U,
.read_config.ebu_bus_read_config.ebu_recovery_cycles_between_different_regions = 0xFU,
.read_config.ebu_bus_read_config.ebu_recovery_cycles_after_read_accesses = 0x7U,
.read_config.ebu_bus_read_config.ebu_programmed_wait_states_for_read_accesses = 0x4U,
.write_config.ebu_region_no = 0x0U,
.write_config.ebu_bus_write_config.ebu_burst_length_sync = XMC_EBU_BURST_LENGTH_SYNC_8_DATA_ACCESSES,
.write_config.ebu_bus_write_config.ebu_byte_control = XMC_EBU_BYTE_CONTROL_FOLLOWS_CONTROL_SIGNAL_TIMMING,
.write_config.ebu_bus_write_config.ebu_device_type = XMC_EBU_DEVICE_TYPE_SDRAM,
.write_config.ebu_bus_write_config.address_cycles = 0xFU,
.write_config.ebu_bus_write_config.address_hold_cycles = 0xFU,
.write_config.ebu_bus_write_config.command_delay_lines = 0xFU,
.write_config.ebu_bus_write_config.ebu_ext_data = 0x0U,
.write_config.ebu_bus_write_config.ebu_freq_ext_clk_pin = 0x0U,
.write_config.ebu_bus_write_config.ebu_recovery_cycles_between_different_regions = 0xFU,
.write_config.ebu_bus_write_config.ebu_recovery_cycles_after_write_accesses = 0x7U,
.write_config.ebu_bus_write_config.ebu_programmed_wait_states_for_write_accesses = 0x4U,
};
XMC_EBU_SDRAM_CONFIG_t ebusdramcontrol =
{
.ebu_sdram_clk_mode= XMC_EBU_SDRAM_CLK_MODE_CONTINUOUSLY_RUNS, /**< SDRAM clock mode select */
.ebu_sdram_mask_for_bank_tag = XMC_EBU_SDRAM_MASK_FOR_BANK_TAG_ADDRESS_22_to_21, /**< Mask for Bank Tag */
.ebu_sdram_mask_for_row_tag = XMC_EBU_SDRAM_WIDTH_OF_COLUMN_ADDRESS_8_to_0, /**< Mask for Row Tag */
/**< Row cycle time counter: Insert (CRCE * 😎 + CRC + 1 NOP cycles */
.ebu_sdram_row_cycle_time_counter = 0x5UL,
/**< (CRCD) Number of NOP cycles between a row address and a column address: Insert CRCD + 1 NOP cycles */
.ebu_sdram_row_to_column_delay_counter = 0x01U,
/**< Number of address bits from bit 0 to be used for column address */
.ebu_sdram_width_of_column_address = XMC_EBU_SDRAM_WIDTH_OF_COLUMN_ADDRESS_8_to_0,
/**< (CRP) Number of NOP cycles inserted after a precharge command: Insert CRP + 1 NOP cycles */
.ebu_row_precharge_time_counter= 0x1U,
/**< (CRSC) Number of NOP cycles after a mode register set command: Insert CRSC + 1 NOP cycles */
.ebu_mode_register_set_up_time = 0x0U,
/**< (CRFSH) Number of refresh commands issued during powerup init sequence: Perform CRFSH + 1 refresh cycles */
.ebu_init_refresh_commands_counter = 0x0AU,
/**< Number of clock cycles between row activate command and a precharge command */
.ebu_row_precharge_delay_counter = 0x03U,
.ebu_sdram_burst_length = XMC_EBU_SDRAM_BURST_LENGTH_1_LOCATION,
.ebu_sdram_casclk_mode = 0x3U,
.ebu_sdram_cold_start = 0x1U,
.ebu_sdram_self_refresh_exit = true,
.ebu_sdram_num_refresh_counter_period = 0x2U,
.ebu_sdram_num_refresh_cmnds = 0x1U,
.ebu_sdram_auto_refresh = 0x1U,
.ebu_sdram_self_refresh_exit_delay = 0xFFU,
.ebu_sdram_auto_self_refresh = 0x01U,
.ebu_sdram_delay_on_power_down_exit = 0x07U
};
Show Less
Dear Sir
I would like to confirm the configuration of XMC's High Precision Oscillator Circuit (OSC_HP).
Is it allowed to use XTAL2 as GPIO in direct clock input mode?
Or should XTAL2 always be open?
Show LessHey Guys,
I hope you have a nice Time!
I'm a complete beginner with EtherCAT and don't have much experience with microcontrollers.
I have a Question: I have downloaded XMC4800_Relax_EtherCat_APP_Slave_SSC Example Code and am reading and doing ''the Getting started guide'' step by step related to this example project. Now i am in page 22. After building the Project of ''XMC4800_Relax_EtherCat_APP_Slave_SSC Example Code'' i've got the Warnings as below
It is really nice if someone explain me what are these Warnings of Overflows and how should i solve them. The others are clear. i just want to know about the Overflows.
Best regards!
Show Less