Microchip pic10F220


Closed Thread
Results 1 to 4 of 4
  1. #1
    cyberbiota's Avatar
    cyberbiota Guest

    Default Microchip pic10F220

    Does anyone have any experience with the new 10F2XX parts? I am looking to migrate a fairly simple design from the 16F676 to the 10F220 (smaller part, less expensive & etc.) and have never used any of the baseline parts before. I need to be able to run one chanel of ADC and output PWM. Are there any tricks to setting the ADC register on this part? I just sampled a few of them, but thought I could start tweaking the code whilst I wait...

    TIA-

    peter

  2. #2
    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

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    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.

  4. #4
    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, 13: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, 22:59
  3. Replies: 1
    Last Post: - 22nd June 2007, 00: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, 02:33
  5. Microchip Floating Point Routines
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th October 2006, 19:51

Members who have read this thread : 2

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