A Little surprise with PbP 2.50 ...


Closed Thread
Results 1 to 31 of 31

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    I understand that you have a problem when you compile
    Code:
    LCDOUT $FE,$C0," ", SDEC2 Tair,"°C "
    where the degree symbol is not correctly translated in
    the corresponding LCD character.

    Are you sure that during the source code parsing the compiler
    gets the correct character? This is why I suggested to try on
    a 100% English United States system.

    Best regards,

    Luciano

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Luciano,

    There was no problem with 2.47 release

    so, Understand that is not my problem ... but melabs' !!!

    I've had a quick look to see if I could debug it by myself ... just found the problem occurs with > 127 ASCII input ( keyboard ) values.

    I'm just a system user ... and my computer knowledge stops at the letters stamped on my keyboard !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    ASCII characters with the high bit set are extended ASCII codes. As far as I know, all
    compilers that accept ASCII codes between the double quotes only work with standard
    ASCII codes. Not extended codes.

    I have tried your example with extended ASCII codes "°öµC" with versions 2.47 and 2.5
    of PBP, another BASIC compiler, and two C compilers. They all output the same garbage
    where each extended ASCII character is between the quotes. All non extended codes
    print as expected.

    PBP 2.50 seems to be the only compiler that shows the warning, but they all print junk
    on my LCD where extended ASCII codes are located in the string, between the "".

    Did you get PBP v2.47 to actually print these extended ASCII characters "as shown", in
    between the " " on your LCD, or did it just not throw the warning?

    I'm just curious because I get the same results with 5 different compilers.
    Regards,

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

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Smile Thanks to Bruce ... the solution.

    Hi, Bruce

    ... I've used a lot of DS1820 temp monitors without noticing anything for years.

    BUT ... having a further look to those programs, I notice I've ever used the HEX value ( $DF ) ... instead of the " ° " Keyboard input ...

    a try ( 2.47 and 2.50 ) gives not garbage ... but characters from the 128-256 code section of the characters map.

    And now, we've a Warning !!!


    One more notice to add to my poor old manual ... there might be a blank page between two command ones ... to add one's comments. LOL.


    So, Let's keep in mind that Complementary table can only be accessed sending HEX Values ... like here:

    Lcdout $fe, 1, DEC (temperature / 100), ".", DEC2 temperature, " ",$DF,"C"


    Alain

    PS : Pfouuuuu, I was not so far from the RTFM !!! ...
    Last edited by Acetronics2; - 15th October 2007 at 15:08.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    It is a bit confusing I guess, but maybe this will help explain it.

    When you place the degree symbol inside quotes like this "°" the value gets converted to
    $B0.

    If you send $B0 to a terminal program like this: HSEROUT [$B0] it will display the ° symbol.
    If you try this with LCDOUT, the value of $B0 displays a - symbol. Which is what it should
    be if you look at the LCD data sheet.

    You can use extended ASCII characters like "°öµC" with no problem if sending it to an ASCII
    terminal program, and it displays each character just fine. It's just no going to produce what
    you might expect when formatting data like this for an LCD display. The compiler "assumes"
    data is being formatted for an ASCII terminal.

    HSEROUT ["º°A",13,10] ' prints º°A to an ASCII terminal. These were entered with ALT 167,
    and ALT 248 on the numeric keypad.

    LCDOUT $FE,$C0,"º°A" ' produces ]-A on an LCD, but LCDOUT $FE,$C0,"[]{}!@#$%^&*()_+"
    prints everything as shown.

    Why 2.5 throws the warning up I'm not sure, but it's probably something they should look
    into. Or at least indicate in the manual that ASCII codes >127 aren't supported in quotes.
    Regards,

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

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Smile The official answer ...

    Hi, Bruce,

    thanks for your enlightments.

    find here the answer from Melabs :

    "
    For special characters such as this, it is better to specify the
    character using its numeric ASCII code. I believe this will work:

    LCDOUT $FE,$C0," ", SDEC2 Tair, $B0, "C "

    I believe you could ignore the warning and the display would be
    correct, but it's always a good idea to resolve warnings as they come
    up.

    Charles Leo
    microEngineering Labs, Inc. "

    Solution confirmed ... and thanks to melabs.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Assuming Tair = 32d;

    Which version prints 32°C on your LCD?

    LCDOUT $FE,$C0," ", SDEC2 Tair, $B0, "C "

    or;

    LCDOUT $FE,$C0," ", SDEC2 Tair, $DF, "C "

    or;

    LCDOUT $FE,$C0," ", SDEC2 Tair, 223, "C "
    Regards,

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

  8. #8
    Join Date
    Sep 2006
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Thanks for the solution

    Quote Originally Posted by Acetronics View Post
    Hi, Bruce,

    thanks for your enlightments.

    find here the answer from Melabs :

    "
    For special characters such as this, it is better to specify the
    character using its numeric ASCII code. I believe this will work:

    LCDOUT $FE,$C0," ", SDEC2 Tair, $B0, "C "

    I believe you could ignore the warning and the display would be
    correct, but it's always a good idea to resolve warnings as they come
    up.

    Charles Leo
    microEngineering Labs, Inc. "

    Solution confirmed ... and thanks to melabs.

    Alain


    Taking note.....

Similar Threads

  1. PBP 2.50 and Longs
    By mikendee in forum GPS
    Replies: 1
    Last Post: - 21st May 2008, 22:16
  2. PBP 2.50 UPGRADE problems!!!!
    By earltyso in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 7th March 2008, 16:42
  3. Strange problem with PBP 2.50
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th October 2007, 21:45
  4. MCS+ with PBP 2.50
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st September 2007, 06:52
  5. New PBP 2.50?
    By Dave in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 9th September 2007, 20:14

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