saving RCREG to word


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    thanks for confirming the ~ 3bytes buffer. I guess I need to change the part of the code that is in main and move it to the interrupt.

    Please tell me if this is possible or if I completely missed it. I want to create a 4 word buffer, each word holds a manchester encoded servo position. Every interrupt will pack a byte into the high portion of the word and the next interrupt packs the lower byte of the word. It does this for the remaining 3 words. In main, the code looks at the byte number index and determines which servo to update out of the 4 servos.

    The idea is to keep the bytes streaming in up to date even when in the pauseus pulse output portion of the code.

    Can I in the inline assembly specify moving an 8bit register into the "high" or "low" byte of a variable? Like movf servo1.L, RCREG and movf servo1.H,RCREG ?

    Thanks!

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Macgman2000 View Post
    ... Can I in the inline assembly specify moving an 8bit register into the "high" or "low" byte of a variable? Like movf servo1.L, RCREG and movf servo1.H ...
    No problem,

    Let's say you have a WORD variable in BANK0 ... (It should be in BANK0).

    TempWord VAR WORD BANK0

    in ASM, the LowByte comes first, so that's at the address of the variable itself.
        movwf     _TempWord

    The HighByte is 1 address more
        movwf     _TempWord + 1
    DT

Similar Threads

  1. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  3. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  4. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23

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