I have been searching to the web to discover if the Arduino is fast enough to read a 1Mhz signal, unfortunately I have only managed to get confused as some posts suggest that it is not possible while others suggest the opposite.
The signal in question is encoded using Manchester bi-phase coding which I think means that the bit rate is half the clock rate i.e. 500khz.
I propose to use a comparator IC to slice the input signal back into a binary data stream and would like to use the Arduino to read the bits and pass the bytes of data to a computer connected to the USB port.
Will the Arduino work if I address the ports directly?
I know the uart is rated above 115k and I would think that the arduino could grab and assemble the bits with some clever coding. You wouldn't have time to do much more than store it to ram though. Is this a short stream?
I may have mixed my terms when describing the data stream that I wish to decode but whatever its called the data stream I wish to decode XORs a 1 Mhz Clock with NRZ data resulting in a data stream described in documentation as "Manchester II Bi-Phase Level".
Wikipedia describes Manchester encoding as "Manchester encoding is a special case of binary phase-shift keying (BPSK), where the data controls the phase of a square wave carrier whose frequency is the data rate."
My basic question remains as how quickly can the input pins respond to a digital signal?
best wishes
Simon
With a 1 MHz bitclock, data may change state twice per bit-period. This is the equivalent of one state change for every 8 instruction cycle. That is you will have no more than 8 single cycle machine instructions available in order to measure time between pulses and let alone do anything useful with it. This may be at the border-line of being possible with an optimized assembly routine, but most certainly there is no support from within the Arduino core and avrlib to do so.
This would be quite a challenge even for a 10 times faster micro controller, so I would rather look at interfacing with external decoding hardware.
Have you tried to google for Manchester decoder chips?
Thanks for the pointer towards dedicated chips. I am new to modern electronics and am a steep learning curve. I was not aware that dedicated chips existed so will have to start searching for them.