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

Reply via email to