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

how to get 48 bit timer value (CCU4)

$
0
0
Hello
I use 3 concatenated slices of CC40. I need to get the time stamps of 48bit counter periodically.
Of course I can read time value of each slices but if at this time one of the counters overflows i'll get a wrong timestamp.
Now i use timers in compare mode, if I'm not mistaken in capture mode i can to store at the moment time values of each timer(and then read this timestamp), but event connects to defined pin, and in my case i need to get timestamps via application.
Could you help me?

Help with XE167FM

$
0
0
About MCU XE167FM and refered to “User’s Manual XE167xM”:

We need to use the pin P2.9 as address line 22 for external flash memory, at the moment we’re using default setting for JTAG so we’ve this configuration:

Startup configuration (“User’s Manual capitolo 12.3.2):
Startup Mode - Internal Start From Flash
Debug Interface – from Flash
STSTAT.HWCFG Value – 0x07
P10[6:0] = X X X X 1 1 1

JTAG configuration:
P2.9 TCK
P5.4 TMS
P7.0 TDO
P5.2 TDI

We need to preserve every JTAG functionality (Programming, degub, … etc), so we want to swap the P2.9 (used as TCK) with the P8.5, and obtain:

JTAG configuration:
P8.5 TCK
P5.4 TMS
P7.0 TDO
P5.2 TDI

(User’s Manual CAP 12-3) We noticed that there’s a register called DBGPRR that define the JTAG pin configuration.
The questioni is: How we can change in a definitive way this register with the configuration that we need? We tried to find a way from memtool but nothing, same by setup it from firmware.
Thanks everyone.

Uart

$
0
0
Hello everyone,

I have Distance2Go kit and I'm trying to use UART protocol.
I tried to use the code that the company provides but it does not work.
Someone have any code that I can use? Or can see what's wrong in this code?

#include <xmc_gpio.h>
#include <xmc_uart.h>

/* Pins macro definition */

#define LED1 P2_1
#define UART_TX P0_1
#define UART_RX P0_0

/* Number of data to tx/rx and limits for the TX and RX FIFOs */

#define NUM_DATA 25
#define RX_FIFO_INITIAL_LIMIT 7
#define TX_FIFO_INITIAL_LIMIT 1

/* Initialization structures */

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
};

/* Initialization structure for both USIC0_CH0 and USIC0_CH1 channels */
XMC_UART_CH_CONFIG_t uart_config =
{
.data_bits = 8U,
.stop_bits = 1U,
.baudrate = 9600U
};

/* Global variables initialization. Tx and rx indexes and tx and rx arrays */
uint32_t tx_index=0;
uint32_t rx_index=0;
uint8_t tx_data[NUM_DATA];
uint16_t rx_data[NUM_DATA];


/* Transmit handling IRQ */
void USIC0_0_IRQHandler(void)
{
/* If still remaining data to be send */
if(tx_index < NUM_DATA)
{
/* Fill the TX FIFO till it is full */
while(!XMC_USIC_CH_TXFIFO_IsFull(XMC_UART0_CH0))
{
XMC_UART_CH_Transmit(XMC_UART0_CH0, tx_data[tx_index]);
tx_index++;
}
}
}

/* Receive handling IRQ */
void USIC1_1_IRQHandler(void)
{
/* Read the RX FIFO till it is empty */
while(!XMC_USIC_CH_RXFIFO_IsEmpty(XMC_UART1_CH0))
{
rx_data[rx_index++] = XMC_UART_CH_GetReceivedData(XMC_UART1_CH0);
}

/* If all the data have been received */
if(rx_index == (NUM_DATA))
{
/* Check if every received data match with the transmitted data */
for (int tmp=0; tmp<NUM_DATA; tmp++)
{
/* If reception fails stays in an infinite while loop and switch off the LED */
if (tx_data[tmp]!=rx_data[tmp])
{
while(1)
{
XMC_GPIO_SetOutputLow(LED1);
}
}
else
{
/* If reception is successful switch on the LED */
XMC_GPIO_SetOutputHigh(LED1);
}
}
}

/* If the remaining data to be received is smaller than the initial RX FTFO Limit
* it is modified to the remaining data minus 1 in order react when we have all the data received*/
if((NUM_DATA-rx_index) < RX_FIFO_INITIAL_LIMIT)
{
XMC_USIC_CH_RXFIFO_SetSizeTriggerLimit(XMC_UART1_C H0, XMC_USIC_CH_FIFO_SIZE_8WORDS, (NUM_DATA-rx_index)-1);
}
}

