cancel
Showing results for 
Search instead for 
Did you mean: 

about timing using F446RE

llwaeva
Associate II
Posted on April 03, 2016 at 04:39

Hi all,

  I got a board NUCLEO F446RE. I am using mbed for coding and I saw there are delay function precise up to microsecond. I need to create a series of TTL pulses with period in few microseconds to couple hundreds microseconds. I know that the CPU frequency is 180MHz for this board but I didn't see information about the system frequency. I wonder what's the best time resolution I could have for this board. I need the TTL pulses created in very precise timing (microsecond). Is this board good enough? 
6 REPLIES 6
mark239955_stm1
Associate II
Posted on April 03, 2016 at 06:41

Using hardware timers in Output Compare mode, possibly coupled with DMA, you can easily achieve those timing requirements with that MCU.  For maximum flexibility you would probably want to use Advanced Control Timers (TIM1 and/or TIM8).  Just make sure you have enough TIM1 and/or TIM8 channels for your purposes available on the Nucleo's IO headers.

Posted on April 03, 2016 at 13:54

Interrupting in the 100's of KHz and MHz rate is not recommended, at those rates you'd want to use DMA to ''modulate'' settings.

The TIM hardware can automatically generate pulses in the nano-second resolution range. ie granularity of TIMCLK, or prescaled/divided sub-multiples thereof.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
llwaeva
Associate II
Posted on April 03, 2016 at 18:17

Thanks. Sorry that I don't have much experience yet. Is TIM hardware supported by F445RE or need some circuit. Also, if I want to use something suggested, can I do that with mbed? Is that any good example to start with.

Radosław
Senior II
Posted on April 03, 2016 at 18:42

Time critical algoritms like yours must be implemented without any library.

Specially EMBED is the most bad choise.

Read Reference manual, search aplication note about timers.

llwaeva
Associate II
Posted on April 03, 2016 at 20:20

So if using TIM is possible to generate pules in very short time resolution (like us or even ns). So is it possible I use it for DAC of speed like 1MS/S or even better? I am looking for a way to generate analog signal of -10V to 10V with resolution 10 bit or even better.

mark239955_stm1
Associate II
Posted on April 03, 2016 at 21:11

You could use one of the 446's 12-bit DAC's to generate a voltage in the range 0-3.3V (assuming you're running the MCU at 3.3V), and then scale that voltage over a +/-10V range.  The DAC's can be driven with timers and DMA to generate almost any waveform that you require with minimal CPU load.

In order to generate an adjustable signal over a +/-10V range you would need external circuitry to supply +/-10V, and an amplifier (typically a circuit made up of one or more opamps) to scale the output of the DAC to the full +/-10V range.

If you want to update the DAC at very high rates, you will need to ensure that you don't exceed the 446 DAC's slew rate, or the slew rate of any external amplifiers.  Nominal update rate on the DAC's is 1Msps; in order to achieve full swing (+10 to -10V, or -10 to +10V) in 1us, every stage of the analog circuitry would need to have a minimum slew rate of 20V/us.  This is a big ask, but not impossible.