High byte lost in HSEROUT a Word variable


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588

    Default High byte lost in HSEROUT a Word variable

    Hi,

    I probably can't see the forest because of the trees on this one, but I can't understand why the high byte of a Word variable is lost during HSEROUT:

    Defined as:
    CheckSum var word

    This loses the high byte, only 1 byte is sent:
    hserout [CheckSum]

    This sends both bytes properly:
    hserout [CheckSum.byte1, CheckSum.byte0]

    Can someone clue me in why this is so? I couldn't find anything in the manual to explain this (PBP 2.60C).

    Thanks!

    Robert
    Last edited by Demon; - 7th October 2012 at 22:30.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: High byte lost in HSEROUT a Word variable

    Robert, The hserout command only sends bytes, 8 bits at a time. by saying "hserout [CheckSum.byte1, CheckSum.byte0]" you are telling the hserout command to send 2 bytes sequentially. You should look at the modifiers to be used with the hserout command, much like serout, lcdout and the such.
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588


    Did you find this post helpful? Yes | No

    Default Re: High byte lost in HSEROUT a Word variable

    Ok, that makes sense.

    Thanks!

Similar Threads

  1. BYTE versus WORD and time
    By RussMartin in forum General
    Replies: 2
    Last Post: - 5th February 2010, 04:20
  2. i2c and byte or word
    By aftab in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd August 2007, 05:14
  3. Accessing several bits together in a byte or word...
    By rossfree in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th May 2007, 19:07
  4. WORD vs BYTE variable lengths
    By bartman in forum General
    Replies: 0
    Last Post: - 28th November 2005, 22:16
  5. bit, byte or word?
    By peterdeco1 in forum General
    Replies: 5
    Last Post: - 5th December 2004, 15:04

Members who have read this thread : 1

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