Hi all,
I’m beginner and I tried modified A/D converter of USBDemo from 8 to 10 Bits, but does not work. I insert definition for 10 Bits resolution, but output value is still 8 Bits.
How can I adjust in USBDemo A/D converter from 8 to 10 Bit resolution?

Thanks, Kuba230


' USBDemo
' =======
'
' File name : USBDemo.pbp
' Company : Mister E
' Programmer : Steve Monfette
' Date : December 30,2006
' Device : PIC18F4550 & 4MHZ crystal
'
'
' Short and sweet demo to send and read from USB bus.
'
' Hardware:
' ---------
' 4 Push Buttons on PORTA<5:2> with pull-down resistors
' 2 Trim pot on PORTA<1:0>
' 8 LEDs attach between PORTB and GND
' 2 LEDs attach to CCP<2:1> pins
' 4 MHZ crystal & all the usual USB stuff
'
'
' Software:
' ---------
' A ready to run PC interface is also available, it's VB6 source code as well
'
' Enjoy!
'
'
' Pic Configuration
' =================
asm
__CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
; ; ; USB clock source comes from the 96 MHz PLL divided by 2
; ; [OSC1/OSC2 Src: /1][96 MHz PLL Src: /2]
; No prescale (4 MHz oscillator input drives PLL directly)


__CONFIG _CONFIG1H, _FOSC_XTPLL_XT_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
; ; ; Oscillator Switchover mode disabled
; ; Fail-Safe Clock Monitor disabled
; XT oscillator, PLL enabled, XT used by USB
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_2_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_OFF_2H
__CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H
__CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
endasm
DEFINE OSC 48

Define ADC_BITS 10 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 20 ' puvodni (50) Set sampling time in uS