TMR1H and TMR1L into a word variable


Closed Thread
Results 1 to 3 of 3
  1. #1
    xnihilo's Avatar
    xnihilo Guest

    Default TMR1H and TMR1L into a word variable

    Let's say I want to check the value of the TMR1 in a loop in which I'm polling the state of a pin to create some Timeout check.

    I read in the datasheet that TMR1L is at address $0E and TMR1H is at $0f..
    I guess I can create a WORD variable after making an alias to TMR1L and check the value of the word variable.

    Something like:

    tmr1value VAR WORD
    tmr1value.lowbyte = TMR1L

    then read tmr1value

    Is this right?

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


    Did you find this post helpful? Yes | No

    Default

    Better to use this
    Code:
    @TMR1Word = TMR1L
    TMR1Word VAR WORD EXT
    http://www.picbasic.co.uk/forum/showthread.php?t=3891
    Steve

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

  3. #3
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Default

    Excellent. Thank you, I will try that.

Similar Threads

  1. 16f877A and tmr1 external crystal question
    By comwarrior in forum General
    Replies: 3
    Last Post: - 13th July 2009, 00:40
  2. pic basic i2c bus does not work
    By tamertokgoz in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th June 2008, 22:57
  3. Writing to high/low variable pairs?
    By kevj in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st September 2007, 18:00
  4. Timers !
    By n qwerty in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd August 2007, 11:39
  5. Measuring change of frequency with PIC
    By Aussie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th July 2007, 01:47

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