SHIFTOUT syntax not understood - can't send any variables contents, while text is ok


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: SHIFTOUT syntax not understood - can't send any variables contents, while text is

    Try something like
    Code:
    MyVar = $30+Cnt_A
    shiftout sdo,SCK,mode,[MyVar]
    If that does not work post exactly what the display is displaying.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default SHIFTOUT syntax not understood - can't send any variables contents, while text is ok

    Unfortunately it doesn't work.

    I see characters, displayed one by one, just if it would be the display's internal character set that is listed. But it is not exactly following the character's set order; some characters follow correctly the table and then it jumps to some further characters and so on.

    Every displayed character appears on the first position of the display which is correct according to the "set cursor home" command.

    My LCD is a EA DOGM081x-A and ST7036 controlled.
    Roger

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,605


    Did you find this post helpful? Yes | No

    Default Re: SHIFTOUT syntax not understood - can't send any variables contents, while text is

    SHIFTOUT sends the content of the variable in "binary" format, not as ASCII text - which I believe is what the display is expecting. It's like sending a variable using HSEROUT where you use the DEC-modifer to send the content of a variable as text instead of as a "raw number".

    Unfortunately SHIFTOUT does not (AFAIK) support any modifiers (DEC, HEX etc) so you need to do it manually. This compile but I can not test it.
    Code:
    temp = CNT_A / 1000
    GOSUB SendIt
    
    CNT_A = CNT_A - (temp * 1000)
    temp = CNT_A / 100
    GOSUB SendIt
    
    CNT_A = CNT_A - (temp * 100)
    temp = CNT_A / 10
    GOSUB SendIt
    
    temp = CNT_A - (temp * 10)
    GOSUB SendIt
    
    END
    
    SendIt:
      SHIFTOUT SDO, SCK, MODE, [temp + 48]
    RETURN
    /Henrik.

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: SHIFTOUT syntax not understood - can't send any variables contents, while text is

    Thanks a lot Henrik.

    Your code works effectively

    I'm not used to use the SHIFTOUT command so I got to learn how it works.

    Thank you.
    Roger

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