问答

汇集网友智慧,解决技术难题

21ic问答首页 - TAG - PWM
  • STM32F407 同一个定时器的两个通道产生的PWM脉冲不对

    STM32F407VE ,使用定时器1同时产生两路PWM波 两路PWM产生的脉冲数不一样时,实际产生的脉冲不对,会少1个 实际上是不能使用这种方式做吗?

    定时器 stm32f407 PWM STM32 MCU

    1884浏览量 14回复量 关注量
  • MM32F014 144MHZ PWM sos

    请问MM32F014 可以实现144MHZ的PWM输出吗?听有些工程师说可以实现,但是看主频最高才72MHZ。

    工程师 PWM输出 PWM MM32 hz MUC

    1249浏览量 0回复量 关注量
  • MM32G0001A 2个Timer各出1PWM 设置占空比不同 实际结果确一样

    MM32G0001A 使用两个定时器 TIM14和TIM3 各出一路PWM 设置不一样的占空比 但是实际结果确一样 哪里设置有问题吗? void TIM3_Configure(void) { GPIO_InitTypeDef GPIO_InitStruct; TIM_OCInitTypeDef TIM_OCInitStruct; TIM_TimeBaseInitTypeDef TIM_TimeBaseStruct; /* Compute the value to be set in ARR regiter to generate signal frequency at 100 Khz */ uint32_t TimerPeriod = (TIM_GetTIMxClock(TIM3) / 5000 ) - 1; /* Compute CCR1 value to generate a duty cycle at 80% for channel 1 */ uint32_t Channel1Pulse = ((uint32_t)800 * (TimerPeriod - 1)) / 1000; RCC_APB1PeriphClockCmd(RCC_APB1ENR_TIM3, ENABLE); TIM_TimeBaseStructInit(&TIM_TimeBaseStruct); TIM_TimeBaseStruct.TIM_Prescaler = 0; TIM_TimeBaseStruct.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseStruct.TIM_Period = TimerPeriod; TIM_TimeBaseStruct.TIM_ClockDivision = TIM_CKD_Div1; TIM_TimeBaseStruct.TIM_RepetitionCounter = 0; TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStruct); TIM_OCStructInit(&TIM_OCInitStruct); TIM_OCInitStruct.TIM_OCMode = TIM_OCMode_PWM1; TIM_OCInitStruct.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStruct.TIM_Pulse = 0; TIM_OCInitStruct.TIM_OCPolarity = TIM_OCPolarity_High; TIM_OCInitStruct.TIM_OCIdleState = TIM_OCIdleState_Set; TIM_OCInitStruct.TIM_Pulse = Channel1Pulse; TIM_OC1Init(TIM3, &TIM_OCInitStruct); RCC_AHBPeriphClockCmd(RCC_AHBENR_GPIOA, ENABLE); GPIO_PinAFConfig(GPIOA, GPIO_PinSource11, GPIO_AF_3); /* TIM1_CH1 */ GPIO_StructInit(&GPIO_InitStruct); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_High; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_Init(GPIOA, &GPIO_InitStruct); TIM_Cmd(TIM3, ENABLE); TIM_CtrlPWMOutputs(TIM3, ENABLE); } /*********************************************************************************************************************** * @brief * [url=home.php?mod=space&uid=536309]@NOTE[/url] none * @param none * @retval none *********************************************************************************************************************/ void TIM14_Configure(void) { GPIO_InitTypeDef GPIO_InitStruct; TIM_OCInitTypeDef TIM_OCInitStruct; TIM_TimeBaseInitTypeDef TIM_TimeBaseStruct; /* Compute the value to be set in ARR regiter to generate signal frequency at 100 Khz */ uint32_t TimerPeriod = (TIM_GetTIMxClock(TIM14) / 5000 ) - 1; /* Compute CCR1 value to generate a duty cycle at 80% for channel 1 */ uint32_t Channel1Pulse = ((uint32_t)500 * (TimerPeriod - 1)) / 1000; RCC_APB1PeriphClockCmd(RCC_APB1ENR_TIM14, ENABLE); TIM_TimeBaseStructInit(&TIM_TimeBaseStruct); TIM_TimeBaseStruct.TIM_Prescaler = 0; TIM_TimeBaseStruct.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseStruct.TIM_Period = TimerPeriod; TIM_TimeBaseStruct.TIM_ClockDivision = TIM_CKD_Div1; TIM_TimeBaseStruct.TIM_RepetitionCounter = 0; TIM_TimeBaseInit(TIM14, &TIM_TimeBaseStruct); TIM_OCStructInit(&TIM_OCInitStruct); TIM_OCInitStruct.TIM_OCMode = TIM_OCMode_PWM1; TIM_OCInitStruct.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStruct.TIM_Pulse = 0; TIM_OCInitStruct.TIM_OCPolarity = TIM_OCPolarity_High; TIM_OCInitStruct.TIM_OCIdleState = TIM_OCIdleState_Set; TIM_OCInitStruct.TIM_Pulse = Channel1Pulse; TIM_OC1Init(TIM14, &TIM_OCInitStruct); RCC_AHBPeriphClockCmd(RCC_AHBENR_GPIOA, ENABLE); GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_3); /* TIM1_CH1 */ GPIO_StructInit(&GPIO_InitStruct); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_High; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_Init(GPIOA, &GPIO_InitStruct); TIM_Cmd(TIM14, ENABLE); TIM_CtrlPWMOutputs(TIM14, ENABLE); }

    ST 1A MM32G0001 占空比 PWM timer

    647浏览量 1回复量 关注量
  • HC32F4A0,timer4_1输出U,V,W互补pwm信号的软件demo,有参考的吗? sos

    HC32F4A0,timer4_1输出U,V,W互补pwm信号的软件demo,有参考的吗?

    软件 信号 timer PWM demo HC32F4A0

    1447浏览量 0回复量 关注量
  • 全桥逆变电路烧了两个mos管 赏100家园币

    [color=#333333][backcolor=rgb(242, 249, 253)][font=Tahoma, "][size=16px][font="][size=14px]关于全桥逆变电路烧mos管的问题想请教大佬,首先这是我的原理图,用STM32产生的PWM驱动。[/size][/font][/size][/font][/backcolor][/color] [img=740,462]https://bbs.21ic.com/data/attachment/forum/202403/08/102609kth1w2q7zmhv72dd.jpg.thumb.jpg[/img] [color=#444444][backcolor=rgb(242, 249, 253)][/backcolor][/color][img=740,358]https://bbs.21ic.com/data/attachment/forum/202403/08/102617kqf36q7157uz67qu.jpg.thumb.jpg[/img][color=#444444][backcolor=rgb(242, 249, 253)][/backcolor][/color] [color=#333333][backcolor=rgb(242, 249, 253)][font=Tahoma, "][size=16px][font="][size=14px]逆变电路在给定12伏的直流电时,输出一般,但是好歹是正常的。[/size][/font][/size][/font][/backcolor][/color][color=#444444][backcolor=rgb(242, 249, 253)][font=Tahoma, "][size=16px] [/size][/font][/backcolor][/color][img=740,416]https://bbs.21ic.com/data/attachment/forum/202403/08/102458s840xlz8l0hlx4rn.jpg.thumb.jpg[/img][color=#444444][backcolor=rgb(242, 249, 253)][/backcolor][/color][font=Helvetica Neue, Helvetica, Arial, PingFang SC, Hiragino Sans GB, WenQuanYi Micro Hei, Microsoft Yahei, sans-serif][color=rgb(68, 68, 68)][backcolor=rgb(242, 249, 253)][size=16px][color=#333333][size=14px] [/size][/color][/size][/backcolor][/color][/font][color=#333333][backcolor=rgb(242, 249, 253)][font=Tahoma, "][size=16px][font="][size=14px]但是一旦加到四五十伏,左边两个mos就烧坏了,右边两个反而没问题,从原理图上看,左边两个mos管分别是两路的高端和低端啊,请问这可能是什么原因造成的呢?难道是哪里的元件接反了(我检查了好几遍,确认过IRF840的手册,感觉没啥问题啊),还是说我pwm波死区设置的太小了?[/size][/font][/size][/font][/backcolor][/color] [img=740,416]https://bbs.21ic.com/data/attachment/forum/202403/08/102804qfvzngcsq5z5fzjt.jpg.thumb.jpg[/img] [color=#444444][backcolor=rgb(242, 249, 253)][/backcolor][/color][img=740,554]https://bbs.21ic.com/data/attachment/forum/202403/08/102809en1emhrrpjny2p22.jpg.thumb.jpg[/img]

    原理图 PWM MOS管 MOSFET 全桥逆变电路

    5606浏览量 4回复量 关注量
  • ac78013 定时器PWM通道表 sos

    ac78013 定时器PWM通道表,PWM通道对应那个定时器呢?

    PWM 定时 定时器 AC

    1683浏览量 0回复量 关注量
  • [HDSC][HC32L110B6]advanced timer 做PWM比较输出遇到的问题

    做一个简单的呼吸灯,使用advance Timer的比较输出做PWM来使用,通过调整GCMxR的值来改变PWM的占空比,从而改变灯的亮度。现在遇到的问题是灯偶尔会亮闪一下,请问在其他定时器中断中不能更改GCMxR的值吗??

    HDSC advanced hd hc32l110 timer PWM

    1229浏览量 2回复量 关注量
  • DSPIC33E系列新品PWM发波问题请教 sos

    您好,我想用dsp33E系列(dsp33EP64GS505)的芯片产生一个双脉冲的PWM波,在一个PWM周期内产生两个脉冲,这两个脉冲关于周期中间时刻对齐。请问各位大牛,有什么办法产生这样的PWM脉冲吗?非常感谢!

    dsp33EP dspic33 PWM 脉冲 芯片 4G

    2187浏览量 0回复量 关注量
  • igbt关断一定要负压嘛? 遇到一个问题igbt怎么没关不断?

    igbt关断一定要负压嘛? 遇到一个问题igbt怎么没关不断?我用的就这个电路, IO_pwm发一个脉冲去控制负载速度或灯的亮度 但现在遇到一个问题就是,当io_pwm为低时, 也就是电压为0时, 两个igbt没有完全关断, 如果接一个灯的话, 灯还是有一些亮度, 这个什么原因, 请大侠帮忙看一下

    半桥 调光 IGBT 负压 PWM IO

    6850浏览量 29回复量 关注量
  • H桥驱动变压器,输出波形不是正弦波

    1、原理图驱动部分,用SPWM驱动H桥 [url=//bbs.21ic.com/data/attachment/album/202104/07/104154mnu4dtoy43klurk0.jpg][img]//bbs.21ic.com/data/attachment/album/202104/07/104154mnu4dtoy43klurk0.jpg[/img][/url] 2、现象 H桥输出波形如图: [url=//bbs.21ic.com/data/attachment/album/202104/07/104334anyidnpi2kid6ddp.jpg][img]//bbs.21ic.com/data/attachment/album/202104/07/104334anyidnpi2kid6ddp.jpg[/img][/url] 加上变压器后H桥的输出波形 [url=//bbs.21ic.com/data/attachment/album/202104/07/104321i7oqh8u7bz8bou2h.jpg][img]//bbs.21ic.com/data/attachment/album/202104/07/104321i7oqh8u7bz8bou2h.jpg[/img][/url] 求大佬指点,为什么会这样?并且变压器的输出不是正弦波

    变压器 正弦波 输出波形 H桥驱动 PWM SPWM

    1856浏览量 3回复量 关注量
  • HK32F030MF4P6 PC3-TIM1_CH3 PWM 没输出

    void TIM1_WindPwm_Config(void) //16K TIM1_CH3 { GPIO_InitTypeDef GPIO_InitStructure; TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_OCInitTypeDef TIM_OCInitStructure; RCC_AHBPeriphClockCmd( RCC_AHBPeriph_GPIOC, ENABLE ); RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1 , ENABLE); // 使能IOMUX时钟 RCC_APB1PeriphClockCmd(RCC_APB1Periph_IOMUX,ENABLE); GPIO_IOMUX_PinAFConfig(GPIOC,GPIO_PinSource3,IOMUX_PC3_TIM1CH3); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;//GPIO_PuPd_DOWN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_PinAFConfig(GPIOC,GPIO_PinSource3,GPIO_AF_3); /* Time Base configuration */ TIM_TimeBaseStructure.TIM_Prescaler = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseStructure.TIM_Period = TIM1_PERIOD-1; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); /* Channel 1, 2,3 and 4 Configuration in PWM mode */ TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM2; TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Disable;//TIM_OutputNState_Enable; TIM_OCInitStructure.TIM_Pulse = 1000; TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low; //TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_Low; TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; //TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCIdleState_Reset; TIM_OC3Init(TIM1, &TIM_OCInitStructure); /* TIM1 counter enable */ TIM_Cmd(TIM1, ENABLE); /* TIM1 Main Output Enable */ TIM_CtrlPWMOutputs(TIM1, ENABLE); }

    pc TI PWM IO pi ST

    1980浏览量 2回复量 关注量
  • FPGA程序,不能正确输出,各位帮忙看下

    我编写了两个文件,配置了输出口,,LASER_PWM 始终输出不了波形,请问下,这个是什么原因呀?modesiem仿真是有波形输出的//////////////-------PWM.V 文件 `timescale 1 ns / 1 ps module pwm( input rsn, input clk, input [15:0]pwm_counter, input [15:0]pwm_duty, output pwm_out ); //reg[15:0]pwm_counter; //reg [15:0]pwm_duty; reg [15:0]counter=16'd0; reg pwm_out_r; always@(posedge clk or negedge rsn) //begin if(!rsn) begin counter <= 16'd0; end else begin if(counter >= pwm_counter)counter <= 16'd0; else counter <= counter + 1'd1; end // end always@(posedge clk or negedge rsn) if(!rsn) begin pwm_out_r <= 1'd0; end else if(counter>=pwm_duty) pwm_out_r<=1'b0; else pwm_out_r<=1'b1; //wire pwm_out; assign pwm_out = pwm_out_r;//((counter > pwm_duty) ? 1'd0 : 1'd1); endmodule ////// top_indepen.v 文件 //-------------------------Timescale----------------------------// `timescale 1 ns / 1 ps //--------------------FSMC_SIG---------------------// module FSMC_INDEP( FPGA_CLK, //鏉堟挸鍙嗛弶鑳祰閺呰埖灏烥PGA_CLK,25M FPGA_LEDR, FPGA_LEDG, FPGA_LEDB, WR, //FSMC閸愭瑤淇婇崣 RD, //FSMC鐠囪淇婇崣 CS0, //FSMC閻楀洭鈧 A, //FSMC閸︽澘**冮幀鑽ゅ殠 DB, //FSMC閺佺増宓侀幀鑽ゅ殠 NADV, //FSMC閻ㄥ嚞ADV //LASER PWM LASER_PWM, //interpn_exti Interp_ex, testclk, testclk_100, testclk_50, FPGA_KEY ); input FPGA_KEY; input FPGA_CLK,NADV; input WR,RD,CS0; inout [15:0]DB; input [24:16]A; output FPGA_LEDB,FPGA_LEDG,FPGA_LEDR; assign FPGA_LEDR = 1'd1; assign FPGA_LEDG = 1'd0; assign FPGA_LEDB = 1'd1; output LASER_PWM; output Interp_ex,testclk,testclk_100,testclk_50; //-------------------------MY_PLL-------------------------------// wire PLL_100M; wire PLL_8M; wire PLL_50M; wire PLL_12_5M; reg LaserCtrl1; reg [15:0] dbPower1;//閸旂喓宸 閸楃姷鈹栧В reg [15:0]dbQFreq1;//妫版垹宸 reg [15:0]counter; initial begin dbQFreq1 <= 16'd106; dbPower1 <= 16'd53; LaserCtrl1 <= 1'd1; end MY_PLL U1( .inclk0(FPGA_CLK), .c0(PLL_100M), .c1(PLL_50M), .c2(PLL_8M), .c3(PLL_12_5M) );// //------------------------RST_Ctrl-----------------------------// wire RST_n; RST_Ctrl U2( .FPGA_CLK(FPGA_CLK), .RST_n(RST_n) ); //娓氬瀵睷ST_Ctrl濡€虫健,鏉堟挸鍤崗銊ョ湰婢跺秳缍呮穱鈥冲娇RST_n pwm U5( .rsn(RST_n), .clk(PLL_8M), .pwm_counter(dbQFreq1), .pwm_duty(dbPower1),//閸旂喓宸 .pwm_out(LASER_PWM) ); endmodule

    FPGA PWM counter TE npu

    667浏览量 2回复量 关注量
  • HC32F030如何实现不用中断更新CCR调节互补PWM占空比?

    因为要使用互补PWM控制H桥来驱动电机,参考HC32F030驱动下的产生互补PWM的例子“HC32F030_DDL_Rev1.2.0\example\timer3\timer3_m23_tpcmp_pwm”,可以产生控制互补PWM占空比控制电机转动。但问题是这种方式需要在定时器溢出中断频繁更新CCR的值,频繁的中断服务程序频繁占用系统处理时间,而我只需要输出互补PWM而已。 尝试在参考例子中关掉中断,使能PWM自动输出。 //stcTim3BaseCfg.pfnTim3Cb = Tim3_LRMotorPWM_Int; //中断函数入口 //Tim3_ClearAllIntFlag(); //清中断标志 //Tim3_Mode23_EnableIrq(Tim3UevIrq); //使能TIM3 UEV更新中断 //EnableNvic(TIM3_IRQn, IrqLevel0, TRUE); //TIM3中断使能 Tim3_M23_EnPWM_Output(TRUE, TRUE); //端口输出使能 应用程序中改变CCR的值,试图改变PWM占空比: Init_LRMotor_PWM(); Tim3_M23_CCR_Set(Tim3CCR0A, 250); Tim3_M23_CCR_Set(Tim3CCR0B, 750); Tim3_M23_CCR_Set(Tim3CCR1A, 250); Tim3_M23_CCR_Set(Tim3CCR1B, 750); Tim3_M23_Run(); Delay_MS(2000); Tim3_M23_Stop(); Delay_MS(2000); Tim3_M23_CCR_Set(Tim3CCR0A, 750); Tim3_M23_CCR_Set(Tim3CCR0B, 250); Tim3_M23_CCR_Set(Tim3CCR1A, 750); Tim3_M23_CCR_Set(Tim3CCR1B, 250); Tim3_M23_Run(); 下载视频

    HC PWM TI se ev

    1185浏览量 2回复量 关注量
  • 为什么A会有half,B没有啊?

    为什么装载PWM的时候,会写成EPwm1Regs.CMPA.half.CMPA = int,和 EPwm4Regs.CMPB = int。为什么A会有half,B没有啊?

    PWM

    777浏览量 12回复量 关注量
  • 散热风扇,3.3v io接到fg和pwm吗

    请教这个风扇调速pwm管脚可以直接接到单片机3.3v IO口吗,fg反馈管脚上拉3k电阻后可以直接接到3.3v IO口吗

    PWM IO 管脚 vi 单片机

    832浏览量 2回复量 关注量
123下一页