i didnt realise it will stop and wait for a pulse for a while before it continues
is there a twin processor arduino on the market that can be used to read multiple high speed pulses ?
how do you get 2 arduinos to talk to each other and transmit information back and forth
I do not think there is a board with two of the same chips for sale, just the yun, tre and zero ( soon ).
To communicate between them in serial, SPI would be the fastest, or if you have enough spare pins a set of parallel lines to flag interrupts and latch blocks of data.
pulsein() doesn't count number of pulses, it tells you how long they are.
nb. Counting number of pulses and getting the length of pulses can all be done in hardware, just don't expect the standard Arduino functions to do it for you...
pulsein() doesn't count number of pulses, it tells you how long they are.
nb. Counting number of pulses and getting the length of pulses can all be done in hardware, just don't expect the standard Arduino functions to do it for you...
yes - understood
i just use it as a flag to let me know a pulse has taken place and then measure the time between them if the pulse width > 0
Gadget999:
The arduino is jamming because the interrupt is stopping the serial communication from continuing.
Are you absolutely sure that this is the problem?
You are not trying to print from an ISR are you because that will not work. But there are ways round this that should not cause a jam.
I think you would have to post your code to get a clearer picture of what you are doing.
the serial transmission stops when the speed of pulses increases
That could be for many reasons, do you know the frequency that this happens at? Is the ISR (Interrupt Service Routine ) taking too long? Is it printing a lot of data? Is the speed it happens dependent on the serial baud rate? Have you tried faster baud rates?
What arduino are you using, for example a Leonardo does not actually use the baud rate value in the serial port.
i will try some faster rates and see what happens and report back
Don't bother, when communicating back to the computer with a Leonardo the baud rate setting is totally irrelevant, the transfer happens at the fastest rate no matter what the speed. Do some simple tests and see.