A/d 16f88


Results 1 to 6 of 6

Thread: A/d 16f88

Threaded View

  1. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default

    Hi Steve,

    Don't use a VAR to define the A/D channel. Use the channel's number instead:
    Code:
    ADCIN 5, bat
    You can test your project with your code I trimmed to minimum:
    Code:
    INCLUDE "modedefs.bas"
    
    Define LCD_DREG PORTA
    Define LCD_DBIT 0
    Define LCD_RSREG PORTA
    Define LCD_RSBIT 6
    Define LCD_EREG PORTA
    Define LCD_EBIT 4
    Define LCD_BITS 4
    
    bat  var byte
    
    OSCCON = %01100000
    ANSEL  = %00100000
    
    Bat_Volts:
       ADCIN 5, bat
       LCDOut $FE, 1, "Battery = ",DEC bat, "V"
       PAUSE 2000
       goto Bat_Volts:
    end
    BTW, PORTB.6 is ADC Channel 5
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3431&stc=1&d=124367750 7">
    Attached Images Attached Images  
    Roger

Similar Threads

  1. 12f675 A/d Miseries
    By MARAD75 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 16th December 2008, 02:16
  2. 12F675 A/D and GPIO sleep interrupt
    By macinug in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th September 2008, 14:39
  3. Need advice on A/D
    By james in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th August 2007, 19:30
  4. A/D converter fails?
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th February 2006, 18:57
  5. 18F2525 A/D, Comparator and Vref modules
    By fbraun in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th May 2005, 23:17

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