Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

HRTIM in STM32F334 as crystal replacement?

Status
Not open for further replies.

carpenter

Full Member level 6
Joined
Jul 25, 2012
Messages
353
Helped
22
Reputation
44
Reaction score
24
Trophy points
1,298
Activity points
4,467
I discovered a spell high resolution timer in STM32F334 and have question.
Can this timer be used to generate a clock signal to replace the crystal?

For example I need clock signal 13.56MHz with duty cycle 60%.

F= 13.56MHz
t = 73746,31268ps
HRTIM resolution 217ps
HRTIM_PERAR= 339,8447589 = 340 cycles
PER x DC= 0,6*340= 204

this will generate
t= 340*217=73780ps
F= 13553808,62 Hz
Delta F 13.56E6-13553808,62 = 6 191,38 Hz
error 6200ppm

For communication at 13.56MHz it is probably not sufficiently accurate, lae need for induction heating at 13.56MHz could be enough.
By the way, is it sufficiently precise for induction heating, or will there be a problem with legislation and regulators?
In any case, my calculation does not take into account errors in STM32F334 (PPL error, PWM output stability, etc.)
I wonder if it is possible to use HRTIM as crystal replacement or will it be very inaccurate and the clock will swim?
 

Does the high resolution timer provide high resolution timer period? I don't see how.
 

Please refer to the answer in post #2.

The other point is that the processor core still requires a clock source which can't be provided by the HRTIM.
 

This is misunderstanding, I do not speak obout a clock for the MCU, but the MCU create on any output a clock for the external circuit.
MCU have crystal 8MHz on HSE -> PLL 144MHz -> HRTIM -> PWM output is 13,538 MHz this is used as clock for another circuit.
 

Sure you can setup 13.538 MHz output with HRTIM? What are the register settings?

- - - Updated - - -

Read a bit about HRTIM high-resolution equivalent clock. Looks like pwm period can be actually set with 1/(32*fPLL) resolution. My calculation gives 13.553 MHz as nearest frequency to 13.56 MHz, unfortunately already at the border of the +/- 7 kHz ISM spectrum mask. Would need to pull up the 8 MHz crystal by several 100 ppm to get suffcient margin. Probably much easier to run the HSE with 13.56 MHz crystal.

It should be also mentioned that the internal PLL has relative high jitter, surely not suited for communication applications, but you should be sure that the phase noise doesn't get you outside the spectrum mask.
 

In principle, HRTIM can generate such a fast PWM, thanks to the DLL being a 217ps resolution .
As I said in my first post, thanks to step 217ps it means an error over 13.56MHz is 6 191 Hz.
My aplication is not telecomunication, but induction heating. from these clock a sinus is formed which, after amplification to hundreds of watts, is used for induction heating (HF 13.56MHz induction heating). The basic and fixed 6.2kHz error is not a technical issue, it will be a question of whether the problem will be legislative, but let it go aside.

Use crystal 13.56MHz as HSE and over MCO as clock for heating no solution, because for heating I need clock with dutty cycle 55:45, respectively with predominance in the positive half-wave. (in the original crystal solution this was solved by 3 times larger capacitor on one side of the crystal)
At the output of the amplifier is a sixth order filter.
Therefore problém is
1. heat and time instability of the frequency
2. very large jiter

Unfortunately, I can not quantify the proposed solution
 

Use crystal 13.56MHz as HSE and over MCO as clock for heating no solution, because for heating I need clock with duty cycle 55:45
You didn't think through to the end. The suggestion wasn't to use the 13.56MHz crystal directly, just to use it to meet the ISM frequency exactly, if you find that you can't comply with the regulations otherwise. You can still use PLL and standard or HRTIM pwm to adjust the duty cycle.

Therefore problem is
1. heat and time instability of the frequency
2. very large jitter

why 1?
2. jitter yes, but not very large. As stated, should be sufficient for your application, at least if the center frequency isn't already marginal.
 

I am thinking this way
Device due to interference in a full-metal package, which uses a radiator, during long work, it reaches 60 ° C, the safety overtemperature stop is set at 80C .

The original solution.
Use crystal any as this , and this is the main and practically the only source of instability, see Frequency Tolerance @+25°C 50ppm, Frequency Stability over the Operating
Temperature +-50ppm and any manufacturer not mentioned long time stability.

New solution with HRTIM
Firt source error is HSE crystal for MCU as clock source , for example 8MHz as stable as above,
second source error all inside MCU, above all PLL and Delay line in HRTIM ,I do not know what is thermal and above all long time stability of this . I do not know whether these errors will tend to add up theoretically, if the frequency error is large and it is still increasing upwards, collisions may occur output LPF (6th order) and output power will heat LPF , theoretical :thinker:

I probably complicate my life.
I have on the table a big 10kW induction melting furnace , where STM32F334 with HRTIM directly drive full MOSFET drive and in fact it also determines the frequency, and I can not see the problem.
Probably because frequency is in order 100kHz and frequency is online tuned on resonst freuency. May be because the value of the HRTIM counter is large and not 340 as on 13.56MHz output PWM.

I can try program STM32F3334 discovery HRTIM on this frequency, problem is I do not have the equipment to accurately measure the clock parameters. I have old HP 5334A with precise time base option and HF divider, but with this I measure the max frequency
 

Average output frequency is only determined by the crystal (and its drift) and integer factors. In so far the HRTIM method can be considered accurate.

But jitter can cause a frequency spectrum outside the ISM mask. You need a spectrum analyzer to check it.
 

Hell now i look to ISM band specification nad Frequency range 13.56MH is only +- 7kHz ( I thought +-14kHz) :bang:
 

Yes. If it's a professional application required to keep the spec, it's a good advice to tune the oscillator to the center frequency to get some margin for jitter.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top