Microcontrollers Forum Discussions
Browse the Community
PSoC™ 6
Discussion forum regarding PSoC™ 6 - 32-bit Arm Microcontroller (MCU) Forum, discusses the 40-nm technology - best combination of ultra-low-power consumption, flexibility, security and high-performance topics.
PSoC™ 4
PSoC™ 4 - Arm®-based Forum, discusses the low-power Cortex®-M0 and Cortex®-M0+ cores, CapSense®, and Bluetooth® Low Energy
PSoC™ 5, 3 & 1
The PSoC™ 5LP, PSoC 2 and PSoC 1 Forum discusses - 24-bit Digital Filter Block (DFB), 24 UDBs, DMA controller and integrating AFE, digital logic with user interface ICs with an Arm Cortex-M3 CPU solutions.
CAPSENSE™ & MagSense
The Sensing Technology Forum discusses CAPSENSE™ - capacitive-sensing and MagSense inductive-sensing for consumer, industrial, automotive, and Internet of Things (IoT) applications.
XMC™
AURIX™
In this forum you can post your questions, comments and feedback about the 32-bit AURIX™ TriCore™ Microcontroller. The AURIX™ offers the highest scalability in performance, memory & peripherals across application. It is a safe and secure companion chip, meeting both the ISO functional safety standards and EVITA full security standards. Here you can also find the links to the latest board pages, SW and Tools GitHub, trainings, documents and FAQs
TRAVEO™ T2G
Discussion forum regarding 32-bit TRAVEO™ T2G Microcontroller - based on ARM® for automotive body electronics applications; cutting-edge performance, safety, and security features topics.
MOTIX™ MCU
The MOTIX™ MCU forum is designed for you to post your questions, comments and feedback about the famous Embedded Power ICs at anytime. Ask your technical questions or explore existing content!
Legacy microcontrollers
Featured Discussions
调试XMC4500 WinUSB功能时,连接USB到设备后,电脑设备管理器读取到Infineon WinUSB Device ,但是缺少驱动程序,英飞凌官网上没有找到相关的驱动安装包,特在此求助,能给个Infineon WinUSB驱动安装包,万分感谢!
我现在有6路pwm波,A、B、E、F、G、H,这六路pwm需要同时调频移相,我的B、E需要基于A移向,F需要基于E移相,G和H需要基于E移相,但是GTM-TOM模块pwm同时输出并满足移相有两种情况,一种是都基于A去移相,一种是基于前一个通道去移相,一旦我使用第一种,我的F基于A移相就会超过50%,这将导致PWM出现一个周期的高电平的波形,如果使用第二种我又无法满足我的移相标准,请问是否可以混合使用这两种模式,怎么使用?
祝好!
Show LessHello.
Regarding 3DL After entering deepsleep, the MCU current is around 4mA when measured separately. Both cores executed Cy_SysPm_DeepSleep to confirm that the MCU entered DeepSleep. what could the high current be related to?
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/3DL-deepsleep-%E7%94%B5%E6%B5%81/td-p/724510
Show LessHi
I am trying to create a simple program to read 10 bytes on UART through DMA and then write it again to the UART using DMA.
I added blinking LEDs in the DMATxISR and DMARxISR as visual indication that the ISR is being called.
It works for DMA Rx, but fails in DMA Tx.
I tried to use memcpy() to copy the Rx buffer into the Tx buffer to engage DMATx, but it doesn't work. I can only send using PutArray().
I attached my project,
I wonder if you can help me out find the mistake.
thanks
Show LessHi Team,
I have some tasks executing on a 10ms Scheduler using Systick. DMA Transfers are initiated during that 10ms executions.
But, whenever the Systick Interrupt occurs the DMA transfers is also preempted and gets continued again on the next 10ms cycle.
Since DMA has to run parallelly why I am getting this issue. Sharing the current configuration and the scope images of the same for the reference. Let me know if anything needs updated on the configuration front.
Issue case scenario:
Systick Scheduler every 10ms where 4.3msec is used for other application processing and after that 1D DMA Transfers(Mem to PDMA) using SPI is initiated.
As we having limitation on the Buffer of 128 Bytes transfer. So to transfer 4096 bytes of data we need to transfer 32 cycles.
In the below scope image the Color coding is mentioned as follows
Green - GPIO to identify the start and stop of the DMA transfer of 4096 bytes of data
Yellow - Area blocked for other application instruction executions.
Pink - Systick Interrupt
Blue - DMA Transfer Interrupt for each 128 burst of 32 cycles
As given in the below image DMA is preempted whenever Systick Interrupt Occurs.
Note : Even we tried to set the priority of the DMA to be high but the scheduling is getting delayed because of it.
1D Transfer Configuration
dma_transfer_data_t dma_transfer_data;
UI_8 DMA_Cfg_Init_Buff[1] = {0};
uint8_t Trigger_Recd=0;
const cy_stc_pdma_chnl_config_t chnl7Config = {
/* CURR_PTR */ .PDMA_Descriptor = &stcDescr,
/* CH_CTL PREEMPTABLE */ .preemptable = 0u,
/* CH_CTL PRIO */ .priority = 0u,
/* CH_CTL ENABLED */ .enable = 1u, /* enabled after initialization */
};
static cy_stc_pdma_descr_config_t stcDw1DescrConfig = {
/* DESCR_CTL WAIT_FOR_DEACT */ .deact = 0u,
/* DESCR_CTL INTR_TYPE */ .intrType = CY_PDMA_INTR_1ELEMENT_CMPLT,
/* DESCR_CTL TR_OUT_TYPE */ .trigoutType = CY_PDMA_TRIGOUT_1ELEMENT_CMPLT,
/* DESCR_CTL CH_DISABLE */ .chStateAtCmplt = CY_PDMA_CH_ENABLED,
/* DESCR_CTL TR_IN_TYPE */ .triginType = CY_PDMA_TRIGIN_DESCR,
/* DESCR_CTL DATA_SIZE */ .dataSize = CY_PDMA_BYTE,
/* DESCR_CTL SRC_TRANSFER_SIZE */ .srcTxfrSize = 0u,
/* DESCR_CTL DST_TRANSFER_SIZE */ .destTxfrSize = 1u,
/* DESCR_CTL DESCR_TYPE */ .descrType = CY_PDMA_1D_TRANSFER,
/* DESCR_SRC */ .srcAddr = &DMA_Cfg_Init_Buff[0],
/* DESCR_DST */ .destAddr = (uint32_t *)&CY_SPI_SCB_TYPE->unTX_FIFO_WR.u32Register,
/* DESCR_X_CTL SRC_X_INCR */ .srcXincr = 1u,
/* DESCR_X_CTL DST_X_INCR */ .destXincr = 0u,
/* DESCR_X_CTL X_COUNT */ .xCount = HW_FIFO_SIZE,
/* DESCR_Y_CTL SRC_Y_INCR */ .srcYincr = 0u,
/* DESCR_Y_CTL DST_Y_INCR */ .destYincr = 0u,
/* DESCR_Y_CTL Y_COUNT */ .yCount = 0u,
/* DESCR_NEXT_PTR */ .descrNext = 0u
};
Thanks,
Pradeep
Dear Mr\Mrs,
I tried to create a project starting of Modustoolbox for IAR embedded. Compiling is failing with this issue:
"Error[Li005]: no definition for "__iar_Initlocks" [referenced from C:\Users\emanuelebelpanno\mtw\Empty_PSoC4_App\Debug\Obj\TOOLCHAIN_IAR_13573725619442129044.dir\cy_clib_support_iar.o]"
I've tried to look for this function and it isn't present in the project. How Cam I solve this issue?
I'm using Windows 10, IAR embedded ARM 9.50.2.
Kind Regards,
EB
Show LessHI
We have buy cypress miniprog4 to flash the PD controller (CYPD6127-48LQXIT).
We are able to turn on the target power by using the cypress programmer tool.
We have connect the device with the SWD interface and when we try to connect with the programmer we are facing below error:
Info : [CyBridge] Connected - MiniProg4 CMSIS-DAP BULK-1623198900212400
Info : Selected Device: MP4 BULK-1623198900212400
Info : Open On-Chip Debugger 0.10.0+dev-1.0.0.226 (2018-11-09-17:51)
Info : Licensed under GNU GPL v2
Info : For bug reports, read
Info : http://openocd.org/doc/doxygen/bugs.html
Info : /home/vvdn/Downloads/Cypress_programmer/CyProgrammer_2.0.0.355
Info : ./openocd
Info : /home/vvdn/Downloads/Cypress_programmer/CyProgrammer_2.0.0.355/BT
Info : 1623198900212400
Info : 3:7
Info : swd
Info : adapter speed: 1500 kHz
Info : cyp_detect_target.cfg
Warn : Transport "swd" was already selected
Info : cyp_get_mpn
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : VTarget = 3.294 V
Info : clock speed 1500 kHz
Error: DAP 'test.cpu' initialization failed (check connection, power, etc.)
Please check and help to resolve this as we are not able to connect with the programmer.
Show LessI'm encountering a problem with CAN transmission in TC233, and I could really use some assistance in troubleshooting it.
The scenario is as follows: I've utilized code from the iLLD example source for CAN initialization. Initially, I developed code for TC234, where P20_8 and P20_7 pins were configured as CAN TX and CAN RX pins respectively. This code works perfectly fine in TC234.
However, when I attempted to adapt the same code for TC233, making the necessary adjustments such as changing the pins to P14_0 and P14_1 and updating the Node1 settings, the code doesn't function as expected in either TC233 or TC234.
I have shared the code below.
/********************************************************************************************************************
* \file MULTICAN.c
* \copyright Copyright (C) Infineon Technologies AG 2019
*
* Use of this file is subject to the terms of use agreed between (i) you or the company in which ordinary course of
* business you are acting and (ii) Infineon Technologies AG or its licensees. If and as long as no such terms of use
* are agreed, use of this file is subject to following:
*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and
* accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute,
* and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the
* Software is furnished to do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including the above license grant, this restriction
* and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all
* derivative works of the Software, unless such copies or derivative works are solely in the form of
* machine-executable object code generated by a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*********************************************************************************************************************/
/*********************************************************************************************************************/
/*-----------------------------------------------------Includes------------------------------------------------------*/
/*********************************************************************************************************************/
#include "MULTICAN.h"
#include "string.h"
/*********************************************************************************************************************/
/*-------------------------------------------------Global variables--------------------------------------------------*/
/*********************************************************************************************************************/
AppMulticanType g_multican; /* Global MULTICAN configuration and control structure */
AppLedType g_led; /* Global LED configuration and control structure */
uint32 Battery_Saving_Mode, Low_Power_Mode, Mode,Motor_ON_OFF, MCU_ON_OFF;
/*********************************************************************************************************************/
/*---------------------------------------------Function Implementations----------------------------------------------*/
/*********************************************************************************************************************/
/* Macro to define Interrupt Service Routine.
* This macro:
* - defines linker section as .intvec_tc<vector number>_<interrupt priority>.
* - defines compiler specific attribute for the interrupt functions.
* - defines the Interrupt service routine as ISR function.
*
* IFX_INTERRUPT(isr, vectabNum, priority)
* - isr: Name of the ISR function.
* - vectabNum: Vector table number.
* - priority: Interrupt priority. Refer Usage of Interrupt Macro for more details.
*/
IFX_INTERRUPT(canIsrTxHandler, 0, ISR_PRIORITY_CAN_TX);
//IFX_INTERRUPT(canIsrRxHandler, 0, ISR_PRIORITY_CAN_RX);
IFX_INTERRUPT(canIsrRxHandler, 0, ISR_PRIORITY_CAN_RX);
/* Interrupt Service Routine (ISR) called once the TX interrupt has been generated.
* Turns on the LED1 to indicate successful CAN message transmission.
*/
void canIsrTxHandler(void)
{
/* Just to indicate that the CAN message has been transmitted by turning on LED1 */
// IfxPort_setPinLow(g_led.led1.port, g_led.led1.pinIndex);
IfxPort_togglePin(g_led.led2.port, g_led.led2.pinIndex);
}
void canIsrRxHandler(void)
{
volatile IfxMultican_Status readStatus[10];
memset(readStatus, 0, 10*sizeof(readStatus[0]));
for(int i = 1; i <= 2; i++)
{
Ifx_CAN_MO *hwObj = IfxMultican_MsgObj_getPointer(g_multican.canDstMsgObj.node->mcan, i);
if(hwObj->STAT.B.NEWDAT != 0)
{
IfxPort_togglePin(g_led.led2.port, g_led.led2.pinIndex);
g_multican.canDstMsgObj.msgObjId = i;
readStatus[i-1] = IfxMultican_Can_MsgObj_readMessage(&g_multican.canDstMsgObj, &g_multican.rxMsg);
}
}
}
/* Interrupt Service Routine (ISR) called once the RX interrupt has been generated.
* Compares the content of the received CAN message with the content of the transmitted CAN message
* and in case of success, turns on the LED2 to indicate successful CAN message reception.
*/
/*Function to initialize MULTICAN module, nodes and message objects related for this application use case */
void initMultican(void)
{
IfxMultican_Can_initModuleConfig(&g_multican.canConfig, &MODULE_CAN);
g_multican.canConfig.nodePointer[TX_INTERRUPT_SRC_ID].priority = ISR_PRIORITY_CAN_TX;
g_multican.canConfig.nodePointer[RX_INTERRUPT_SRC_ID].priority = ISR_PRIORITY_CAN_RX;
IfxMultican_Can_initModule(&g_multican.can, &g_multican.canConfig);
IfxMultican_Can_Node_initConfig(&g_multican.canNodeConfig, &g_multican.can);
g_multican.canNodeConfig.txPin = &IfxMultican_TXD1_P14_0_OUT;
g_multican.canNodeConfig.rxPin = &IfxMultican_RXD1B_P14_1_IN;
g_multican.canNodeConfig.loopBackMode = FALSE;
g_multican.canNodeConfig.nodeId = IfxMultican_NodeId_1;
g_multican.canNodeConfig.rxPinMode = IfxPort_InputMode_pullUp;
g_multican.canNodeConfig.txPinMode = IfxPort_OutputMode_pushPull;
// g_multican.canNodeConfig.alertInterrupt.enabled = FALSE;
IfxMultican_Can_Node_init(&g_multican.canSrcNode, &g_multican.canNodeConfig);
//IfxMultican_Can_Node_init(&g_multican.canDstNode, &g_multican.canNodeConfig);
TX_CAN_ID_Init();
RX_CAN_ID_Init();
}
void TX_CAN_ID_Init(void){
IfxMultican_Can_MsgObj_initConfig(&g_multican.canMsgObjConfig, &g_multican.canSrcNode);
/*** The msgObjId for CAN TX must be different from all CAN RX msgObjId ***/
g_multican.canMsgObjConfig.msgObjId = SRC_MESSAGE_OBJECT_ID;
g_multican.canMsgObjConfig.messageId = CAN_MESSAGE_ID; // 0x777
g_multican.canMsgObjConfig.frame = IfxMultican_Frame_transmit;
g_multican.canMsgObjConfig.txInterrupt.enabled = TRUE;
g_multican.canMsgObjConfig.txInterrupt.srcId = TX_INTERRUPT_SRC_ID;
IfxMultican_Can_MsgObj_init(&g_multican.canSrcMsgObj, &g_multican.canMsgObjConfig);
}
void RX_CAN_ID_Init(void){
IfxMultican_Can_MsgObj_initConfig(&g_multican.canMsgObjConfig, &g_multican.canDstNode);
/*** Each Message Object ID is attached with unique CAN ID ***/
g_multican.canMsgObjConfig.msgObjId = DST_MESSAGE_OBJECT_ID;
g_multican.canMsgObjConfig.messageId = 0x333;
g_multican.canMsgObjConfig.frame = IfxMultican_Frame_receive;
g_multican.canMsgObjConfig.rxInterrupt.enabled = TRUE;
g_multican.canMsgObjConfig.rxInterrupt.srcId = RX_INTERRUPT_SRC_ID;
IfxMultican_Can_MsgObj_init(&g_multican.canDstMsgObj, &g_multican.canMsgObjConfig);
g_multican.canMsgObjConfig.msgObjId = DST_MESSAGE_OBJECT_ID+1;
g_multican.canMsgObjConfig.messageId = 0x444;
g_multican.canMsgObjConfig.frame = IfxMultican_Frame_receive;
g_multican.canMsgObjConfig.rxInterrupt.enabled = TRUE;
g_multican.canMsgObjConfig.rxInterrupt.srcId = RX_INTERRUPT_SRC_ID;
IfxMultican_Can_MsgObj_init(&g_multican.canDstMsgObj, &g_multican.canMsgObjConfig);
}
void transmitCanMessage(void){
const uint32 dataLow = 0x11111111;
const uint32 dataHigh = 0x22222222;
/* Invalidation of the RX message */
IfxMultican_Message_init(&g_multican.rxMsg,
INVALID_ID_VALUE,
INVALID_DATA_VALUE,
INVALID_DATA_VALUE,
g_multican.canMsgObjConfig.control.messageLen);
IfxMultican_Message_init(&g_multican.txMsg,
CAN_MESSAGE_ID,
dataLow,
dataHigh,
g_multican.canMsgObjConfig.control.messageLen);
IfxMultican_Can_MsgObj_sendMessage(&g_multican.canSrcMsgObj, &g_multican.txMsg);
}
void initLed(void){
/* ======================================================================
* Configuration of the pins connected to the LEDs:
* ======================================================================
* - define the GPIO port
* - define the GPIO pin that is the connected to the LED
* - define the general GPIO pin usage (no alternate function used)
* - define the pad driver strength
* ======================================================================
*/
g_led.led1.port = &MODULE_P13;
g_led.led1.pinIndex = 0;
g_led.led1.mode = IfxPort_OutputIdx_general;
g_led.led1.padDriver = IfxPort_PadDriver_cmosAutomotiveSpeed1;
g_led.led2.port = &MODULE_P13;
g_led.led2.pinIndex = 1;
g_led.led2.mode = IfxPort_OutputIdx_general;
g_led.led2.padDriver = IfxPort_PadDriver_cmosAutomotiveSpeed1;
/* Initialize the pins connected to LEDs to level "HIGH"; will keep the LEDs turned off as default state */
IfxPort_setPinHigh(g_led.led1.port, g_led.led1.pinIndex);
IfxPort_setPinHigh(g_led.led2.port, g_led.led2.pinIndex);
/* Set the pin input/output mode for both pins connected to the LEDs */
IfxPort_setPinModeOutput(g_led.led1.port, g_led.led1.pinIndex, IfxPort_OutputMode_pushPull, g_led.led1.mode);
IfxPort_setPinModeOutput(g_led.led2.port, g_led.led2.pinIndex, IfxPort_OutputMode_pushPull, g_led.led2.mode);
/* Set the pad driver mode for both pins connected to the LEDs */
IfxPort_setPinPadDriver(g_led.led1.port, g_led.led1.pinIndex, g_led.led1.padDriver);
IfxPort_setPinPadDriver(g_led.led2.port, g_led.led2.pinIndex, g_led.led2.padDriver);
}
Show Less
-
TraveoII
UART buadrate Setting
by chandan1995 Jun 19, 2023