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

I need the XMC4700 example of posif based on XMC lib

$
0
0
I have done the part of CCU8 and i use it to generate the spwm waveform. Now i don not know how to use the posif . i plan to use it to get the Rotating speed of the motor, but i don't know how to config the input of the posif.(i want to config A B Index with P5.0 P5.1 P5.2),and how to connet it with CCU4.i
i look for it in xmc_posif.h,but i don not which function can help me config the input and output of posif.

QSPI code for TC399

$
0
0
HI,


I am using HI TECH compiler.

Porting Open-Source-Software-Stack for TPM 2.0

$
0
0
Hello,

an article on the Infineon website announced that there is an Open-Source-Software Stack for the development of TPM 2.0 based embedded systems available on github.

https://www.infineon.com/cms/de/abou...01808-075.html

The article also describes, that there will be a version of the stack for Arduino based microcontrollers. Do you know when this version will be published?

My second question is whether it is also possible to port the stack on a MSP430 based microcontroller?

Regards

Jan

Triggering core 1 or 2 using HighTec Compiler in TC297-B

$
0
0
Hi,

I am using HighTec compiler to develop applications on top of TC297-B mircrocontroller. The problem I am facing is I am unable to activate core 1 or 2 from core 0. I used the following line to set core 1 or 2 CPUx_DBGSR.B.HALT=2; but corers are not activated. So could you please assist in what I am missing. Also, how to place conditions in startup code to activate the cores.

If any inputs on integration of FreeRTOS with TC297 will be helpful.

Many Thanks,
Kumaresh

iLLD files for TC297

$
0
0
Hi,

Could anyone please share link to download iLLD files for TC297.

Thanks,
Kumaresh

POSIF start error

$
0
0
Is there any workaround? What have we do wrong?

Maximum current of IR2110

$
0
0
Hi,

This is kind of a silly question but, i need to design an h bridge for a motor of 10A and 48V.

Accordding to the datasheet the maximum current the IR2110 is capable of delivering its just 2.5A.

So my question is, this current is just the current for turning on and off the mosfets not the current going through the MOSFETS, right?

Any advice on how to design the bridge?

Thank you in advance.

Sense2Go Range finder FMCW


Sense2GoL Implementing FMCW

TC234: QPSI Parity bit question

$
0
0
A couple of months late answer, but at least I have solved the issue now.
As cwunder wrote, yes PARTYP shall be zero to get odd parity.
But the big problem for me was how I packed the data into the DATAENTRY register.
Before I had one bit reserved for the parity bit, but when I removed that bit and shifted everything the HW parity bit calculation started to work.

How to enable FPU instructions?

$
0
0
Hi everyone,

I'm struggeling with a project on a XMC4400 device in DAVE and naturally I want tu use the FPU. I turned on the full hardware floating point ABI.

The compiler is called with the flags -mfloat-abi=hard and -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 - which initially looks good to my limited experience.
However, looking into the included header files by Infineon, in "core_cm4.h" I would find the following lines:

Code:

#if defined ( __CC_ARM )

[...]

#elif defined ( __GNUC__ )
  #if defined (__VFP_FP__) && !defined(__SOFTFP__)
    #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
      #define __FPU_USED      1U
    #else
      #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
      #define __FPU_USED      0U
    #endif
  #else
    #define __FPU_USED        0U
  #endif

Performing workspace-wide searches, there is not a single line in the entire workspace defining __GNUC__ nor __VFP_FP__ nor __SOFTFP__ - only __FPU_PRESENT is true.
Therefore, this code will define __FPU_USED as false - which is precisely what I don't want.

Does anybody have a clue how to fix this issue?

Best regards
Niklas

ETHCAT_SSC_XMC48 Example: Set I/Os scripting in TwinCAT3

$
0
0
Hey everyone,

I'm currently implementing the mentioned example and I'm wondering if I can set the value of the dimmable or the other lights with a script so I don't have to do the changes manually inside the TwinCAT EtherCAT Master.

Does anyone know if it's possible and how to control the EtherCAT Master in TwinCAT with a script?

