Announcement

Collapse
No announcement yet.

No response from the uLCD-144(GFX), newbie

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • No response from the uLCD-144(GFX), newbie

    Hi, I’m trying to get the uLCD-144(GFX) to work in the SGC mode. I send 55hex (autobaud), 51hex 6hex (set the baud rate to 9600) and then 4Bhex FFhex FFhex. (set the background to white). This is all sent at 9600 baud using terminal inside of Workshop. I’m using a Sparkfun breakout board for the FT232RL to communicate with the uLCD-144. (an NPN transistor circuit is connected to the DTR signal on the FT232RL module)

    http://4d.websitetoolbox.com/post?id=4664334

    I can verify the data is getting to the LCD module using an oscilloscope. There is nothing on the display and there is not any serial response from the uLCD-144 module. (no ack or Nack) When I power up the module, the display screen comes on green and shows uLCD-144(GFX) 128x128, and version information for about 5 seconds. There is not an SD card installed. I don’t have a uUSB-CE5 to communicate with the uLCD-144.

    Any ideas what I doing wrong in the communication with the uLCD-144?

    Matt M.

  • #2


    The green screen and the displayed text indicates you have a GFX PmmC loaded.

    To get the display to work in SGC mode you need to replace the PmmC with the equivalent SGC PmmC.

    Hopefully, you will be able to do this with your breakout board, although some have reported issues in the past.

    If it gives you too much bother get a CE5, not worth wasting too much time
    Mark

    Comment


    • #3


      That worked great. I was able to get it into SGC mode and send serial commands.
      Matt M.

      Comment


      • #4
        Dear all,

        im a new here and i have many question. But i would like to start from the basics and we may help others to understand as well.

        I have a uLCD 144 loaded with SGC for serial communication with an external PIC16F88, and later for a project with PIC18F46K22.

        First of all i tried to communicate serially with the hardware serial ports of the PIC16F88.

        I send a command to initialize the Lcd and if you see in the begging i give time of 1 second to the lcd before the initialization.

        Code:
        pause 1000 
                 
         
        HSEROUT[$55]      ' uOLED Initialize this is the 'U' character of autoband rate to LCD
        hserout[$56,$01]  ' this is the Version info
        PAUSE 500          ' here if i do not give a delay then the CLEAR command does not work. 
        HSEROUT [$45]    ' clear the LCD
        Hserin 1000,MAIN,[wait("$06"),ser_in_data]
        Start:
        HSEROUT [$73,$00,$03,$11,$ff,$ff," Leonardo Bilalis",$00]
        'Hserin 1000,MAIN,[wait("$06"),ser_in_data]
        HSEROUT [$73,$02,$06,$10,$ff,"     Copyright 2018",$00]
        'Hserin 1000,MAIN,[wait("$06"),ser_in_data]
        HSEROUT [$45]    ' clear the LCD
        
        
        main:
        high porta.1
        pause 100
        end

        The problem is that when i try to open the serial terminal to see what i get a a response from the Display, i do not see anything.

        I have placed in the code to check whether a reply from the lcd is coming or not but i do not get any reply.

        Could you please help me to identify the response? From the code if i do not get a reply then we jump to LABEL main and light an LED.

        Really im desperate because i have many question following to this issue, and cannot continue my project because of that.

        Looking forward to your kind reply.

        Comment


        • #5
          I have 16 Mhz the PIC16f88 and baudrate 38400 with the uLcd.

          I found out that i grt a response from the display corresponding to what delay time i give for each instruction.


          As from the code the the following "string" is ok:

          Code:
          HSEROUT[$73,$00,$03,$11,$ff,$ff," Leonardo Bilalis",$00]
          PAUSE 10
          'Hserin timeout,main,[wait("$06"),ser_in_data] 
          
          
          HSEROUT[$73,$02,$06,$10,$ff," Copyright 2018",$00]
          PAUSE 500  ' here i have a 500ms delay just to be enough to see the text in the screen.
          if i remove the PAUSE 10 then the following is not displayed:

          Code:
          hserout[$73,$02,$06,$10,$ff," Copyright 2018",$00]

          and from the Terminal i get 06 15 at PICKIT2.

          In case i remove the PAUSE 10 and add the following:

          Code:
          HSERIN timeout,main,[WAIT("$06"),ser_in_data]  ' το timeout is 1000

          it doesnt do a thing and based on the code it sends it to main, (it looks like it doesnt know my code this: $06.

          Where is my mistake?

          When the HSERIN timeout,main,[WAIT("$06"),ser_in_data] is activated

          look what i receive from the serial terminal from PICKIT2

          RX: 06 this might be the response to HSEROUT[$55] ' uOLED Initialize this is the 'U' character of autoband rate to LCD
          RX: 01 10 17 28 28 this might be the response to HSEROUT[$56,$01] ' this is the Version info
          RX: 06 this might be the response to HSEROUT [$45] ' clear the LCD
          RX: 06 this might be the response to HSEROUT[$73,$00,$03,$11,$ff,$ff," Leonardo Bilalis",$00]

          So if i do not receive anything from the following command:

          Code:
          HSERIN timeout,main,[WAIT("$06"),ser_in_data]
          it jumps to
          ----------->>>>>>

          Code:
          main:
          high porta.1
          pause 100
          end

          Comment


          • #6
            Now based on a simple counter on the display, lets say to count from 1 to 100 with a delay of 10ms. I get what you see on the video. The same i get if i make larger the number for the delay like 100 or 200 or 300 even for 1000ms.....

            Why the number placed on the same area on the display are like this? Why the previous number is not disappeared in order the new number to be in its place? I see i mixed number from a previous and the new one or the next one on top of it and cannot read the value. What is going on?



            If i do not give any delay on the PAUSE at the following code in between i get the numbers displayed up to 40 or 48 then it stuck. I've noticed though that the numbers now goes smoothly and i can read them.

            Code:
            Start:
            for counter = 1 to 100
            HSEROUT [$73,$03,$02,$11,$ff,$ff,"Counter:", #counter,$00]
            'pause 10
            next counter
            goto start
            Last edited by astasuleo; 28th June 2018, 05:43 AM.

            Comment


            • #7
              Hi astasuleo, welcome to the forum!

              With regards to your code implementation, I suggest that you create a routine that checks the acknowledgment from the display rather than using a delay in ensuring the command to push through.

              Replies sent by the display are:
              06(hex): ACK byte if successful
              15(hex): NAK byte if unsuccessful

              You can implement the checking routine as follow:

              Pseudo Code:
              Code:
              Do something
              Check display response
                    If response = NAK
                        Repeat command
                    If response = ACK
                        Do next command
              About the superimposing texts, try to use the set of commands [$4F,$01]. This will set the opacity of the texts to 1, making objects behind the text be blocked by the background. Kindly refer to SGC manual.

              Hope this will help.

              BR,
              Vince_4D

              Comment


              • #8
                Dear Vince, really appreciate your prompt reply. I will check that tonight (European time zome) and will reply back with good resutls. Hopefully.

                Comment


                • #9
                  Dear all,

                  in the program i ask from the PIC to wait for 06 and i store it to a variable as follows. But the response from the LCD is 80

                  Code:
                  Counter         var byte
                  Timeout         CON 1000
                  ser_in_data     var byte
                  LED             var PORTA.1
                  low porta.1
                  counter = 0
                  ' -------------------------------------------------------------------------/  
                  '                          [ LCD Initialization ]                         /
                  '------------------------------------------------------------------------/
                            ' FIRST TIME BOOTUP: We give plenty of time for tbe LCD '
                  pause 2000  
                  HSEROUT[$55]      ' uOLED Initialize this is the 'U' character of autoband rate to LCD
                  hserout[$56,$01]  ' this is the Version info
                  PAUSE 500
                  HSEROUT [$45]    ' clear the LCD
                  pause 200
                  
                  hserout[$73,$00,$03,$11,$ff,$ff," Leonardo Bilalis",$00]
                  Hserin  timeout,main,[wait("06"),ser_in_data]  
                  'pause 10                  
                  hserout[$73,$02,$06,$10,$ff,"     Copyright 2018",$00]
                  pause 500
                  
                  HSEROUT [$45]    ' clear the LCD
                  pause 200
                  Click image for larger version  Name:	rx.png Views:	1 Size:	1.0 KB ID:	64237

                  Comment


                  • #10
                    I fixed the baudrate to 38400 with 16Mhz crystal,

                    same code as above now i get this from the display

                    Click image for larger version

Name:	rx2.png
Views:	26
Size:	1.2 KB
ID:	64239

                    Comment


                    • #11
                      ok FIXED it.

                      Please let me give my solution to this answer as many of other designers or engineers will struggle to identify the problem. It took me many hours as i'm not a programmer or having any relation with programming language. It is only my hobby.

                      So the display for the following commands response as:

                      Code:
                      RX:  06                                 so i had to convert it to this:
                      RX:  01 10 17 28 28             so i had to convert it to this:((
                      RX:  06                                 so i had to convert it to this:
                      RX:  06                                 so i had to convert it to this:
                      Code:
                      HSEROUT[$55]      ' uOLED Initialize this is the 'U' character of autoband rate to LCD
                      Hserin  timeout,main,[wait("")]
                      hserout[$56,$01]  ' this is the Version info
                      Hserin  timeout,main,[wait("((")]
                      PAUSE 500
                      HSEROUT [$45]    ' clear the LCD
                      Hserin  timeout,main,[wait("")]
                      pause 200
                      
                      hserout[$73,$00,$03,$11,$ff,$ff," Leonardo Bilalis",$00]
                      Hserin  timeout,main,[wait("")]          
                      hserout[$73,$02,$06,$10,$ff,"     Copyright 2018",$00]
                      Hserin  timeout,main,[wait("")]
                      pause 500
                      I did a png file to show you because the 06 to ASCII character is not displayed in here.

                      Click image for larger version

Name:	rx3.png
Views:	28
Size:	27.3 KB
ID:	64241
                      Last edited by astasuleo; 29th June 2018, 03:09 AM.

                      Comment


                      • #12

                        Hi astasuleo,

                        For our common reference, below is the interpretation of the bytes received by the host.
                        Command Bytes Received Description
                        HSEROUT[$55] 06 Autobaud executed
                        hserout[$56,$01] 01 10 17 28 28 device_type, hardware_rev, firmware_rev, horizontal_res, vertical_res
                        HSEROUT [$45] 06 Clear screen executed
                        hserout[$73,$00,$03,$11,$ff,$ff," Leonardo Bilalis",$00] 06 String writing executed
                        hserout[$73,$02,$06,$10,$ff," Copyright 2018",$00] 06 String writing executed


                        I would suggest not to use a delay in the program. It doesn’t necessarily mean that the command will be executed but it only gives enough time for the display to receive and process the command.

                        Also, I think there is no need for you to convert the received hex into a readable character/s, instead you can define a certain response such as below.

                        Traditionally,
                        ACK = 06
                        NAK = 15


                        You can also do as well for the display’s response after executing Version-Device Info Request if you want to utilize the outputs.

                        Note: Display response handling is very important in ensuring that the commands will be executed.


                        Btw, may I ask why you would want to run your setup in SGC PmmC? There is an available GFX PmmC for the device. It can be setup for serial communication (refer to this link) and with that, you can utilize the Picaso-Serial library which has proper handling for the response.


                        Best regards,
                        Vince_4D

                        Comment


                        • #13
                          Dear Vince,

                          thanks once again for your kind reply.

                          As i'm not a programmer, and it is really difficult for me to understand a programming language, i only use PBP3, (pic basic pro 3). I have started with this language and i think it is ok for me. Going to C it might be a big step, and i might need some C for PIC books to understand the basics.

                          The Display currently using is the ulcd 144 with a goldelox chip. Really i would love to see the PICASO serial library but as i right the command in pic basic and send them serial, how do i use the libraries in C.

                          Comment


                          • #14
                            There are some Pic Basic serial libraries included with Workshop, have a look at C:\Users\Public\Documents\4D Labs\Goldelox Serial\PicAxe

                            But these are for SPE, not SGC.

                            Pic Basic PRO 3 seems to be much more capable than Pic basic, but maybe looking at that code will give you some ideas
                            Mark

                            Comment


                            • #15
                              The following code is written in PBP3 for a very simple counter on the display shows how to use the uLCD 144 with an external microprocessor such the pic16f88.

                              Speed is at 16Mhz and baudrate communication is set at 38400.

                              On this simple counter i would like to show how fast the numbers can go without any problem on the LCD.

                              I will continue using 4D systems LCDs for my projects.

                              Code:
                              '****************************************************************
                              '*  Name    : COUNTER.BAS                                       *
                              '*  Author  : [LEONARDO BILALIS]                                *
                              '*  Notice  : Copyright (c) 2018 [LEONARDO BILALIS]             *
                              '*          : All Rights Reserved                               *
                              '*  Date    : 25 Jun 2018                                       *
                              '*  Version : 1.0                                               *
                              '*  Notes   :                                                   *
                              '*          :                                                   *
                              '****************************************************************
                              '------------------------------------------------------------------------|
                              ' PORTA.7  PORTA.6  PORTA.5  PORTA.4  PORTA.3  PORTA.2  PORTA.1  PORTA.0 |
                              '  bit7     bit6     bit5     bit4     bit3     bit2     bit1     bit0   |
                              '   0        0        0        0        0        0        0        0     |
                              '------------------------------------------------------------------------|
                              '------------------------------------------------------------------------|
                              ' PORTB.7  PORTB.6  PORTB.5  PORTB.4  PORTB.3  PORTB.2  PORTB.1  PORTB.0 |
                              '  bit7     bit6     bit5     bit4     bit3     bit2     bit1     bit0   |
                              '   0        0        0        0        0        1        0        0     |
                              '------------------------------------------------------------------------|
                              '*************************************************************************************
                              '                                                  ______________________________    *
                              '                                                 /                             /|   *
                              '                                                /     PIC16F88 PIN INFO       / |   *  
                              '                                               /_____________________________/  |   * 
                              '                     GND        RX-LCD        | PIN 1   : RA2/AN2/VREF       |  |   * 
                              '                      |           |           | PIN 2   : RA3/AN3/C1OUT      |  |   *
                              '                      |           |           | PIN 3   : RA4/TOCKI/C2OUT    |  |   *
                              '     18  17  16  15  14  13  12  11  10       | PIN 4   : RA5/MCLR/VPP       |  |   *
                              '    -------------------------------------     | PIN 5   : VSS - GND          |  |   *
                              '   |  R   R   R   R   V   R   R   R   R  |    | PIN 6   : RB0/INT/CCP1       |  |   *
                              '   |  A   A   A   A   S   B   B   B   B  |    | PIN 7   : RB1/SDI/SDA        |  |   *
                              '   |  1   0   7   6   S   7   6   5   4  |    | PIN 8   : RB2/RX/DT          |  |   *
                              '   |                            (TX)     |    | PIN 9   : RB3/PGM/CCP1       |  |   *
                              '   |              PIC16F88               |    |______________________________|  |   * 
                              '   |                            (RX)     |    |                              |  |   *
                              '   |  2   3   4   5   V   0   1   2   3  |    | PIN 10  : RB4/SCK/SCL        |  |   *
                              '   |  A   A   A   A   D   B   B   B   B  |    | PIN 11  : RB5/SS/TX/CK       |  |   *
                              '   |o R   R   R   R   D   R   R   R   R  |    | PIN 12  : RB6/T10SO/T1CKI/PGC|  |   * 
                              '    -------------------------------------     | PIN 13  : RB7/T1OSI/PGD      |  |   *
                              '      1   2   3   4   5   6   7   8   9       | PIN 14  : VDD +5V            |  |   * 
                              '                      |   ^       |           | PIN 15  : RA6/OSC2/CLOCKOUT  |  |   *
                              '                      |   ^       |           | PIN 16  : RA7/OSC1/CLOCKIN   |  |   *
                              '                     +5V  ^       |           | PIN 17  : RA0/AN0            |  |   *
                              '                          |       |           | PIN 18  : RA1/AN1            | /    *
                              '                        RX GPS  TX-Lcd        |______________________________|/     *
                              '                                                                                    *
                              '*************************************************************************************
                              
                              @ ERRORLEVEL -306 ; this command prevents the compiler to give you a notice of
                                                ; crossing page boundary - make sure bits are set 
                              #CONFIG 
                                  __config _CONFIG1, _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
                              #ENDCONFIG
                              
                              Include "MODEDEFS.BAS"
                              DEFINE OSC 16
                              'OSCCON=%01110000     '8 Mhz
                              CMCON = 7            'turn comparators off
                              ANSEL = 0            'All digital  
                              
                              TRISA = %00000000
                              TRISB = %00000100 
                              
                              DEFINE HSER_RCSTA 90h
                              DEFINE HSER_TXSTA 24h
                              DEFINE HSER_SPBRG 25 ' 38400 Bauds
                              DEFINE HSER_CLOERR 1
                              
                              
                              Counter         var byte
                              Timeout         CON 1000
                              ser_in_data     var byte
                              LED             var PORTA.1
                              low porta.1
                              counter = 0
                              ACK             var byte
                              ack = %00000110
                              NAK             var byte
                              nak = %00010101
                              ' -------------------------------------------------------------------------/  
                              '                          [ LCD Initialization ]                         /
                              '------------------------------------------------------------------------/
                                        ' FIRST TIME BOOTUP: We give plenty of time for tbe LCD '
                              pause 2000  
                              HSEROUT[$55]      ' uOLED Initialize this is the 'U' character of autoband rate to LCD
                              Hserin  timeout,main,[wait(6)]
                              hserout[$56,$01]  ' this is the Version info --> '01 10 17 28 28   -->> "(("
                              Hserin  timeout,main,[wait(1),wait(16),wait(23),wait(40),wait(40)]
                              HSEROUT [$45]    ' clear the LCD
                              Hserin  timeout,main,[wait(6)]
                              pause 500
                              
                              hserout[$73,$00,$03,$11,$ff,$ff," Leonardo Bilalis",$00] 
                              Hserin  timeout,main,[wait(6)]           
                              hserout[$73,$02,$06,$10,$ff,"     Copyright 2018",$00]
                              Hserin  timeout,main,[wait(6)]
                              pause 500
                              
                              Hserout[$4F,01]
                              Hserin  timeout,main,[wait(6)]
                              
                              HSEROUT [$45]    ' clear the LCD
                              pause 200
                              
                              '-------------------------------------------------------------------------
                              
                              Start:
                              for counter = 1 to 100
                              HSEROUT [$73,$03,$02,$11,$ff,$ff,"Counter:", #counter,$00]
                              pause 10
                              next counter
                              gosub main
                                     
                              main:
                              high porta.1
                              pause 100
                              end

                              Comment

                              Working...
                              X