I'd like to intercept and count pulses sent to a stepper driver.
I'd like to intercept and count pulses sent to a stepper driver.That's up to 400Khz (200-300 actually, but I'd like to be higher end proof) on 3 to 6 channels of pulse_pin + direction_pin.
Making something with logic requires time to develop, perhaps there is a counter chip with I2C ? I don't know.
I don't know, if any of the Arduino boards support twor or more such counters, but UNO and MEGA support just one counter with external source, I think.
As the overhead of interrupt-handling is about 4µs
You have not said what you mean by "gathered information".
Perhaps if you explain what you are trying to achieve it would enable you to get better advice.Can't you use the software that is creating the pulses to keep a count?
That's disappointing, I thought there are 6 timers 4 being 16 bit on Mega.That's some useful information. Thanks.
Send current pulse count of all channels to another Arduino.
I want to make a middle-man device between computer or another G-Code processor, that will compare pulse count to real positions via encoders and measure applied forces to issue stop if anything goes beyond limits with stepper motors or act as "servo processor" in case of DC motors.
It has: http://www.atmel.com/Images/doc2549.pdf
You could not possibly send the count value after every single pulse at 400kHz.
For example, given that you can't send the count value after every pulse (if the pulses are fast) how can you decide when to send the count values so that they have some meaning for your "protection" system.
The normal arrangement would be for the computer generating the step pulses also to monitor the encoder pulses so that it can immediately see a discrepancy.
Of course not :)Well, polling at 100Hz would be good enough.......Yes, but also normal arrangement would mean specialized software and limited flexibility. Here I'd be able to use - PC with any software, GRBL, USB G-Code interpreters etc.
Even if you count the number of pulses in 10 millisecs and send that number to the PC I can't figure out how you can use that number to decide whether the machine needs to be switched off.
Well the whole idea is:The pulse count gets sent to another Arduino that monitors some other parameters