int main(void)
{

/* USIC channels initialization */
XMC_UART_CH_Init(XMC_UART0_CH0, &uart_config);
XMC_UART_CH_Init(XMC_UART1_CH0, &uart_config);

/* Input multiplexer configuration for UART1_CH0 */
XMC_UART_CH_SetInputSource(XMC_UART1_CH0, XMC_UART_CH_INPUT_RXD, USIC1_C1_DX0_P0_0);

/* FIFOs initialization for both channels:
* 8 entries for TxFIFO from point 0, LIMIT=1
* 8 entries for RxFIFO from point 8, LIMIT=7 (SRBI is set if all 8*data has been received)
* */
XMC_USIC_CH_TXFIFO_Configure(XMC_UART0_CH0, 0, XMC_USIC_CH_FIFO_SIZE_8WORDS, TX_FIFO_INITIAL_LIMIT);
XMC_USIC_CH_RXFIFO_Configure(XMC_UART1_CH0, 8, XMC_USIC_CH_FIFO_SIZE_8WORDS, RX_FIFO_INITIAL_LIMIT);

/* Enabling events for TX FIFO and RX FIFO */
XMC_USIC_CH_TXFIFO_EnableEvent(XMC_UART0_CH0,XMC_U SIC_CH_TXFIFO_EVENT_CONF_STANDARD);
XMC_USIC_CH_RXFIFO_EnableEvent(XMC_UART1_CH0,XMC_U SIC_CH_RXFIFO_EVENT_CONF_STANDARD |
XMC_USIC_CH_RXFIFO_EVENT_CONF_ALTERNATE);

/* Connecting the previously enabled events to a Service Request line number */
XMC_USIC_CH_TXFIFO_SetInterruptNodePointer(XMC_UAR T0_CH0,XMC_USIC_CH_TXFIFO_INTERRUPT_NODE_POINTER_S TANDARD,0);
XMC_USIC_CH_RXFIFO_SetInterruptNodePointer(XMC_UAR T1_CH0,XMC_USIC_CH_RXFIFO_INTERRUPT_NODE_POINTER_S TANDARD,1);
XMC_USIC_CH_RXFIFO_SetInterruptNodePointer(XMC_UAR T1_CH0,XMC_USIC_CH_RXFIFO_INTERRUPT_NODE_POINTER_A LTERNATE,1);

/* Start USIC operation as UART */
XMC_UART_CH_Start(XMC_UART0_CH0);
XMC_UART_CH_Start(XMC_UART1_CH0);

/*Initialization of the necessary ports*/
XMC_GPIO_Init(UART_TX,&uart_tx);
XMC_GPIO_Init(UART_RX,&uart_rx);
XMC_GPIO_Init(LED1,&led);

/*Configuring priority and enabling NVIC IRQ for the defined Service Request line number */
NVIC_SetPriority(USIC0_0_IRQn,63U);
NVIC_EnableIRQ(USIC0_0_IRQn);
NVIC_SetPriority(USIC1_1_IRQn,62U);
NVIC_EnableIRQ(USIC1_1_IRQn);

USIC1_1_IRQHandler();
/* Filling the tx array */
for (uint32_t i = 0; i < NUM_DATA; i++)
{
tx_data[i]=i;
}

/* Filling the the first time TX FIFO. Successive fillings will be done in the TX FIFO IRQ*/
while(!XMC_USIC_CH_TXFIFO_IsFull(XMC_UART0_CH0))
{
XMC_UART_CH_Transmit(XMC_UART0_CH0,tx_data[tx_index++]);
}


while(1)
{
/* Infinite loop */
}
}
?????

UART Problem

$
0
0
Hi,

I'm using Distance2Go (XMC4200) kit and I'm trying to use UART.
Unfortunately the sample code that the company offers is not working.
Does anyone have any code that works?
Attached is the code I used
Quote:

include <xmc_gpio.h>
#include <xmc_uart.h>

/* Pins macro definition */

#define LED1 P2_1
#define UART_TX P0_1
#define UART_RX P0_0

/* Number of data to tx/rx and limits for the TX and RX FIFOs */

#define NUM_DATA 25
#define RX_FIFO_INITIAL_LIMIT 7
#define TX_FIFO_INITIAL_LIMIT 1

/* Initialization structures */

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
};

/* Initialization structure for both USIC0_CH0 and USIC0_CH1 channels */
XMC_UART_CH_CONFIG_t uart_config =
{
.data_bits = 8U,
.stop_bits = 1U,
.baudrate = 9600U
};

