procurando ideias para viabilizar pedais com FV-1, esbarrei na solução do FSB, é muito simples, um pic12f675 e um potenciômetro. O Vídeo abaixo mostra funcionando:
https://www.youtube.com/watch?v=niVOomlajlEO código, também não mata ninguém - só adaptei (pouco) para usar o piklab no linux:
; -----------------------------------------------------------------------
; Template source file generated by piklab
#include <p12f675.inc>
; based on code by slacker
;3 bit glitchless A2D converter
;Version 2 12/10/2013
; __________
; VDD ---| |--- VSS
; ---| 12F675 |--- Bit 0
; CV In ---| |--- Bit 1
; ---|________|--- Bit 2
__CONFIG _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _BODEN_OFF & _CP_OFF & _CPD_OFF
UDATA 0x20
new RES 1
current RES 1
count RES 1
org 0
Start:
banksel GPIO
clrf GPIO ;clear GPIO
movlw 07h
movwf CMCON ;turn off comparators
banksel ANSEL
movlw b'00010000' ;set pin3 as input rest as output
movwf TRISIO
banksel ANSEL
movlw b'00011000' ;set pin3 as analogue input (AN3)
movwf ANSEL
banksel ADCON0
movlw b'00001101' ;turn on ADC on AN3 left justified
movwf ADCON0
Mainloop:
nop ;wait for a bit
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
banksel ADCON0
bsf ADCON0,GO ;Do ADC
btfsc ADCON0,GO
goto $-1
banksel ADRESH
movf ADRESH,w
movwf new ;write upper 8 bits to new register
swapf new,f ;swap upper and lower bits
rrf new,w ;move 1 step to the right bits 5,6,7 now in positions 0,1,2
andlw b'00000111' ;clear 5 upper bits
movwf new ;write back to new register
subwf current,w ;subtract from current value
skpz ;skip next line if zero ie:- new = current
goto counter ;if new <> current goto counter
movlw b'11111111' ;reset count to 255
movwf count
goto Mainloop ;back to the start
counter:
decfsz count,f ;deduct 1 from count, if count = 0 skip the next line
goto Mainloop ;if count > 0 go back to the start
movf new,w ;if count = 0 move value of new to current
movwf current
banksel GPIO
movwf GPIO ;and send to GPIO
goto Mainloop ;back to the start
end