Quantcast
Channel: Infineon Forums
Viewing all 9892 articles
Browse latest View live

I2C to EEPROM memory, XMClib and XMC1300

$
0
0
Hello,

i changed the software parts DRubeša and now i cant see the signals with the osciloscope.

Attachment 2840

there is the full signal of EEPROM_SendByte() function.

this new program can exit from this function, i think something is bad. Can someone help?

This is my code:

#include "xmc_scu.h"
#include "xmc_gpio.h"
#include "xmc_i2c.h"


#define EEPROM_I2C_ADR 0xA1

#define SDA_PIN P0_7
#define SCL_PIN P0_8

void Init_I2C (void);
void EEPROM_SendByte (uint8_t MemoryAddress, uint8_t DataToSend);
uint8_t EEPROM_ReadByte (uint8_t MemoryAddress);

uint8_t ReceivedData;

XMC_SCU_CLOCK_CONFIG_t clock_config;

XMC_GPIO_CONFIG_t led1_config;

XMC_GPIO_CONFIG_t sda_pin_config;
XMC_GPIO_CONFIG_t scl_pin_config;

/* I2C configuration */
XMC_USIC_CH_t *i2c = XMC_I2C0_CH1;

XMC_I2C_CH_CONFIG_t i2c_cfg;

void Init_I2C (void){
/* Configure Clock */
clock_config.pclk_src = XMC_SCU_CLOCK_PCLKSRC_MCLK; /*PCLK = MCLK*/
clock_config.fdiv = 0; /**< Fractional divider */
clock_config.idiv = 0; /**MCLK = 32MHz */

XMC_SCU_CLOCK_Init(&clock_config);

/* Configure LED1 */
led1_config.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL;
XMC_GPIO_Init(XMC_GPIO_PORT0,6, &led1_config);

/* I2C configuration */
i2c_cfg.baudrate = 320000U;

XMC_I2C_CH_Init(i2c, &i2c_cfg);
XMC_I2C_CH_Start(i2c);

/* I2C initialization sequence*/
XMC_I2C_CH_SetInputSource(i2c, XMC_I2C_CH_INPUT_SDA , USIC0_C1_DX0_P0_7);
XMC_I2C_CH_SetInputSource(i2c, XMC_I2C_CH_INPUT_SCL , USIC0_C1_DX1_P0_8);

/* I2C port pin configuration*/
sda_pin_config.mode = XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN_ALT7;
sda_pin_config.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH;
XMC_GPIO_Init(SDA_PIN, &sda_pin_config);
scl_pin_config.mode = XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN_ALT7;
scl_pin_config.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH;
XMC_GPIO_Init(SCL_PIN, &scl_pin_config);

}


