Hello
And you need to set up 2 analog ports and 4 digital ports
Analog ports work well the buttons do not work
I am in doubt about the configuration of adc
Can anybody help me
About this
Here the schematic of pic18f2550
clear
DEFINE OSC 48
define LOADER_USED 1 'USB carregador de inicialização
define RESET_ORG 1000h
'--- Setup ADC -------------------------------------------------------------
TRISA=%11111111:PORTA=%00000000
TRISB=%00000011:PORTB=%00000000
TRISC=%11000010:PORTC=%00000000
ADCON1= %00001100
ADCON2.7 = 1 'Right-justify result in ADRESH:ADRESL
Define ADC_BITS 10 'Set number of bits in result
Define ADC_CLOCK 3 'Set clock source (3=rc)
Define ADC_SAMPLEUS 50 'Set sampling time in uS
Thank you
Bookmarks