HSEROUT No Output Problem


Closed Thread
Results 1 to 11 of 11
  1. #1

    Default HSEROUT No Output Problem

    I have a problem that I can not seem to figure out. If I use the line of code:

    hserout [sign,dec3 temp/10,".",dec1 temp//10,10]

    I get nothing display in my serial window however it says that it is receiving bytes. If I remove the "sign" from the line it works fine. Can someone shed some light on this one for me because it is driving me nuts.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Have you tried using the DEC modifier before sign?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3


    Did you find this post helpful? Yes | No

    Default

    I load the variable with:

    Code:
        if temp.8 = 1 then                          ' If bit8 of temperature is set then its negative		
         sign = 45                                  ' Indicate temperature is NEGATIVE
         temp.lowbyte = temp.lowbyte ^ 255	        ' Reverse the bits of the lowbyte of TEMP
         sign = 160                                 ' Indicate temperature is POSITIVE
    	endif
    If I use DEC then my output is messed up. I did try it though and it does output.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Try this;
    Code:
    if temp.8 = 1 then                          ' If bit8 of temperature is set then its negative		
         sign = "-"                                  ' Indicate temperature is NEGATIVE
         temp.lowbyte = temp.lowbyte ^ 255	        ' Reverse the bits of the lowbyte of TEMP
         sign = "+"                                 ' Indicate temperature is POSITIVE
    	endif
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Same thing, I tried this approach as well.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    I don't understand what it actually is that I'm sending since there is nothing displayed in the serial window. It just keeps increasing by 6 bytes at a time.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    How do you know it's increasing if there's nothing showing in the serial window?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8


    Did you find this post helpful? Yes | No

    Default

    I'm using the Serial Communicator in MCSP which display TX and RX in the bottom status bar.

  9. #9
    Join Date
    Aug 2005
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    If you haven't already,double check each variable by re-sending each one individually,with and without LF,in combinations,to see if the answer falls out.The other possibility is the receiving program may have limits that are removing characters,like buffer size.
    I use a program call Simple Terminal from BB Electronics.It runs in dos window,but displays everything.

  10. #10


    Did you find this post helpful? Yes | No

    Default

    I feel pretty dumb right now. If you look at the code there is no else if the if statement.

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Red face

    if temp.8 = 1 then ' If bit8 of temperature is set then its negative
    sign = "-" ' Indicate temperature is NEGATIVE
    temp.lowbyte = temp.lowbyte ^ 255 ' Reverse the bits of the lowbyte of TEMP
    sign = "+" ' Indicate temperature is POSITIVE
    endif

    > So, no sign if positive , or + sign if negative ??? ... doesn't really mean the same.

    > And I'm wondering if "sign" value is defined somewhere else ...if positive !

    Alain
    Last edited by Acetronics2; - 22nd August 2005 at 17:46.

Similar Threads

  1. I2C Slave with a PIC
    By ralfmayr in forum mel PIC BASIC Pro
    Replies: 129
    Last Post: - 21st August 2016, 17:44
  2. HSEROUT and Commas, What? Help Me Understand
    By altech6983 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th July 2009, 19:12
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46
  4. HSEROUT Newbie question/problem
    By Mark Scotford in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 11th July 2006, 14:44
  5. HSEROUT Problem
    By Keith in forum General
    Replies: 2
    Last Post: - 25th June 2005, 15:09

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