void EEPROM_SendByte (uint8_t MemoryAddress, uint8_t DataToSend){
XMC_I2C_CH_MasterStart(i2c, EEPROM_I2C_ADR, XMC_I2C_CH_CMD_WRITE); // I2C send repeated start command (with slave address) to write Data to PCA9502
while((XMC_I2C_CH_GetStatusFlag(i2c) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 1U){} // wait until ACK
XMC_I2C_CH_ClearStatusFlag(i2c, XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED); // clear ACK flag in register PSR

XMC_I2C_CH_MasterTransmit(i2c, MemoryAddress); // I2C send
while((XMC_I2C_CH_GetStatusFlag(i2c) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 1U){} // wait until ACK
XMC_I2C_CH_ClearStatusFlag(i2c, XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED);

XMC_I2C_CH_MasterTransmit(i2c, DataToSend); // I2C send TxData=IO_STATE
while((XMC_I2C_CH_GetStatusFlag(i2c) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 1U){} // wait until ACK
XMC_I2C_CH_ClearStatusFlag(i2c, XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED);

XMC_I2C_CH_MasterStop(i2c);
}

uint8_t EEPROM_ReadByte (uint8_t MemoryAddress){
uint8_t data = 0;

XMC_I2C_CH_MasterStart(i2c, EEPROM_I2C_ADR, XMC_I2C_CH_CMD_WRITE); // I2C send repeated start command (with slave address) to write Data to PCA9502
while((XMC_I2C_CH_GetStatusFlag(i2c) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 1U){} // wait until ACK
XMC_I2C_CH_ClearStatusFlag(i2c, XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED); // clear ACK flag in register PSR

XMC_I2C_CH_MasterTransmit(i2c, MemoryAddress); // I2C send
while((XMC_I2C_CH_GetStatusFlag(i2c) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 1U){} // wait until ACK
XMC_I2C_CH_ClearStatusFlag(i2c, XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED); // clear ACK flag in register PSR

XMC_I2C_CH_MasterStop(i2c);

XMC_I2C_CH_MasterStart(i2c, EEPROM_I2C_ADR, XMC_I2C_CH_CMD_READ); // I2C send repeated start command (with slave address) to Read Data from PCA9502
while((XMC_I2C_CH_GetStatusFlag(i2c) & XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED) == 1U){} // wait until ACK
XMC_I2C_CH_ClearStatusFlag(i2c, XMC_I2C_CH_STATUS_FLAG_ACK_RECEIVED); // clear ACK flag in register PSR

XMC_I2C_CH_MasterReceiveNack(i2c); // I2C send dummy with NACK to read only one byte
while((XMC_I2C_CH_GetStatusFlag(i2c) & (XMC_I2C_CH_STATUS_FLAG_RECEIVE_INDICATION |
XMC_I2C_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICAT ION)) == 1U){} // wait until AIR or RI
XMC_I2C_CH_ClearStatusFlag(i2c, XMC_I2C_CH_STATUS_FLAG_RECEIVE_INDICATION |
XMC_I2C_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICAT ION); // clear both AIR and RI

data = XMC_I2C_CH_GetReceivedData(i2c); // get RxData from RBUF

XMC_I2C_CH_MasterStop(i2c);

return data;
}

int main(void)
{
Init_I2C();

while(1U)
{
ReceivedData = 0;
EEPROM_SendByte(0x55, 0x20);
ReceivedData = EEPROM_ReadByte(0x55);
if (ReceivedData==0x20){
XMC_GPIO_ToggleOutput(XMC_GPIO_PORT0,6);
}
}
}

Best regards,
Paul
?????

Configuration settings in IFX configwizard

$
0
0
Hello,

Can anyone please tell me how much voltage and current I should give for activating MOSFET bridge driver in motor control application and ADC 2 channel configuration settings in TLE9879QXA40 board?

Thanks

Port pins

$
0
0
Hi,

I see that P2.0 and P2.1 port pins are assigned for external oscillator and as well as they also assigned for alternate functions like for position detection channel in CCU6 timers in TLE9879xx board, but they are not in the port pins section. Can we solder two hall sensors signal pins out of three hall sensors for the BLDC motor control when we need to take use them as a CPOS (in CCU6) function?Attachment 2843


please check the image I attached in this message.
?????

There is a problem about TC275 CAN FIFO

$
0
0
I have a problem about TC275 CAN FIFO ,
my code about initialize CAN (Fragment):

IfxMultican_Can_MsgObj_initConfig(&canMsgObjConfig , &CanNode0);

canMsgObjConfig.msgObjId = 33;
canMsgObjConfig.msgObjCount = 8;
canMsgObjConfig.firstSlaveObjId = 34;
canMsgObjConfig.messageId = 1;
canMsgObjConfig.acceptanceMask = 0;
canMsgObjConfig.frame = IfxMultican_Frame_transmit;
canMsgObjConfig.control.messageLen = IfxMultican_DataLengthCode_8;
canMsgObjConfig.control.extendedFrame = FALSE;
canMsgObjConfig.control.matchingId = FALSE;

IfxMultican_Can_MsgObj_init(&CanMsgObjTx0, &canMsgObjConfig);

My User Code:

if do this :

for (i = 0; i < 8; i++)
{
while( IfxMultican_Can_MsgObj_sendMessage(&CanMsgObjTx0, &txMsg) == IfxMultican_Status_notSentBusy );
}

It can be transmitted normally !

but if do this :

for (i = 0; i < 4; i++)
{
while( IfxMultican_Can_MsgObj_sendMessage(&CanMsgObjTx0, &txMsg) == IfxMultican_Status_notSentBusy );
}

It can only be transmitted once ,the second time be transmitted is failed !
It can not be sent continuously.

Does anyone have this problem, who can help me?

Four SPI and two UART Channels in a single XMC1302

$
0
0
Why not verifying it on your own XMC13x board?

DAVE debug problem, XMC4800

$
0
0
hi,
i too face the same problem

in my case debug terminated.when i am starting.
the reset option not active..
if there is any other way.

please help me to debug...
thankyou

Secure Bootloader Initialisation Time

$
0
0
Hi,

Can someone please help me with a contact (email and telephone) with regards to security requirement to have the lowest secure bootloader intialisation time on a project we are currently working? Many thanks.

Best regards,
Jerome Law
+44 7979 993377

Multiple Communication in XMC1302

$
0
0
In my application, I want to use two UARTs, two I2Cs and one SPI Module in a single XMC1302. Please find attached herewith my project SMC.zip. I have following queries:
1. How can I utilize two USIC channels to get 5 USIC modules to work?
2. I found that every DAVE App of above modules has DeInit function blank. Why is it so? How can I, let's say use two I2Cs on one by one on a single channel?
?????

XMC1302 Flash Write, ERASE problems

$
0
0
Maybe important to mention:
The latest user manual (Infineon-xmc1300-AB_rm-UM-v01_02-EN.pdf, page 224) suggests the NVM ERASE, that is not working.
According to the errata sheet this function is faulty and the ROM function should be used instead.

If you want to implement some low-level flash routines use the ROM routine for ERASE!

Tasking Debug Error : No source available for "0x0() "

$
0
0
i too facing the same problem my code is simple as here

i can not enter into debugging at all.
debugging terminated..on execution.

and all debugging options are inactive "step in","step-out","resume" and all
please help me to debug

Code:

#include <DAVE.h>       
int main(void)
{
  DAVE_STATUS_t status;
  int delay_count =0;

  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)
    {

    }
  }

  CAN_NODE_MO_Transmit(&CAN_NODE_0_LMO_01_Config);

  //CAN_NODE_MO_Receive(&CAN_NODE_0_LMO_01_Config);


  /* Placeholder for user application code. The while loop below can be replaced with user application code. */
  while(1U)
  {
          DIGITAL_IO_ToggleOutput(&LED1); //toggles : 1 -> 0 (if initial output level is logic 1)
          //Add application code here
          for(delay_count = 0;delay_count<0xfff;delay_count++);
          DIGITAL_IO_ToggleOutput(&LED1); //toggles : 0 -> 1
          //Add application code here
          for(delay_count = 0;delay_count<0xfff;delay_count++);


  }
}

SPI DMA XMC4400 automatic slave select update

$
0
0
Bumping again. Still waiting for an answer.

Xmc4400 | pwm + dma

$
0
0
Hi,

We want to generate a PWM output signal on one channel without CPU interaction. It can be CCU40 or CCU80, we have no preference.

The setup is:
1) Timer module generates pulses at a certain interval
2) DMA module is triggered by the pulses generated in (1). On every pulse, it transfers a 16-bit value to the PWM period match register.
3) The PWM module is running, but it does not update the period match register.

