I am trying to use the Arduino Uno to read an AVCLan bus on a Toyota vehicle. Logic 0 is when +/- drive are 120mV or more apart, and logic 1 is 20mV or less. See Toyota AVC-Lan description.
I currently set the TCNT1 timer to /1 prescaler for resolution, and waiting in a loop until the ACO bit sets in ACSR. Using this, I measure the amount of time the signal was logic 0, and calculate each bit based on the how long the timer ran, and then resetting it.
While this works fine for most messages, I do receive a "glitch" every couple messages, with on-times around 2uS - 4uS, which shouldn't happen on this bus. I'm guessing the analog comparator is tripping up if the drive is around 10mV - 20mV, when it shouldn't set.
Is there any way to set up a threshold, so that it will only fire the comparator at say 100mV or above?