PIC14000 adc


Closed Thread
Results 1 to 2 of 2

Thread: PIC14000 adc

  1. #1
    Doug's Avatar
    Doug Guest

    Default PIC14000 adc

    Does anyone have any code for reading the adc in a pic14000. PBP's adcin does not support pic14000.

    Thanks in advance.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I never use PIC1400 but the following work on 16F877 without using ADCIN, maybe you can use a part of it. Compare both datasheet may help if there's any difference between both

    Code:
    A_D_Val  VAR BYTE
    
    TRISA = %11111111  ; Set PORTA to all input
    ADCON1 = %00000010 ; Set PORTA analog and LEFT justify result
    ADCON0 = %11000001 ; Configure and turn on A/D Module
    Pause 500
    
    Start: 	
    ADCON0.2 = 1 ;Start Conversion
    
    ConversionNotcomplete:	
         pause 10
         if ADCON0.2 = 1 Then ConversionNotComplete
         adval = ADRESH				    
         Lcdout $fe, 1,"Result=",DEC A_D_Val
         Pause 200
         Goto Start
    hope this may help!!!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  3. PIC18F2423, ADC problem
    By mistergh in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th March 2009, 01:31
  4. ADC value with 2 decimals on an LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2005, 15:54
  5. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55

Members who have read this thread : 1

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