I'm developing a code in which I want certain instructions to only execute When there is an input signal present at the ADC, i.e, that part of the code only happens when you're actually playing. My natural inclination was to use the SKP instruction, and if the ADC signal is zero then the instructions will be skipped, like so:
Code: Select all
LDAX ADCL ; Load the left channel ADC into the ACC
SKP ZRO, skp1 ; If value is zero, skip ahead to skp1
; additional instructions..
skp1: RDAX REG0, 1.0 ; Read the contents of REG0 into the ACC
WRAX DACL,0 ; Write to the left channel of the DAC
So, my question is twofold: 1) Am i correct in my assumption that noise is the problem, or am i missing something obvious about how the ADC represents values/functions? 2) Is there an easy way to filter/modify the ADC value such that it'll actually reach zero when there's no input signal, or should i try another approach?
Thanks in advanced for any help!