Microchip pic10F220


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Hi cyberbiota,

    Put 10F2* into search box and hit enter.


    ----------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Perhaps like this.

    Hi,
    As far as I can see from reading the datasheet everything is controled by the ADCON0 register. Here's my untested shot at it:

    Code:
    Result var BYTE
    
    TRIS = %00000001		'Set GP0 Input, rest as outputs.
    
    ADCON0.7 = 0     		'Set GP1 as digital
    ADCON0.6 = 1	 	'Set GP0 as analog
    ADCON0.0 = 1	 	'Turn ADC module ON
    
    ADConvert:
        ADCON0.3 = 0
        ADCON0.2 = 0	            'Select AN0 for covertsion.
        ADCON0.1 = 1	            'Start conversion.
    
        While ADCON0.1 = 1       'ADCON0.1 will be reset when conversion is done
        WEND                          'so lets wait here 'till then.
    
        Result = ADRES	'Store result.
    
    Toggle GPIO.1		'Or whatever.....
    Pause 250
    Goto ADConvert		'Do it again.
    May work, may not, have a look at section 7.0 in the datasheet.

    /Henrik Olsson.

  3. #3
    cyberbiota's Avatar
    cyberbiota Guest


    Did you find this post helpful? Yes | No

    Default Thanks!!!

    Henrik and Sayzer-

    Thanks for all of the info. I never thought of trying the wildcard extension in the search box...duh!!!

    peter

Similar Threads

  1. Microchip Code Issues
    By Destovi in forum General
    Replies: 4
    Last Post: - 20th March 2008, 14:32
  2. PBP is no longer a stranger to Microchip
    By MarioC in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th March 2008, 23:59
  3. Replies: 1
    Last Post: - 22nd June 2007, 01:57
  4. Microchip CDC Firmware with My OWN VID/PID ?
    By viewgsm in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th June 2007, 03:33
  5. Microchip Floating Point Routines
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th October 2006, 20:51

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