The problem is the shadow transferring mechanism. I can successfully update the PWM period match register with DMA, but according to the datasheet I also need to manually write to the shadow transfer enable register with the CPU.
Is it possible to trigger a shadow transfer without the need for CPU interaction?

I see that there is a connection between the POSIF module and the shadow transfer enable pin (hardware). Can I use this functionality somehow to address my problem?

The purpose is to play an audio file without CPU interaction.

Thanks
Rickard

FREERTOS App -- MPU support status

$
0
0
Hello Infineon,

i'm curious about the status of MPU support in FREERTOS App.
I just noticed that the actual App supports FreeRTOS V9 - so MPU should be supported.
There's also a checkbox "Enable MPU support".

It doesn't change the linker script automatically, so i changed it manually (according to http://www.freertos.org/FreeRTOS_Sup...U_4709677.html.
Linker script now works without problems.

Compiling results in:

Code:

...
'Building file: ../Dave/Generated/FREERTOS/tasks.c'
'Invoking: ARM-GCC C Compiler'
"C:/DAVEv4-64Bit/DAVE-4.3.2/eclipse/ARM-GCC-49/bin/arm-none-eabi-gcc" -MMD -MT "Dave/Generated/FREERTOS/tasks.o" -DXMC4400_F100x512 -I"D:/tmp/Dave-4.3/FreeRTOS_Dave_Test/Libraries/XMCLib/inc" -I"D:/tmp/Dave-4.3/FreeRTOS_Dave_Test/Libraries/CMSIS/Include" -I"D:/tmp/Dave-4.3/FreeRTOS_Dave_Test/Libraries/CMSIS/Infineon/XMC4400_series/Include" -I"D:/tmp/Dave-4.3/FreeRTOS_Dave_Test" -I"D:/tmp/Dave-4.3/FreeRTOS_Dave_Test/Dave/Generated" -I"D:/tmp/Dave-4.3/FreeRTOS_Dave_Test/Libraries" -Og -ffunction-sections -fdata-sections -Wall -std=gnu99 -mfloat-abi=softfp -Wa,-adhlns="Dave/Generated/FREERTOS/tasks.o.lst" -pipe -c -fmessage-length=0 -MMD -MP -MF"Dave/Generated/FREERTOS/tasks.d" -MT"Dave/Generated/FREERTOS/tasks.d Dave/Generated/FREERTOS/tasks.o" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -g -gdwarf-2 -o "Dave/Generated/FREERTOS/tasks.o" "../Dave/Generated/FREERTOS/tasks.c"
'Finished building: ../Dave/Generated/FREERTOS/tasks.c'