Attachment 3992

For better understanding: I want to control the IN_GENERIC and OUT_GENERIC of Box 1.

Kind regards,
Marc
?????

SPI communication

$
0
0
Hi all!

I'm using the XMC4800 Relax Kit V1 and i'm trying to communicate with the N25q032 flash memory using USIC functions (i don't want to use the SPI_MASTER Dave app).

I want to send the WriteEnable command to the flash and read its status (2 if it's right)..
I'm new to Dave, so i can't understand what should i add to my code to make it work...any help will be appreciated!

Here my code:


#include <Dave.h>
#include "xmc_spi.h"
#include "xmc_gpio.h"

#define SPI_MISO P4_6
#define SPI_MOSI P4_7
#define SPI_SCLK P4_2
#define SPI_SS P4_3

const XMC_SPI_CH_CONFIG_t spi_config =
{
.baudrate = 10000000,
.bus_mode = XMC_SPI_CH_BUS_MODE_MASTER,
.parity_mode = XMC_USIC_CH_PARITY_MODE_NONE
};





int main(void)
{

uint16_t tmp;


XMC_GPIO_CONFIG_t gpio_config;

XMC_SPI_CH_Init(XMC_SPI2_CH1, &spi_config);


gpio_config.mode = XMC_GPIO_MODE_INPUT_TRISTATE;
XMC_GPIO_Init(SPI_MISO, &gpio_config);
XMC_SPI_CH_SetInputSource(XMC_SPI2_CH1, XMC_SPI_CH_INPUT_DIN0, USIC2_C1_DX0_P4_6);

XMC_SPI_CH_SetWordLength(XMC_SPI2_CH1, 8);
XMC_SPI_CH_SetFrameLength(XMC_SPI2_CH1, 8);


XMC_SPI_CH_ConfigureShiftClockOutput(XMC_SPI2_CH1, XMC_SPI_CH_BRG_SHIFT_CLOCK_PASSIVE_LEVEL_1_DELAY_D ISABLED, XMC_SPI_CH_BRG_SHIFT_CLOCK_OUTPUT_SCLK); // CPOL=1, CPHA=0

XMC_SPI_CH_Start(XMC_SPI2_CH1);

gpio_config.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH;
gpio_config.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL;
XMC_GPIO_Init(SPI_SS, &gpio_config);

gpio_config.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL | P4_7_AF_U2C1_DOUT0;
XMC_GPIO_Init(SPI_MOSI, &gpio_config);

gpio_config.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL | P4_2_AF_U2C1_SCLKOUT;
XMC_GPIO_Init(SPI_SCLK, &gpio_config);




while(1U)
{
XMC_GPIO_SetOutputLow(SPI_SS);

XMC_SPI_CH_EnableSlaveSelect(XMC_SPI2_CH1, XMC_SPI_CH_SLAVE_SELECT_0);
XMC_SPI_CH_SetTransmitMode(XMC_SPI2_CH1, XMC_SPI_CH_MODE_STANDARD);
XMC_SPI_CH_Transmit(XMC_SPI2_CH1, 0x06, XMC_SPI_CH_MODE_STANDARD);

//Wait till the byte has been transmitted
while((XMC_SPI_CH_GetStatusFlag(XMC_SPI2_CH1) & XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION) == 0U);
XMC_SPI_CH_ClearStatusFlag(XMC_SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION);



while(((XMC_SPI_CH_GetStatusFlag(XMC_SPI2_CH1) & XMC_SPI_CH_STATUS_FLAG_RECEIVE_INDICATION) == 0U) && ((XMC_SPI_CH_GetStatusFlag(XMC_SPI2_CH1) & XMC_SPI_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICAT ION) == 0U));



XMC_SPI_CH_DisableSlaveSelect(XMC_SPI2_CH1);
XMC_GPIO_SetOutputHigh(SPI_SS);





XMC_GPIO_SetOutputLow(SPI_SS);

XMC_SPI_CH_EnableSlaveSelect(XMC_SPI2_CH1, XMC_SPI_CH_SLAVE_SELECT_0);
XMC_SPI_CH_ClearStatusFlag(XMC_SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_RECEIVE_INDICATION);
XMC_SPI_CH_ClearStatusFlag(XMC_SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICAT ION);


XMC_SPI_CH_SetTransmitMode(XMC_SPI2_CH1, XMC_SPI_CH_MODE_STANDARD);
XMC_SPI_CH_Transmit(XMC_SPI2_CH1, 0x05, XMC_SPI_CH_MODE_STANDARD);

//Wait till the byte has been transmitted
while((XMC_SPI_CH_GetStatusFlag(XMC_SPI2_CH1) & XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION) == 0U);
XMC_SPI_CH_ClearStatusFlag(XMC_SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION);


while((XMC_SPI_CH_GetStatusFlag(XMC_SPI2_CH1) && XMC_SPI_CH_STATUS_FLAG_RECEIVE_INDICATION == 0U) && (XMC_SPI_CH_GetStatusFlag(XMC_SPI2_CH1) && XMC_SPI_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICAT ION == 0U));
XMC_SPI_CH_ClearStatusFlag(XMC_SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_RECEIVE_INDICATION);
XMC_SPI_CH_ClearStatusFlag(XMC_SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICAT ION);




//*******************receive********************

XMC_SPI_CH_Receive(XMC_SPI2_CH1, XMC_SPI_CH_MODE_STANDARD);


while((XMC_SPI_CH_GetStatusFlag(XMC_SPI2_CH1) && XMC_SPI_CH_STATUS_FLAG_RECEIVE_INDICATION == 0U) && (XMC_SPI_CH_GetStatusFlag(XMC_SPI2_CH1) && XMC_SPI_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICAT ION == 0U));
XMC_SPI_CH_ClearStatusFlag(XMC_SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_RECEIVE_INDICATION);
XMC_SPI_CH_ClearStatusFlag(XMC_SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_ALTERNATIVE_RECEIVE_INDICAT ION);

tmp = XMC_SPI_CH_GetReceivedData(XMC_SPI2_CH1);

XMC_SPI_CH_DisableSlaveSelect(XMC_SPI2_CH1);
XMC_GPIO_SetOutputHigh(SPI_SS);


if(tmp == 0x0002)
DIGITAL_IO_SetOutputHigh(&led);
else
DIGITAL_IO_SetOutputLow(&led);






}
}

XMC4200 hexagon kit UART with XMClib

$
0
0
Hi, reyntjensm

I was trying to use your code on my distance2go kit but unfortunately it does not work.
Did you have change anything else on your code?
this is my code:
#include "config_error.h"
#include "defines.h"
#include "fw_version.h"
#include "Protocol.h"

#include "EndpointRadarBase.h"
#include "EndpointRadarADCXMC.h"
#include "EndpointRadarDoppler.h"
#include "EndpointRadarIndustrial.h"
#include "EndpointCalibration.h"
#include "EndpointTargetDetection.h"
#include <xmc_gpio.h>
#include <xmc_uart.h>

#define TICKS_PER_SECOND 1000
#define TICKS_WAIT 1000


const uint8_t message[] = "Hello world!!\n";
#define KNOP1 P14_7
#define LED1 P2_1
#define UART_TX P1_5
#define UART_RX P1_4
/*
uint16_t firmware_version[3] =
{
FW_VERSION_MAJOR,
FW_VERSION_MINOR,
FW_VERSION_REVISION
};

Firmware_Information_t firmware_information =
{
"Distance2Go BGT24MTR11 Demo Radar Board",
FW_VERSION_MAJOR,
FW_VERSION_MINOR,
FW_VERSION_REVISION
};
XMC_GPIO_CONFIG_t uart_tx =
{
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT2,
.output_strength = XMC_GPIO_OUTPUT_STRENGTH_MEDIUM
};

XMC_GPIO_CONFIG_t uart_rx =
{
.mode = XMC_GPIO_MODE_INPUT_TRISTATE
};

XMC_GPIO_CONFIG_t led =
{
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL,
.output_strength = XMC_GPIO_OUTPUT_STRENGTH_MEDIUM
};*/

XMC_UART_CH_CONFIG_t uart_config =
{
.data_bits = 8U,
.stop_bits = 1U,
.baudrate = 115200U
};

//====================== Radar Base API ============================

Radar_Handle_t h_radar_device;

Device_Info_t s_device_info;

Frame_Info_t s_frame_info;

/*
================================================== ============================
3. MAIN METHOD
================================================== ============================
*/
unsigned long timingdelay, adc_result;
void ADC0_Init(void);
void Delay100US (unsigned long time);
void SysTick_Handler(void);


int main(void)
{
DAVE_STATUS_t status;

dma_init(); // need to call before Dave_Init() to set DMA controller

//-------------------------------------------------------------------------------

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

}
}
/* Setup the system timer to tick every 100us */
SysTick_Config(SystemCoreClock / TICKS_PER_SECOND);

/*conf uart channel */
XMC_UART_CH_Init(XMC_UART0_CH0, &uart_config);
XMC_UART_CH_SetInputSource(XMC_UART0_CH0, XMC_UART_CH_INPUT_RXD, USIC0_C0_DX0_P1_4);

/*start uart channel*/
XMC_UART_CH_Start(XMC_UART0_CH0);

/*config pins */

XMC_GPIO_CONFIG_t configTX;
configTX.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT2;
XMC_GPIO_Init(UART_TX, &configTX);

XMC_GPIO_CONFIG_t configRX;
configRX.mode = XMC_GPIO_MODE_INPUT_TRISTATE;
XMC_GPIO_Init(UART_RX, &configRX);

XMC_GPIO_CONFIG_t configOUTPUT;
configOUTPUT.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL;
configOUTPUT.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH;
configOUTPUT.output_strength = XMC_GPIO_OUTPUT_STRENGTH_MEDIUM;
XMC_GPIO_Init(LED1,&configOUTPUT);

XMC_GPIO_CONFIG_t configINPUT;
configINPUT.mode = XMC_GPIO_MODE_INPUT_TRISTATE;
XMC_GPIO_Init(KNOP1, &configINPUT);

while(1)
{
/*loop*/

if(XMC_GPIO_GetInput(KNOP1)==0)
{
XMC_GPIO_ToggleOutput(LED1);
Delay100US(5000);
}
}

/* Send a message via UART periodically */

while(1)
{

}
//-------------------------- open device and init radar base API ------------------------------

radar_open_device(0, &h_radar_device);

radar_get_device_info(h_radar_device, &s_device_info);

Endpoint_t endpoint_list[] =
{
EP_RADAR_BASE_ENDPOINT_LIST_ENTRY(h_radar_device),

EP_RADAR_ADCXMC_ENDPOINT_LIST_ENTRY(h_radar_device ),

EP_RADAR_DOPPLER_ENDPOINT_LIST_ENTRY(h_radar_devic e),

EP_RADAR_INDUSTRIAL_ENDPOINT_LIST_ENTRY(h_radar_de vice),

EP_CALIBRATION_ENDPOINT_LIST_ENTRY(h_radar_device) ,

EP_TARGET_DETECTION_ENDPOINT_LIST_ENTRY(h_radar_de vice)
};

protocol_init(endpoint_list, sizeof(endpoint_list)/sizeof(Endpoint_t), SYSTIMER_GetTime, HOST_TIME_OUT, system_reset);

algo_init();

radar_start();

while(1U)
{
if (g_usb_init == true)
{
protocol_run();
}
else
{
usb_init(1);
}
}
}