/* Global variables initialization. Tx and rx indexes and tx and rx arrays */
uint32_t tx_index=0;
uint32_t rx_index=0;
uint8_t tx_data[NUM_DATA];
uint16_t rx_data[NUM_DATA];


/* Transmit handling IRQ */
void USIC0_0_IRQHandler(void)
{
/* If still remaining data to be send */
if(tx_index < NUM_DATA)
{
/* Fill the TX FIFO till it is full */
while(!XMC_USIC_CH_TXFIFO_IsFull(XMC_UART0_CH0))
{
XMC_UART_CH_Transmit(XMC_UART0_CH0, tx_data[tx_index]);
tx_index++;
}
}
}

/* Receive handling IRQ */
void USIC1_1_IRQHandler(void)
{
/* Read the RX FIFO till it is empty */
while(!XMC_USIC_CH_RXFIFO_IsEmpty(XMC_UART1_CH0))
{
rx_data[rx_index++] = XMC_UART_CH_GetReceivedData(XMC_UART1_CH0);
}

/* If all the data have been received */
if(rx_index == (NUM_DATA))
{
/* Check if every received data match with the transmitted data */
for (int tmp=0; tmp<NUM_DATA; tmp++)
{
/* If reception fails stays in an infinite while loop and switch off the LED */
if (tx_data[tmp]!=rx_data[tmp])
{
while(1)
{
XMC_GPIO_SetOutputLow(LED1);
}
}
else
{
/* If reception is successful switch on the LED */
XMC_GPIO_SetOutputHigh(LED1);
}
}
}

/* If the remaining data to be received is smaller than the initial RX FTFO Limit
* it is modified to the remaining data minus 1 in order react when we have all the data received*/
if((NUM_DATA-rx_index) < RX_FIFO_INITIAL_LIMIT)
{
XMC_USIC_CH_RXFIFO_SetSizeTriggerLimit(XMC_UART1_C H0, XMC_USIC_CH_FIFO_SIZE_8WORDS, (NUM_DATA-rx_index)-1);
}
}

int main(void)
{

/* USIC channels initialization */
XMC_UART_CH_Init(XMC_UART0_CH0, &uart_config);
XMC_UART_CH_Init(XMC_UART1_CH0, &uart_config);

/* Input multiplexer configuration for UART1_CH0 */
XMC_UART_CH_SetInputSource(XMC_UART1_CH0, XMC_UART_CH_INPUT_RXD, USIC1_C1_DX0_P0_0);

/* FIFOs initialization for both channels:
* 8 entries for TxFIFO from point 0, LIMIT=1
* 8 entries for RxFIFO from point 8, LIMIT=7 (SRBI is set if all 8*data has been received)
* */
XMC_USIC_CH_TXFIFO_Configure(XMC_UART0_CH0, 0, XMC_USIC_CH_FIFO_SIZE_8WORDS, TX_FIFO_INITIAL_LIMIT);
XMC_USIC_CH_RXFIFO_Configure(XMC_UART1_CH0, 8, XMC_USIC_CH_FIFO_SIZE_8WORDS, RX_FIFO_INITIAL_LIMIT);

/* Enabling events for TX FIFO and RX FIFO */
XMC_USIC_CH_TXFIFO_EnableEvent(XMC_UART0_CH0,XMC_U SIC_CH_TXFIFO_EVENT_CONF_STANDARD);
XMC_USIC_CH_RXFIFO_EnableEvent(XMC_UART1_CH0,XMC_U SIC_CH_RXFIFO_EVENT_CONF_STANDARD |
XMC_USIC_CH_RXFIFO_EVENT_CONF_ALTERNATE);

/* Connecting the previously enabled events to a Service Request line number */
XMC_USIC_CH_TXFIFO_SetInterruptNodePointer(XMC_UAR T0_CH0,XMC_USIC_CH_TXFIFO_INTERRUPT_NODE_POINTER_S TANDARD,0);
XMC_USIC_CH_RXFIFO_SetInterruptNodePointer(XMC_UAR T1_CH0,XMC_USIC_CH_RXFIFO_INTERRUPT_NODE_POINTER_S TANDARD,1);
XMC_USIC_CH_RXFIFO_SetInterruptNodePointer(XMC_UAR T1_CH0,XMC_USIC_CH_RXFIFO_INTERRUPT_NODE_POINTER_A LTERNATE,1);

/* Start USIC operation as UART */
XMC_UART_CH_Start(XMC_UART0_CH0);
XMC_UART_CH_Start(XMC_UART1_CH0);

/*Initialization of the necessary ports*/
XMC_GPIO_Init(UART_TX,&uart_tx);
XMC_GPIO_Init(UART_RX,&uart_rx);
XMC_GPIO_Init(LED1,&led);

/*Configuring priority and enabling NVIC IRQ for the defined Service Request line number */
NVIC_SetPriority(USIC0_0_IRQn,63U);
NVIC_EnableIRQ(USIC0_0_IRQn);
NVIC_SetPriority(USIC1_1_IRQn,62U);
NVIC_EnableIRQ(USIC1_1_IRQn);

USIC1_1_IRQHandler();
/* Filling the tx array */
for (uint32_t i = 0; i < NUM_DATA; i++)
{
tx_data[i]=i;
}

/* Filling the the first time TX FIFO. Successive fillings will be done in the TX FIFO IRQ*/
while(!XMC_USIC_CH_TXFIFO_IsFull(XMC_UART0_CH0))
{
XMC_UART_CH_Transmit(XMC_UART0_CH0,tx_data[tx_index++]);
}


while(1)
{
/* Infinite loop */
}
}
?????

