New to 10F220


Closed Thread
Results 1 to 14 of 14

Thread: New to 10F220

  1. #1
    Join Date
    Aug 2010
    Posts
    25

    Default New to 10F220

    Hi.

    I'm relatively new to PIC's and I have never used the PICF220 before...

    I can't understand how to set the I/Os, TRIS and then?

    And since I'm already asking, how to set the port(s) to be ADC?

    I read in the manual that the internal clock isn't really calibrated, but measured and a correction factor is programmed into the memory.
    How to use it properly? (Without overwriting it when programming the PIC.)

    PS. The PBP doesn't list the PIC10F220, but I guess choosing 222 will work?


    Best regards from a newbie

  2. #2
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171


    Did you find this post helpful? Yes | No

    Default

    I've not had much luck historically using the 10F series, PBP requires too many background resources . Have a look at the 12F series for small projects with PBP

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mikebike View Post
    Hi.

    I'm relatively new to PIC's and I have never used the PICF220 before...

    Best regards from a newbie
    Hi, Mike

    No hope to run a PBP program with the 10F220 ... too small a RAM size.

    assembler seems the only way with those lilliputian chips ...

    That's why they won't be listed any day ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Everything you need is in the data sheet.

    You can set the port directions using TRISIO.x=y where x is the GPIO bit number and y is 0 out output or 1 for input. Or use the PBP INPUT or OUTPUT commands, for example:
    OUTPUT GPIO.0
    INPUT GPIO.3

    The ADC is set with ADCON0. Page 30 of the data sheet tells you what to set it to for various configurations.

    Are you using MPASM as your assembler? MPASM has files for the 10f220, so if are using it you would just have to make your own PBP files for it. Use the 10f222 PBP files as a base and change the CODE_SIZE to 100h and the included MPASM file to P10F220.INC

    The internal oscillator is set up in that config file with: _IOFSCS_4MHZ or _IOFSCS_8MHZ

    *edit* 2 above replies beat me - havnt tried PBP on this pic, so they may be right.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  5. #5
    Join Date
    Aug 2010
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Oops, not much use learning how to use the 10F220 then....

    Which PIC do you guys recommend then?

    I use PBP and Melabs U2 Programmer.
    I need 2 x ADC, 4 x I/O, internal clock and small size (low price).


    EDIT: Low power is not a drawback.
    Last edited by mikebike; - 15th September 2010 at 11:32.

  6. #6
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    The 12F510 would be the cheapest that meets your requirements:

    http://www.microchip.com/wwwproducts...cName=en023670

    *edit*: as long as you dont need a lot of code space. The code space is 4 times that of the 10F220, but still limited.
    Last edited by Kamikaze47; - 15th September 2010 at 11:37.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  7. #7
    Join Date
    Aug 2010
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    The 12F510 would be the cheapest that meets your requirements.
    My local supplier don't have the 12F510 in DIP-package, only in SMD.

    The PIC12F629 is slightly more expensive, but in stock in DIP. ??

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mikebike View Post
    My local supplier don't have the 12F510 in DIP-package, only in SMD.

    The PIC12F629 is slightly more expensive, but in stock in DIP. ??
    The 629 has no ADC !!!

    Choose 12F675 ... or the 12F683 which is not really more expensive, but offers lots of interesting features and ... 2K program space.

    BTW ... could have been an idea to tell us what you intend to do ... don't you think ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    BTW ... could have been an idea to tell us what you intend to do ... don't you think ???

    Alain
    Or even better, define cheaper. After all is a $2-3 part too much? Is there a budget amount in mind? Is board space an issue?

    Lots of variables when considering a PIC.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  10. #10
    Join Date
    Aug 2010
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    The 629 has no ADC !!!

    Choose 12F675 ... or the 12F683 which is not really more expensive, but offers lots of interesting features and ... 2K program space.

    BTW ... could have been an idea to tell us what you intend to do ... don't you think ???

    Alain
    Thanks for pointing me in the right direction.

    My first project is very simple:
    A 9 minute timer with a short blink every second to show that it's counting and a low battery indicator. I need 1 x ADC and 2 x output (LEDs) for this project.

    Next project is almost as simple:
    A temperature regulator with 3 different levels that will be exucuted in a preset sequence, for example start-go to 50C-wait for x minutes-go to 28C-wait z minutes-got to 32C.
    A bicolour LED shall indicate the different steps.
    A potentiometer shall be able to adjust the temperatures +/- 2C.
    I need 2 x ADC and 3 x output (2xLED + TRIAC) for this.
    Last edited by mikebike; - 15th September 2010 at 13:21.

  11. #11
    Join Date
    Aug 2010
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    Or even better, define cheaper. After all is a $2-3 part too much? Is there a budget amount in mind? Is board space an issue?

    Lots of variables when considering a PIC.
    Well, the 12F683 is about $2 and that's OK. The products will sell for around $80, hopefully.

    Instead of small size, I could have stated 8DIP with the possibility to go to 8SOIC in the future.


    I will probably be back very soon with more stupid questions about PIC12F683, but that will be a new thread!

  12. #12
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mikebike View Post
    Thanks for pointing me in the right direction.

    My first project is very simple:
    ...
    Next project almost as simple:
    ...
    .
    Ok ...

    12F675 is nice ... but a bit limited if some PWM or Compare jobs used ...

    you can start with the 12F683 ( 8 pins with the more peripherals / SMD available - 12F1822 nice too ( brand new chip ! ), if you do not intend to drive a LCD.

    16F886 ( 28p ) or 887 ( 40p ) if you need more pins .... cheap and numerous peripherals.


    Alain
    Last edited by Acetronics2; - 15th September 2010 at 13:28.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  13. #13
    Join Date
    Aug 2010
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    you can start with the 12F683
    Got to start somewhere....
    My test program with two blinking LEDs worked right away with the 12F683, so I think I will use that for now.
    Both my projects will hopefully be products, but probably not in large numbers.
    Last edited by mikebike; - 15th September 2010 at 13:45.

  14. #14
    Join Date
    Aug 2010
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    I'm trying to educate myself using some educational materials that include a LAB X-1 and PIC16F877A, a bit overkill for my needs.


    I have been an electronic designer for about 30 years, but I realize that many times a PIC is a better/smaller solution than OP-amps, timers and counters.

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