A/D converter fails?


Results 1 to 15 of 15

Threaded View

  1. #5
    egberttheone's Avatar
    egberttheone Guest


    Did you find this post helpful? Yes | No

    Default

    this code works but if you change the input port of the a/d convertor and then add a pause in the line between changing and a/d conversions start then it stucks.

    example:

    Code:
    'retrieve sound level
    ADCON0.5 = 0
    ADCON0.4 = 0
    ADCON0.3 = 0
    pause 50
    AD_Progress = 1
    while AD_Progress = 1: wend
    Sound_Level.lowbyte = ADRESL
    Sound_Level.highbyte = ADRESH
    
    'retrieve negative level
    ADCON0.5 = 0
    ADCON0.4 = 0
    ADCON0.3 = 1
    pause 50
    AD_Progress = 1
    while AD_Progress = 1: wend
    Negative_Voltage.lowbyte = ADRESL
    Negative_Voltage.highbyte = ADRESH
    
    'retrieve positieve level
    ADCON0.5 = 0
    ADCON0.4 = 1
    ADCON0.3 = 0
    pause 50
    AD_Progress = 1
    while AD_Progress = 1: wend
    Positive_Voltage.lowbyte = ADRESL
    Positive_Voltage.highbyte = ADRESH
    Last edited by egberttheone; - 8th February 2006 at 21:12.

Similar Threads

  1. Replies: 9
    Last Post: - 31st July 2008, 08:56
  2. A/D converter sample
    By allan josephus in forum mel PIC BASIC
    Replies: 5
    Last Post: - 23rd February 2008, 19:44
  3. A/D converter with pic16f84, i need a help
    By micro in forum General
    Replies: 0
    Last Post: - 13th December 2005, 21:17
  4. help with pic16f870 a/d converter
    By cammo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 22nd March 2005, 05:16
  5. Re Cs5532 A/d Converter
    By massquip in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th April 2004, 16:31

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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