read the data stack contents

$
0
0
Thank you for your answer,
can you explain it more please, does the code you created, allows to display the contents of the stack, during the execution of the program?
I am studying and understanding the functionality of TSIM.
can you tell me how I can install TSIM

best regards

ASCLIN for Tc38x

$
0
0
Hi ParthaMishra,

you can of course reconfigure the pin settings as they do not belong to the peripheral module.
So you can do your configuration for CAN (CAN module + pin settings) and reconfigure the pin later to another alternate output function like LIN.
Of course your CAN module will not be usable during reconfigured state and vice versa.

For me your use case is not clear. What would be the benefit to have both busses on the same pin?
If your question is more in the direction of avoiding reconfiguration by accident, you can use access protection.

Regards,
CookieMonster112

interface tft lcd display with xmc4500 by SPI_MASTER

$
0
0
Hi There,
I saw one note of tft library for epson lcd's. but on website I didnt found any library. Please provide link for xmc library using SPI_MASTER interfacing to TFT display.

QSPI code for TC399

$
0
0
IFX_INTERRUPT(ISR, VectabNum, prio)


from where I get VectabNum?

Suppose if it's for QSPI5, is there any calculation for it.
prio is from 0 to 255 and ISR I have to write.

Hear in my code VectabNum is zero for ADC and it's working, but I do't know how it's come.

DAVE 4.4.2 VADC with DMA sample project on the XMC4500 Relax lite

$
0
0
Hallo Everyone!

Attached a sample project where I have the VADC and DMA running together using the DAVE 4.4.2 CE apps

I am using 2X VADC groups, each with 3 inputs, sampling in continuous mode

With 2X DMA channels running (one for each VADC group), transferring the result registers to RAM

DMA transfers are triggered on the VADC result ready event.

I hope this is of help to someone out there.

Instructions to build are all at the start of main.c please follow it to regenerate source files as I had to delete all the generated files to save space

Ive had to split the zip file into 2 files to stay below the 10MB limit, unzip them into the same directory

Kind regards

Gert van Biljon

How to set TC399 input output pins in TRISTATE

$
0
0
How to set TC399 input output pins in TRISTATE?

DAVE TIP of the Day: Importing of DAVE projects to Keil MDK-ARM IDE

$
0
0
Hi,

You need to open the .gpdsc file directly from Keil MDK.

Regards,
Jesus

Bootloader from CAN BUS to flash

ILLD dwonload probolem

$
0
0
Hi,
i'm getting error when i tried to download iLLD lirary from myicp.

I recently tried to update my iLLD library for Tricore Tc22x.
I got access to myicp page where can I download iLLD drivers.

The problem is, I cannot download more than 40 of 412 Mb , because transfer fails always after 40 MB downloaded.
I tried to download iLLD in different browsers but the same problem occurs.
What could cause a problem ?

XMC 4700 ADC Boundary Check used to trigger Counter APP

$
0
0
I have managed to get something working that will be good enough for my applicacation. However I still can't get the Boundary Check to work correctly.

The working setup uses an autoscan low priority background request to continuously trigger an aliased ADC channel 0 in fast compare mode. Once a cycle, at a zero crossing an event is generated and is connected to the Counter APP via the Event Generator App.

Thanks,
Nick

printf in DAVE4.4.2

$
0
0
Hi Infineon,

it runs fine on C source files, but I have no success on C++ source files. There is no code generated of fct initialise_monitor_handles.

