2016-04-02 07:39 PM
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?2016-04-02 09:41 PM
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.
2016-04-03 04:54 AM
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.2016-04-03 09:17 AM
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.
2016-04-03 09:42 AM
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.2016-04-03 11:20 AM
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.
2016-04-03 12:11 PM
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.