* Analog and Digital


+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    76

    Default * Analog and Digital

    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
    Attached Images Attached Images  

  2. #2

    Default Re: * Analog and Digital

    What value are you reading on A0 and A1?
    George

  3. #3
    Join Date
    Aug 2008
    Posts
    76

    Default Re: * Analog and Digital

    Hello, how are you
    The port AO and A1 will read 2 battery
    And it will show on the LCD that it is not in the scheme there.
    I'm not getting the input and output port configuration
    thank you

  4. #4

    Default Re: * Analog and Digital

    So what value do you actually read on A0 and A1 ( a number somewhere between 0 and 1023)?
    George

  5. #5
    Join Date
    Aug 2008
    Posts
    76

    Default Re: * Analog and Digital

    Yes
    I already have the channel reading AO and AI
    My problem and the buttons that do not work on other channels
    I have not eaten them two buttons
    OK

  6. #6

    Default Re: * Analog and Digital

    Sorry I didn't read your original post correctly, show more code.
    George

Similar Threads

  1. Analog Digital Conversion ??
    By gunayburak in forum General
    Replies: 3
    Last Post: - 28th December 2012, 16:52
  2. analog and digital
    By lerameur in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th June 2008, 02:40
  3. digital to analog conversor
    By sirvo in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd January 2008, 20:46
  4. PortA analog and digital IO
    By krohtech in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th November 2007, 02:25
  5. Digital to Analog Converter
    By kutsi in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 27th June 2007, 19:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts