here is the gist of the code im running:
@ device pic12f683,INTRC_OSC_NOCLKOUT , wdt_on, mclr_off, protect_off
DEFINE OSC 4
DEFINE ADC_BITS 10
DEFINE ADC_SAMPLEUS 50
ANSEL = %00000010 ' GPIO.1 A/D in, rest digital
TRISIO = %00010010 ' GPIO.1 lectura AD,
cmcon0 = %00000100 ' AD via gpio1 and internal reference
vrcon = %10001010 ' set vref=2.25v
.
.
.
loop:
oldpote=pote
ADCIN 1, pote ' (0-65535)
if oldpote <> pote then
hpwm 1,inverduty,frecu 'these values are calculated in other section
endif
goto loop
maybe the problem is that im using ADC and HPWM simultaneously?
I don't undertand what you implied by reading that section of the DS.
Thanks!
Bookmarks