Thanks all for the help. I used a Teensy 3.0 bord from the drawer and it works great. I am reading a 2khz signal from the parport and converting it to a 40khz signal. Duty cycle is from 0% to 99%.

I have not checked the AVR but most micro controllers have timers with hardware support or duty cycle measurement. XMC4xxx or STM334 devopment boards have high resolution timers equal to a frequency about a few gigahertz.


On Tue, 25 Aug 2015 21:09:08 +1000
Erik Christiansen <[email protected]> wrote:

 On 25.08.15 10:30, Marius Liebenberg wrote:
> I have a couple of Teensy 3.0 boards in the drawer here and they are
 > pretty fast enough I think.
 > I am a bit allergic to the USB interface when one uses high current
 > switching devices on the machine. The USB interface is not that
 > reliable.

It would not be hard to use one Arduino timer in capture mode to measure M/S ratio of a low frequency PWM input (from LinuxCNC), then replicate the ratio on a higher frequency output on another timer. If the ratio of input and output frequencies were a binary multiple, then dividing the
 input mark to fit the higher frequency output would only be a right
shift of the requisite number of bits. (The AVR does not have hardware
 multiply, but software multiply would be OK, if preferred, if the PWM
 ratio doesn't change at a crazy high rate.)

 An interrupt on "capture complete" would be infinitely more efficient
than any polling hack, for input PWM measurement. The output timer would just run with auto-reload, responding to a new M/S ratio in the next cycle
 after it is written to the hardware register.

 A 20 MHz part could run 10 bits of count at 20 kHz, giving 0.1%
 resolution. Go for something like 9 bits, 40 kHz, and 0.2%, maybe?

 But mebbe you have all that figured, already.

 Erik

 --
Since late last year, Saudi Arabia has been flooding the world with cheap oil in an attempt to squeeze the life out of America's nascent shale oil industry,
 sending crude to six-year lows around $US40 a barrel.
- http://www.abc.net.au/news/2015-08-20/qantas-profit-propelled-by-lower-fuel-prices/6711174

------------------------------------------------------------------------------
 _______________________________________________
 Emc-users mailing list
 [email protected]
 https://lists.sourceforge.net/lists/listinfo/emc-users

------------------------------------------------------------------------------
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users
------------------------------------------------------------------------------
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to