XMC™ Forum Discussions
Hello
I received a XMC 1300 CPU Board and it works correctly. I've changed de BMI value from SWD0 to SPD0, after that I can't communicate with the target because J-link says that it's impossible to connect to target.
I have proved all the solutions explained in this forum:
- Get/Set BMI value using a 8-pin cable with DAVE.
- Change BMI value using J-Link Command.
- Using XMC Flasher.
- Check the board is powered correctly.
After all the test I still can't change BMI Mode. Could give help me to get comunication with the target again ?. I've attached all the pictures of my errors.
Best Regards, Pablo
Show Less
Hi, All
My customer is considering using a TI FIFO (TL16C754B) with the XMC4700.
Checking the datasheet, it seems that the min of T7h is 0, while the min of t2 of XMC4700 is -2ns, so it is not possible to read.
(Could you please refer to the attached document for details.: Interface_with_TI_FIFO_(TL16C754B).pdf )
Could you tell me if it is possible to interface with tl16c754?
Best Regards,
Show LessI have got a custom board with a XMC4500 that has been working for months. But suddenly yesterday the debugger was not able to program or erase the Flash anymore.
I am using the Keil ULinkPro (and a J-Link) debugger with the Keil µVision environment.
When I try to start a debug session I get a "SWD communication" error. I have checked the supply voltages, Reset signal and the TCK and TMS signals.
If I connect the debugger without programming the Flash that works and I can see the Flash memory is all set to zero. The Program Counter is in an endless loop on address 0x000000E6, which must be somewhere in the Boot ROM. Communication between the debugger and Controller works correctly, I can single step and look at the Peripherial and memory.
But I cannot load any code! If I enter the "LOAD" command in the command window, nothing happens. The flash is not programmed and there is no error message.
I have checked all the protection registers for the Flash and nothing is set.
How can I get the Controller out of this state or at least see what the problem is? How can the controller get into this state? I really need to get the system running again.
Show LessDoes a reference application exist (where can I find it) for Vital signs monitoring using sense2gol demo?
I downloaded 200W transmitter firmware of 200W Wireless Power Kit of Würth Elektronik and tested UART.
Firmware link
(https://www.we-online.com/en/support/kits-boards/200-w-wireless-power-kit)
In debug mode, UART transmission and reception was confirmed using the serial program. However, it did not work well when the code was uploaded and not in debug mode.
It is expected to be a compiler(Dave) issue.
1. Errors may occur during the process of optimizing each function.
2. Is there a difference in the time interval between interrupts in debug and non-debug mode?
Compiler version : dave 4.5.0
MCU : XMC1302-T038X0064 AB.
Anything you can do to help will be greatly appreciated.
Show Less
This is code for TSSOP this code is for XMC1300 driver card. TSSOP38
1. What is the cause of getting the issue ?
2. What is correct code for recieving the data byte ?
/*This is code to read the values from pressure sensor(BMP280)
The SDA and SCL pins are pull up using 4.7k ohms
channel = channel 0
*/
/*********************************************************************************************************************
* HEADER FILES
********************************************************************************************************************/
#include <XMC1300.h>
#include <xmc_i2c.h>
#include <xmc_gpio.h>
#include <string.h>
#include <stdint.h>
#include <xmc_scu.h>
#include "xmc_common.h"
/*********************************************************************************************************************
* MACROS
*********************************************************************************************************************/
#define I2C_CH_NUM XMC_I2C0_CH0
#define SDA_PIN P2_1
#define SCL_PIN P2_0
#define LED1 P0_4
#define SLAVE_ID (0xEC)
#define RegisterAddress 0xD0
/*********************************************************************************************************************
* DATA STRUCTURES
*********************************************************************************************************************/
/* IIC configuration */
XMC_I2C_CH_CONFIG_t i2c_cfg =
{
.baudrate = 400000U,
.address = EEPROM_I2C_ADR
};
/* IIC SDA and SCL Pins */
XMC_GPIO_CONFIG_t i2c_sda =
{
.mode = XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN_ALT6,
.output_level= XMC_GPIO_OUTPUT_LEVEL_HIGH,
};
XMC_GPIO_CONFIG_t i2c_scl =
{
.mode = XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN_ALT7,
.output_level= XMC_GPIO_OUTPUT_LEVEL_HIGH,
};
/* GPIO LED pin configuration */
XMC_GPIO_CONFIG_t LED_pin_config =
{
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL,
};
XMC_USIC_CH_t *i2c = I2C_CH_NUM;
XMC_SCU_CLOCK_CONFIG_t clock_config;
/*********************************************************************************************************************
* GLOBAL VARIABLES
*********************************************************************************************************************/
uint8_t ReceivedData[3];
/*********************************************************************************************************************
* APPLICATION CODE
*********************************************************************************************************************/
uint8_t RecieveByte(void)
{
uint16_t Data[3];
/* Read received data */
for (volatile uint8_t gu8Index = 0; gu8Index <3; gu8Index++){
Data[gu8Index] = XMC_USIC_CH_RXFIFO_GetData(I2C_CH_NUM);
}
return 0;
}
void Init_I2C(void) {
/* Configure Clock */
clock_config.pclk_src=XMC_SCU_CLOCK_PCLKSRC_MCLK; /*PCLK = MCLK*/
clock_config.rtc_src=XMC_SCU_CLOCK_RTCCLKSRC_DCO2;
clock_config.fdiv = 0; /**< Fractional divider */
clock_config.idiv = 1; /**MCLK = 32MHz */
XMC_SCU_CLOCK_Init(&clock_config);
for (volatile uint8_t gu8Index = 0; gu8Index < 10; gu8Index++);
/* Configure LED1 */
XMC_GPIO_Init(XMC_GPIO_PORT0, 4, &LED_pin_config);
XMC_I2C_CH_Init(I2C_CH_NUM, &i2c_cfg);
XMC_I2C_CH_Start(i2c);
/* I2C initialization sequence*/
XMC_I2C_CH_SetInputSource(i2c, XMC_I2C_CH_INPUT_SDA, 5); //DX0 -> DOUT0 USIC0_C0_DX0_P1_5 P1_5_AF_U0C0_DOUT0
XMC_I2C_CH_SetInputSource(i2c, XMC_I2C_CH_INPUT_SCL, 4); //DX1 -> SCLKOUT USIC0_C1_DX1_P1_4 P1_4_AF_U0C1_SCLKOUT
// 8 entries for TxFIFO from point 0, LIMIT=1
XMC_USIC_CH_TXFIFO_Configure(I2C_CH_NUM, 0,XMC_USIC_CH_FIFO_SIZE_8WORDS, 1);
// 8 entries for RxFIFO from point 16, LIMIT=7 (SRBI is set if all 8*data has been received)
XMC_USIC_CH_RXFIFO_Configure(I2C_CH_NUM, 8,XMC_USIC_CH_FIFO_SIZE_8WORDS, 7);
/* I2C port pin configuration*/
XMC_GPIO_Init(SDA_PIN, &i2c_sda);
XMC_GPIO_Init(SCL_PIN, &i2c_scl);
}
int main(void) {
uint8_t ReceivedData1[4];
Init_I2C();
/* Send START conditon */
XMC_I2C_CH_MasterStart(I2C_CH_NUM,SLAVE_ID, XMC_I2C_CH_CMD_WRITE);
/* Wait for acknowledge and reset status */
while((XMC_I2C_CH_GetStatusFlag(I2C_CH_NUM) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 0U)
{
/* wait for ACK from slave */
}
XMC_I2C_CH_ClearStatusFlag(I2C_CH_NUM,(uint32_t)XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED);
/* Transmit next command from I2C master to I2C slave */
XMC_I2C_CH_MasterTransmit(I2C_CH_NUM, RegisterAddress);
/* Wait for acknowledge and reset status */
while((XMC_I2C_CH_GetStatusFlag(I2C_CH_NUM) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 0U)
{
/* wait for ACK from slave */
}
XMC_I2C_CH_ClearStatusFlag(I2C_CH_NUM,(uint32_t)XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED);
/* Wait until TX FIFO is empty */
while (!XMC_USIC_CH_TXFIFO_IsEmpty(I2C_CH_NUM))
{
/* wait until all data is sent by HW */
}
/* Transmit next command from I2C master to I2C slave */
/* Send STOP conditon */
XMC_I2C_CH_MasterStop(I2C_CH_NUM);
for (volatile uint8_t gu8Index = 0; gu8Index < 5444; gu8Index++);
XMC_I2C_CH_MasterStart(I2C_CH_NUM,SLAVE_ID, XMC_I2C_CH_CMD_READ);
/* Wait for acknowledge and reset status */
while((XMC_I2C_CH_GetStatusFlag(I2C_CH_NUM) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 0U)
{
/* wait for ACK from slave */
}
XMC_I2C_CH_ClearStatusFlag(I2C_CH_NUM,(uint32_t)XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED);
for(volatile uint8_t gu8Index=0;gu8Index <3;gu8Index++ ){
ReceivedData1[gu8Index] =RecieveByte();
}
while (1U){
}
}
Below are obtained output images
Show Less
Hi
I tried to send a remote frame (No Data) to XMC4400 CANbus module. It is no respond, however it respond to data frame (with Data). I would like to that how to configure the module respond to remote frame. FYI...I am using Dave app to generate the code.
Show LessIs there an example program for the XMC using the USB in Host Mode? There is nothing shown in the list of µVision packs.
I am using the XMC4500, but an example for any of the XMC family would be helpful.
My aim is to connect a barcode scanner or keyboard to the XMC.
Show LessI have got a XMC4500 that I can put into hibernation, but it does not come out of hibernation.
I have the following configuration:
- External voltage regulator with active high enable connected to HIB_IO_1 with a voltage divider (as in Figure 10 of the "Hibernate Device Guide" Application Note document).
- The RTC is configured to alarm after 1 minute. The ENB and TAE bits of the CTR register are set. I have also tried setting the MAI bit of the MSKSR register, but it made no change.
- HIB_IO_0 is set to input with pull-up (0x02), HIBIO0POL is set to direct value (0x00) and WKUPSEL is set to HIB_IO_0 (0x01).
- The enable bit WKPEN and RTCR are both set
- The hibernation domain is enabled.
I can enter the hibernation mode and I expect to restart if either the HIB_IO_0 is pulled low or the 1 minute passes. But nothing happens, it just remains in hibernation mode.
What could be the problem? Does anyone have a working example?
Show Less