void SysTick_Handlerr (void) // SysTick Interrupt Handler
{
uint32_t index;
static uint32_t ticks = 0;
ticks++;

if(ticks == TICKS_WAIT)
{
for(index = 0; index < sizeof(message) - 1; index++)
{
XMC_UART_CH_Transmit(XMC_UART0_CH0, message[index]);
}
ticks = 0;
}

if(timingdelay != 0x00){
timingdelay--; //Decrease the time counter timingdelay
}

}
void Delay100US (unsigned long time)
{
timingdelay = time;
while (timingdelay != 0); //timingdelay is modified upon a system timer overflow in SysTick_Handler routine
}

tnx'

Meni

Data Padding/alignment

$
0
0
Hi!
I'm working with the xmc4800 automation board and in my object dictionary i've created several output objects (as record type) with 16 boolean entries and others output objects with 8 boolean entries. I know that i have to introduce padding for the 8bit objects, but when i do it i receive an output mapping error when i connect the board to Ethercat.
Is there a correct way to pad/align objects?

Thank you for any help

EVAL BGT24LTR11 BOARD FMCW mode

$
0
0
Hello,
I am working with the EVAL BGT24LTR11 BOARD. It works fine in Doppler mode but I am noticing some problems when configured to FMCW mode.
I applied a sawtooth signal at the Vtune pin with a period of 1 ms and an amplitude from 1.3 V to 1.7 V in order to have 200-250 MHz of bandwidth. I have made different tests both connecting antennas to the TX and RX pins or connecting together the TX and RX pins by means of a cable and an attenuator in order to exclude possible problems caused by the antennas.
At IF, using I see different peaks with a spacing of 1 KHz. I am getting a bit confused because I worked in a similar way with the BGTMTR11 chip but I had not the same issues.
The peaks in my opinion are due to some crosstalk from the sawtooth signal but anyway I don't know how to solve.
Someone succesfully used this evaluation board in FMCW mode?
Thanks in advance