'Building target: FreeRTOS_Dave_Test.elf'
'Invoking: ARM-GCC C Linker'
"C:/DAVEv4-64Bit/DAVE-4.3.2/eclipse/ARM-GCC-49/bin/arm-none-eabi-gcc" -T"../linker_script.ld" -nostartfiles -Xlinker --gc-sections -specs=nano.specs -specs=nosys.specs -Wl,-Map,"FreeRTOS_Dave_Test.map" -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -mthumb -g -gdwarf-2 -o "FreeRTOS_Dave_Test.elf" "@objects.rsp"  -lm
makefile:58: recipe for target 'FreeRTOS_Dave_Test.elf' failed
./main.o: In function `led_task':
D:\tmp\Dave-4.3\FreeRTOS_Dave_Test\Debug/../main.c:18: undefined reference to `MPU_xTaskGetTickCount'
D:\tmp\Dave-4.3\FreeRTOS_Dave_Test\Debug/../main.c:22: undefined reference to `MPU_vTaskDelayUntil'
./main.o: In function `main':
D:\tmp\Dave-4.3\FreeRTOS_Dave_Test\Debug/../main.c:58: undefined reference to `MPU_xTaskCreate'
collect2.exe: error: ld returned 1 exit status
make: *** [FreeRTOS_Dave_Test.elf] Error 1

Seems like the functions from "FreeRTOSv9.0.0/FreeRTOS/Source/portable/Common/mpu_wrappers.c" are not generated by Dave.

Do i have to copy them manually?
Or maybe is MPU support by FREERTOS App incomplete?

Daniel

C167CR-LM GPT1 Core Timer T3 How does it work?

$
0
0
Hello Everyone,
Apologies upfront, I'm quite new to µcontrollor programming and just started to learn, so i probably got few thinks not right yet.


I've got questions about the T3 Timer. Today at my School I've encountered this timer for the first time but I'm not sure what this
does(we just scratched the Topic). I'm aware that the T3CON register controlles the timer and that this timer can run as simpler counter OR as a Clock.

My confusion starts when i use the Clock with an prescaler. According to the Manual If i have the CPU running at 20 Mhz
and I choose as prescaler a factor of lets say 256 my period will be 840ms with an resolution of 12.8µs. The Input frequency
would be then 78.125kHz.
  • What Number would then stand in the Register T3 every tick?
  • How is the period or where is the period applied to?
  • Where goes the Input frequency into?
  • What does the gated Mode or how does it work?




I hope some of you can enlighten me :)

Xmc4800 - ieee1588

$
0
0
Which version of XMC Lib are you using?

Which configure word do you use to initialize the PTP?
Code:

/**
 * ETH MAC time-stamp configuration enable
 */
typedef enum XMC_ETH_MAC_TIMESTAMP_CONFIG
{
  XMC_ETH_MAC_TIMESTAMP_CONFIG_FINE_UPDATE = ETH_TIMESTAMP_CONTROL_TSCFUPDT_Msk,            /**< Fine update */
  XMC_ETH_MAC_TIMESTAMP_CONFIG_ENABLE_ALL_FRAMES = ETH_TIMESTAMP_CONTROL_TSENALL_Msk,        /**< Enable all frames */
  XMC_ETH_MAC_TIMESTAMP_CONFIG_ENABLE_PTPV2 = ETH_TIMESTAMP_CONTROL_TSVER2ENA_Msk,          /**< PTPV2 */
  XMC_ETH_MAC_TIMESTAMP_CONFIG_ENABLE_PTP_OVER_ETHERNET = ETH_TIMESTAMP_CONTROL_TSIPENA_Msk, /**< PTP over ETH */
  XMC_ETH_MAC_TIMESTAMP_CONFIG_ENABLE_PTP_OVER_IPV6 = ETH_TIMESTAMP_CONTROL_TSIPV6ENA_Msk,  /**< PTP over IPV6 */
  XMC_ETH_MAC_TIMESTAMP_CONFIG_ENABLE_PTP_OVER_IPV4 = ETH_TIMESTAMP_CONTROL_TSIPV4ENA_Msk,  /**< PTP over IPV4 */
  XMC_ETH_MAC_TIMESTAMP_CONFIG_ENABLE_MAC_ADDRESS_FILTER = ETH_TIMESTAMP_CONTROL_TSENMACADDR_Msk /**< MAC address filter */
} XMC_ETH_MAC_TIMESTAMP_CONFIG_t;

void XMC_ETH_MAC_InitPTP(XMC_ETH_MAC_t *const eth_mac, uint32_t config);

Have you tried this?
Code:

void XMC_ETH_MAC_UpdatePTPTime(XMC_ETH_MAC_t *const eth_mac, const XMC_ETH_MAC_TIME_t *const time);

Embed checksum or CRC into image

$
0
0
Is there a way to calculate the checksum or CRC of an image and embed the value into the image so it can be checked by a bootloader when it is downloaded and each time it is executed? I've done this previously with IAR but I cannot find any reference to doing this with DAVE 4.

Problem with XMC4400 and MAX44009 sensor light (I2C)

$
0
0
Observe the signal waveform of both the PI and your XMC4 board using a oscilloscope.
Compare them or post the captures here.

Lwip 2.0.0

$
0
0
I still use the LWIP 1.4.1, which is very stable.

MPU for safety critical application

$
0
0
Hi,

The CPU_CTRL_XMC4 has a tab to configure the MPU.

Regards,
Jesus

I2C to EEPROM memory, XMClib and XMC1300

$
0
0
Hi all

got the same problem, with XMC1300 boot kit

can someone help?
Viewing all 9892 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>