Is there a way to enable HRTIM on F334? #1947
-
Please give me some light. I wanted to use HRTIM feature of this chip to generate high freq (>30000Hz) 16 bit PWM |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi, and here you could find an example how convert a Cube example to Arduino sketch: |
Beta Was this translation helpful? Give feedback.
-
I tried with some guide from here https://sudonull.com/post/7101-Development-of-buck-converter-on-STM32F334-principle-of-operation-calculations-prototyping and strip out all ADC related only PWM part remain, Tested LED works on PA8 and can be control with But I have no idea how to control in style of analogWrite which only need to stated Frequency,Resolution,Level in that resolution. #pragma once void InitHRPWM (void); uint16_t dutyControl = 0; void InitHRPWM (void) {
// Alternative PP
// Period for timer A
// Deadtime enable
// Event forces the output to active state for TA1
// Enable output PWM for TA1 and TA2
// Continuous mode
// Period for master timer } void setup() { } void loop() { } Here's zip with sketch |
Beta Was this translation helpful? Give feedback.
I tried with some guide from here https://sudonull.com/post/7101-Development-of-buck-converter-on-STM32F334-principle-of-operation-calculations-prototyping
and strip out all ADC related only PWM part remain, Tested LED works on PA8 and can be control with
HRTIM1->sTimerxRegs[0].CMP1xR = dutycycle;
// 0-100%But I have no idea how to control in style of analogWrite which only need to stated Frequency,Resolution,Level in that resolution.
Also does Generic STM32F334R8xx board setting make use of HSE on board?
#pragma once
#include "stm32f3xx.h"
void InitHRPWM (void);
void SetDutyTimerA (uint16_t duty);
void InitBasicADC (void);
extern void Delay (uint32_t setDelay);
uint16_t dutyControl = 0;
…