ADCIN with PIC18F4620


Closed Thread
Results 1 to 2 of 2
  1. #1

    Default ADCIN with PIC18F4620

    Does anyone know if ADCIN and its associated DEFINES work with the PIC18F4620?

    As part of a migration from a 16F877 I noticed that the adcon registers are more numerous and somewhat different.

    To check what was happening, I put in debug statements after the block of DEFINE ADC_.. statements and observed that the contents of adcon0,1 & 2 were all zero as though the DEFINES had had no effect. My DEFINES are genuinely upper case, which I believe is an MPASM requirement.

    I have now set these registers directly (adconx = %xxxxxxxx) and the debug confirms that their contents are now as expected.

    Subsequent ADCIN statements do not give the expected result and I wondered if I would have to abandon ADCIN and trigger the conversion manually by toggling GO/DONE in adcon0.

    Any ideas? TIA,

    Brian Walsh.
    Last edited by Brian J Walsh; - 4th July 2008 at 00:10.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    On the 18F4320 I do the toggle to get it working.
    Here is the way I do it.
    Code:
    getT2:
    	ADCON0=$5  
    	gosub getAD
    	temp2 = ADRESH
    	return
    
    getAD:
    	pause 50
    	ADCON0.1 = 1
    	pause 50
    	return
    And I have to set ADCON1 with the dec value: Example
    ADCON1=13

    But that is me
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. ADCIN and PIC18F4331 Arghhhhh !
    By GrandPa in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th December 2010, 20:27
  2. How to make adcin stable?
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th January 2009, 07:41
  3. ADCIN Problem
    By JavPar in forum General
    Replies: 33
    Last Post: - 20th January 2009, 03:36
  4. Adcin or Pot
    By lerameur in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 11th January 2007, 16:46
  5. help using adcin
    By harryweb in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 31st January 2006, 07:46

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