TLE7242 dither waveform problem

$
0
0
Hi all,

I can set and see differences betwen old and new setpoint value, KP/KI value, Main Freq,
But, when I set dither value (Msg#3, Msg#4), and enable dither (Msg#3), I could not see difference between old and new curve, curve is seen the same on the oscilloscope screen.
Also I set different values to see dither wave, but I cannot.

Do you know why? and Could you send me curve shot with dither and wthout dither?


example used data is below what I used;

cyristal (SCK): 40MHz
Main period set (Msg#1) : 1250 , 1kHz is ok
setpoint value : 245 -> 319mA // it is ok
dither step size(Msg#3) : 15
dither enable(Msg#3) : 1
Dither period set (Msg#4) : 4

spi sending data(Msg#3) : 0x8C80F8F5
spi sending data(Msg) :0x90000004
spi clk: 10MHz

Thank you for your help,

BR
rtoprak

Unable to SET CCE bit of CAN register CCCR

$
0
0
HI,

I am working on TC387 AURIX microcontroller.

During my CAN initialization, After setting my INIT bit to 1, when I try to set the CCE bit to 1, I am not able to do it.
After each setting each INIT and CCE bit to 1, I have a while loop which move forward only if respective bit is set to 1.
my INIT bit is able to set and my while loop code moves forward to set CCE bit, but is never able to move ahead of my CCE bit set while loop, i.e. my CCE bit is never getting set.
Is CCE bit write protected? If yes, what is the procedure to make it write accessible? Also Is there any other register that need to be set for CAN before setting CCCR register (INIT and CCE bit)?

HYBRID KIT DRIVE SENSE With PMDC Motor

$
0
0
Is it possible to configure the HYBRID KIT DRIVE SENSE evaluation kit to work with a PMDC motor?
Ideally with resolver feedback?

Any pointers would be greatly appreciated.

Receiving an SIGTRAP while debugging

$
0
0
Hi There,
I am using xmc4500 interfacing with tft display.
in debugging i am getting this message
Program received signal SIGTRAP, Trace/breakpoint trap.
0x080011ca in XMC_USIC_CH_GetTransmitBufferStatus (channel=0x40030000) at C:/Workspaces/DAVE-4.4.2-64Bit/oily/Libraries/XMCLib/inc/xmc_usic.h:1183
1183 {

what does this means?
Viewing all 9892 articles
Browse latest View live


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