PIC10F202 Variable trouble


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Another option that does not involve ASM, EXT, or altering files (but should work even though it is slightly contrived.)... You are low on Data Ram but big on Program Space (200 of 512 words used) right?

    1) Change the IF-AND-THEN to nested IF-THENs as noted by Steve and Bruce

    2) b0 ranges from 0-3 (2 bits). Drop the b0 variable and stash the values in OPTION_REG<1:0> (with the prescaler pointed to the Timer, which you are not using)

    3)Time2 ranges from 0-73 (7 bits). Drop the Time2 variable and store the lower 5 bits in the FSR register, the 6th bit in OPTION_REG<2>, and the 7th bit in OPTION_REG<4>.

    The rest of your variables fit – the code to deal with the above changes adds some complexity but would not be hard to implement.

    Yet another option (you said commercial product – the price difference between the 202 and the 629 in quantity is about 0.30USD). Live with the loss or charge your customer a little more and have a clean solution with the 12F629.

    Yet another option – take a week to learn ASM if you do not already know it. This part (10F202) has little complexity and it would not be difficult to convert your code to ASM. Bruce has a good ASM example posted in the example code section plus there are lots of good tutorials out there.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  2. #2


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi,

    Depending on the volume of sales you expect, it may be worth the expense of switching to a different compiler for this project.
    I’ve heard that the Hitech PIC C-compiler is very good at producing lean and reliable code. It’s pricey though.

    Another option is the Proton compiler (at least the latest version that comes with PDS). A guy on that forum was able to compile your program using only 12 vars. This is a much cheaper option and should be really easy to port over from PBP (both are basic compilers).

    Alternatively, maybe someone on the PDS forum could simply give you the HEX file for your program (for free or maybe only a small fee).
    It’s a pretty simple program so, unless you’re planning on making lots of changes to it, that may be the cheapest option.

    Cheers,
    ---> picnaut

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by picnaut
    Another option is the Proton compiler (at least the latest version that comes with PDS).
    i know you could'nt resist...
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Thanks for all your help guys very useful info all of you - I'll have a play with it next week and see what I can sort if I can't sort it I might see if one of you guys wouldn't mind being paid to convert to asm.

    Cheers

  5. #5
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Question

    Quote Originally Posted by paul borgmeier

    Yet another option – take a week to learn ASM if you do not already know it. This part (10F202) has little complexity and it would not be difficult to convert your code to ASM. Bruce has a good ASM example posted in the example code section plus there are lots of good tutorials out there.
    Off/on topic... Can I use PBP to compile for the 202, but other than declaring constants and variables, do everything in assembly? And...will this add code to the program as opposed to writing it on MPASM?

    Thanks,
    Ron

  6. #6
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Unhappy

    Duh!
    I asked the same question in February. I should probably do a search before I post and embarrass myself!

    Ron

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ron Marcus
    Duh!
    I asked the same question in February. I should probably do a search before I post and embarrass myself!

    Ron

    It shall be your right to ask the same question again if you did not get the (an) answer in Feb. I see no embarrassing.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  8. #8
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    No...I got the answer back then too! I've got to switch to lead free solder!

Similar Threads

  1. EEPROM Variables (EE_Vars.pbp)
    By Darrel Taylor in forum Code Examples
    Replies: 79
    Last Post: - 26th October 2012, 00:06
  2. problem with variable on PIC10f202
    By Samoele in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th October 2009, 17:29
  3. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. Trouble with Serin2 and variable size
    By Ryan7777 in forum Serial
    Replies: 6
    Last Post: - 5th October 2006, 16:40

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