Howdy all,
Know its been done before and there are hundreds of examples out there... but I'm got an awesome twist I'm trying to work with here.
It includes:
8 Analog Inputs
ATmega16
Rigol scope (ps don't give up guys working in the dis-assembly of the Rigol 1052 firmware in another thread)
Current Transformers
Some C programming
So I'm making use of the on chip multiplexer with is switching the Analogue to Digital Converter (ADC) as WELL as the Comparator.
My system is governed by interrupts, every second or so it changes the MUX to the next input, it then disables the ADC and enables the comparator and waits for a zero crossing, this multiplexing is not a problem and its all working, as far as I know.
The strange thing I\m running into is this, I'm not using the comparators interrupt, instead, I've configured it to Capture the contents of Timer1 (for frequency measurement), so the comparators interupts area and the Timer1 Input Capture Interrupt is enabled. This works fine, however, I'm now unable to select the rising or falling edge as a trigger, it only interrupts on the falling edge.
And in theory this should not be so... or do I have this wrong?
Anyone ever worked on something similar?
Ultimately I want to measure the frequency and amplitude or all inputs.