Writing to high/low variable pairs?


Results 1 to 5 of 5

Threaded View

  1. #3
    Join Date
    Aug 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Thanks Bruce!


    .... I found the relevant part, but I don't understand it.

    I see these code snips...

    Code:
    @Timer1 = TMR1L
    Timer1  VAR  WORD EXT
    and "re-loading the timer is just as simple as..."

    Code:
    T1CON.0 = 0  ; stop timer
    Timer1 = Timer1 + TimerConst
    T1CON.0 = 1  ; turn timer back on
    and "another example"

    Code:
    @Capture = CCPR1L
    Capture   VAR  WORD EXT


    In the first example...

    @Timer1 = TMR1L
    Timer1 VAR WORD EXT

    "@" is a straight ASM line, apparently defining "Timer1" to equal TMR1L. Though this says nothing for what TMR1H should be called. The second line Timer1 VAR WORD obviously defines Timer1 as a variable for PBP - and the EXT has something to do with not doing something with it until it compiles - I didn't understand what that post was getting at.


    I'm also again seeing in the above post the inter-changing of various forms of hex numbering. I see "1234h" as well as "$1234" and again, I don't understand why you would use the hex in the first place as it's difficult to read - and again my question, is there some way to just write the value you want "12,385" in your code and have PBP turn it into binary or hex as required when compiling? The need to have to "hex" all your integers seems like a complicated additional step and I don't understand what it needs to be done.

    Thanks.
    Last edited by kevj; - 1st September 2007 at 06:13.

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. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  3. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  4. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  5. WORD vs BYTE variable lengths
    By bartman in forum General
    Replies: 0
    Last Post: - 28th November 2005, 21:16

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