After applying the correct knock_conf settings using the keyboard (or terminal), i was able to get the car to read the knock sensors properly.
In my application, the setting I needed was 55. This relates to where the knock sensors are located in relation to the h[2] table, or ignition firing order
So you can either set it to AA, or 55 which translates into binary as such
AA = 10101010
55 = 01010101
so you can see they are basically using that to determine which sensor to poll
In my previous tests, megatune had set this value to FD which may or may not be a valid setting ( i will assume not since it didn't work well)
Through my testing i found that the bandpass filter in the knock chip is pretty wide. Most of my testing was done by altering the frequency of my frequency generator and not the amplitude. It took a considerable change (1k hz) in frequency to change the knock output. I'll have to check back into the documents to see if they call out what order the filter is
So what i was trying to duplicate in my tests was this graph from the chip doc
At the top is the sine wave used as an input
The green line shows when the chip is polled to convert or integrate the sample (knock window / noise window sampling)
The red is the output which is applied to the analog input of the AVR
This was the best plot i got, but the values are shifted slightly up and down
When the red pulse is high, we are taking the samples. I'm assuming the first window is knock, and the second is noise.
The blue line is the output. You can see its a ramp, as the knock signal is being integrated (finding the area under the curve)
At this point i was pretty happy with the results! sometimes i have to see things happening to be convinced they are working
Here is a plot showing how VEMS alternates sensors ( i only had one sensor being tested)
I was even able to set the threshold values and simulate knock on the running motor by changing my frequency.
So know with everythign hooked back up properly, i need to hit the road and log the noise and knock valves to be able to properly set the different thresholds