My source compiles without error:

#include <xmc_common.h>
extern "C" void initialise_monitor_handles(void);

int main(void) {
void initialise_monitor_handles();
while (1) {
XMC_DEBUG("Hello\n");
}
return 0;
}

Settings:
C++ compiler and C compiler preprocesser XMC_DEBUG_ENABLE added
C++ linker --specs=rdimon.specs at Other flags added

Unfortunately no source of fct initialise_monitor_handles() available.

Please what's wrong?

Best Regards
Wolfgang

DAVE4 XMC4500 ADC Multi-channel + DMA

TC234L:- MMU is available in this controller

$
0
0
Hi,

I want to know is MMU is available in this controller TC234L with 1.6E core. I can't find anything in the documentation.
If yes what is procedure to disable it if we dont need virtual memory?
If we want to use for some purpose, is there any examples on how to configure it?

Is there any documentation regarding this?

Porting Open-Source-Software-Stack for TPM 2.0

$
0
0
Hello Jan,

I guess the date of publishing depends on the requests. So if you really need this reference it might be better to directly contact Technical Support.

I expect you to be aware of the instruction on tpm2-software/tpm2-tss and the RPI3 Application Note on Optiga TPM product page.
At the bottom fill the "Submit a request to the Technical Assistance Center" form.

As far as I know, the Intel TSS is designed with constraint devices in mind but mainly focused on Linux. The TSS by definition requires, but not includes a TPM device driver.
If you intend to use the TSS bare metal with a single TPM chip you can drop the tabrm module (TPM Access Broker & Resource Manager) but you still need a device driver for your platform.

I am not sure if you need the full stack, how much effort it would be to port it to 16-bit platform and what you expect from the TPM to solve.
Maybe you are willing to share your type of assets and use-case?

Best regards

Automotive CAN bus interface using an XMC4500 - Getting started

$
0
0
For anyone looking to implement basic CAN, here are the steps for building and transmitting two CAN messages each containing 8 bytes of data (without error handling)…


1) ADD the 'CAN_NODE' App to your project using DAVE's 'Add New APP' feature


2) Configure the APP. In this example I have specified 2 message objects with a transmission rate of 500kbps. The messages have CAN ID's of 0x130 and 0x131. Each message object (MO) contains 8 data bytes to be transmitted (64 bits of data).

Attachment 4003

Attachment 4004


3) To transmit a message object containing your data, you need to write your 64 bits of data into the two 32 bit registers (Data_H and Data_L) of a message object before initiating a CAN message transmission.
It is entirely up to you and the receiver what you put in the 8 bytes. For example two of the bytes might contain 16 independent flags, a 32 bit value spread over 4 consecutive bytes and two 8 bit values in two independent bytes.
The data format is normally specified in a '.dbc' data base file. There are many free viewers for such files enabling you to agree the format with the receiver.


Quote:

CAN_NODE_STATUS_t mo_tranmit_status;

uint8_t CAN_Data[9];

// Fill the 'CAN_Data' array with 8 bytes of your data (for message 1)
// Your own code here

// Load the 'CAN_Data' array into message object 1 (Data_H and Data_L)
CAN_NODE_MO_UpdateData(CAN_NODE_0.lmobj_ptr[0],CAN_Data);


// Fill the 'CAN_Data' array with 8 bytes of your data (for message 2)
// Your own code here

// Load the 'CAN_Data' array into message object 2 (Data_H and Data_L)
CAN_NODE_MO_UpdateData(CAN_NODE_0.lmobj_ptr[1],CAN_Data);


//Transmit message object 1
mo_tranmit_status = CAN_NODE_MO_Transmit(CAN_NODE_0.lmobj_ptr[0]);

//Transmit message object 2
mo_tranmit_status = CAN_NODE_MO_Transmit(CAN_NODE_0.lmobj_ptr[1]);



4) The Data_H and Data_L contents can be viewed within the DAVE Debug perspective. Useful for ensuring you have loaded them correctly.

5) There are very low cost CAN analyser modules which will enable you to view the actual CAN message contents the receiver will see. Useful for ensuring you are sending the bytes in the correct order and multi-byte values are sent in the correct order. e.g. Little endian (Intel format) or big endian(Motorola format).

I hope this helps

PHAB
?????

uc probe in dave 4.4.2

$
0
0
Hi there,
I need to start the oscilloscope in dave 4.4.2 . i have downloaded configured the same. but from where to add oscilloscope? please help.
Viewing all 9892 articles
Browse latest View live


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