Please help a new guy get going with a PIC10F222


Closed Thread
Results 1 to 12 of 12

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 Manual - Section 4.4 Aliases

    Not 100% sure what you are after but ...
    Your software guy probably likes code that is well documented and easy to read – don't we all. I do the following all the time when in your situation. I set up a variable that I plan to use locally and then set up an alias to that variable.

    Example:

    AppleCount var BYTE ; define variable in RAM
    OrangeCount var AppleCount ; alias to AppleCount

    ; early in the program
    For AppleCount =1 to 10
    Do Something
    Next AppleCount
    .
    .
    .
    ;Latter in the program

    OrangeCount = PORTB

    Select Case OrangeCount
    Case 1
    Do something
    Case Else
    Do something else
    End Select

    As you can see, the variable is reused and readability is maintained.

    Paul Borgmeier
    Salt lake City, Utah
    USA

  2. #2
    Quacker's Avatar
    Quacker Guest


    Did you find this post helpful? Yes | No

    Default

    Great Paul,

    I set up a number of aliases and it works fine, even when the ram was so full that one more "something VAR BYTE" chokes the compiler.

    I'm all set!

Similar Threads

  1. I2C with a PIC10F222 - is it possible
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th September 2009, 05:01
  2. Help with waking a PIC10F222
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd August 2009, 03:08
  3. Programming PIC10F222
    By brid0030 in forum General
    Replies: 5
    Last Post: - 19th August 2009, 23:43
  4. I shut this guy down
    By T.Jackson in forum Off Topic
    Replies: 5
    Last Post: - 25th May 2007, 04:27
  5. Danger ...unfair Guy
    By Acetronics2 in forum Off Topic
    Replies: 3
    Last Post: - 10th September 2005, 12:57

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