Announcement

Collapse
No announcement yet.

PixxiLCD 13P no ACK messages

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

  • PixxiLCD 13P no ACK messages

    Hello all,

    i received a PixxiLCD display and i'm trying to communicate via serial commands with external PIC18F266K22.

    The problem is that i do not get any ACK from the display. I use a Picbasic pro, i know it not a new one but it works for me.

    Code:
    HSEROUT [$00,$18,"TEXT HERE".$00]
    HSERIN [wait(6)]
    I tried to connect the screen to PICKIT2 and use the UART tool, but there is no ACK messages from the Display.

    Do i have to activate the ACK messages?

  • #2
    It looks like i solved it.

    I went throught the serial commander tool and realised that the ACK is not the same as the datasheet for serial commands specifies.

    So i end up using the Serial commander tool. It is really helpful.

    so the ACK for the previous command is 8 and not 6.

    Comment


    • #3
      now there is an other problem in terms of programming. I think it is quite simple.

      Im sending a command to for the TXT color through the Serial Commander tool.

      txt_FGcolour[FFE7 64BD]

      and the ACK is : ACK 25789

      when in the picbasic code i send the command

      Code:
      HSEROUT[$FF,$E7,$64,$BD]
      what is the ACK that i neet to check with the following command? according to this ACK 25789?

      Code:
      HSERIN[wait ()]

      Comment


      • #4
        Nearly every command has a response in addition to the ACK, if you refer to the serial command reference it mentions what it is for every command
        eg

        putstr[0018 "Text Here"] 0.003 (ACK 9 0x0009)
        response from manual "acknowledge (byte), stringlength (word)"
        So there's a one byte ACK(0x06), followed by a two byte length(0x0009, or simply 9)

        eg2
        txt_FGcolour[FFE7 64BD] 0.001 (ACK 2016 0x07E0)
        response from manual "acknowledge (byte), colour (word)"
        So there's a one byte ACK(0x06), followed by a two byte colour(0x07E0, decimal 2016), being the previous value of the FG Colour.
        Mark

        Comment


        • #5
          thanks Mark i will try it out.

          Comment


          • #6
            Thanks Mark for the help.

            Now i need to import a bigger smoother Font in the display. (im using the display in SPE mode)

            Is there any way to import a new FONT?

            thanks.

            Comment


            • #7
              If the font is smallish you can add it to SPE, if it is too big for the internal memory it can be placed on uSD, or put in flash.

              Whether you can get by with txt_Width(), txt_Height(), or a combination, is also another consideration.

              Ho to add a uSD font is described in this app note. Not sure if that app note will 'translate' to using Flash fonts

              https://docs.4dsystems.com.au/app-note/4D-AN-00089

              To add font4 into SPE do the following
              1. Navigate to C:\Users\Public\Documents\4D Labs\4DUpdates\Utils
              2. Edit SPE2PV15.INC with a text editor (V15 is the latest that you should have)
              3. Insert #
              4. inherit "FONT4.fnt"
              5. as a new line after, say, line 10
              6. Save this edited file with a higher number, eg SPE2PV99.INC
              7. Reload SPE using Workshop

              Font 4 will now be available, however you will need to use 0x8007 as the font number.
              To do that with a different font you will need to generate the font using 'fonttool' (export the font as a '4DGL include')
              Attached Files
              Mark

              Comment


              • #8
                Mark to be honest i lost the steps after the 2nd on your previous post.

                I did open the SPE2PV15.inc file. But then what should i do.

                Apart from that i have created with your tool a font ComicSans26.....attached in this message as .rar file.

                Having this ComicSans26.inc file, which is almost 116kb how could i add it to flash memory of the pixxilcd 13p?
                Attached Files

                Comment


                • #9
                  OK, now I know the font you want, I'll work out the best way to load it.... Back later
                  Mark

                  Comment


                  • #10
                    So ComicSans26.inc is 116KB, but it is a 'data' file so it occupies much less space than that when included in the SPE.

                    It generates an SPE that fits, so you don't need to use flash with this font.

                    I've updated the SPE file for you. (The prefix is SPE2X, for piXxi, I copied and pasted too much of the earler instructions SPE2P is for Picaso)

                    So, unzip the file and put it in C:\Users\Public\Documents\4D Labs\4DUpdates\Utils

                    Put the font in C:\Program Files (x86)\4D Labs\4D Workshop 4 IDE\INCLUDE

                    The reload SPE

                    The SPE prompt should now show rev 9.0 (That was another change in the SPE2XV90 file)

                    Now in serial commander
                    Code:
                    txt_FontID[FFE5 8007] 0.001 (ACK 2 0x0002)
                    putstr[0018 "abcdef"] 0.006 (ACK 6 0x0006)
                    Will result in abcdef showing in comic sans 26
                    (0x8007 is 32775 decimal, just to you can enter it into serial commander)
                    Attached Files
                    Mark

                    Comment


                    • #11
                      Wow, it worked. So i guess with the same process i could change the SPE and or add a new Font.

                      I will try by my self and let you know the results.

                      Comment


                      • #12
                        Can we add 2-3 fonts in the SPE

                        Code:
                        >?Platform?<
                        
                        // 2020/07/16 Initial release for Pixxi
                        // 2020/08/17 Add uSD / Flash differentiation in Splash
                        
                        #STACK 360
                        #MODE RUNFLASH
                        
                        #inherit "comic26.inc"
                        #inherit "comic36.inc"
                        #inherit "Arial36.inc"
                        
                        #inherit "4DGL_16bitColours.fnc"
                        
                        #constant >?PixxiMode?<
                        
                        #IFNOT EXISTS PIXXI_FLASH
                        // If Using Pixxi uSD PmmC, file_LoadImageControl should be
                        // for the microSD card taking only String values for Filenames
                        #constant resCtrl 'G'
                        #constant pmmcmedia "u"
                        #ELSE
                        // If Using Pixxi Flash PmmC, file_LoadImageControl should be
                        // for the Flash chip taking only integer values for address
                        #constant resCtrl 'I'
                        #constant pmmcmedia "f"
                        #ENDIF
                        I tried to do so (maybe i did something wrong) and it didnt let me update the new SPE. (maybe there is not enough space)

                        I have used only one Font as you can see from the picture, but it would be nice to fit at least one more size.
                        Attached Files
                        Last edited by astasuleo; 16 August 2021, 10:41 PM.

                        Comment


                        • #13
                          Yes, if you look at the message down the bottom it says something like
                          Code:
                          Error: maximum program size of 32750 for device has been exceeded (code size required 54626)
                          So if you want more fonts it will be best to go down the Flash route for them.

                          I have attached a new SPE, it has the inherits commented out now, but has a function that wasn't previously there before to enable you to utilize fonts in flash.

                          I've also attached a simple ViSi program to add both comic36 and Arial36.inc.

                          Compile and load the flash by opening the project and pressing Shift F9. It doesn't matter if you load the program as it has a destination of RAM.

                          Place the new SPE in the usual place and load it.

                          Start Serial Commander and do a 'Media Init'
                          Code:
                          media_Init[FF89 ] 0.597 (ACK 0 0x0000)
                          Disconnect Serial Commander and start the Terminal program. This is because what you are about to do is not supported by serial commander.
                          Send hex 0009000000000003
                          Code:
                          9:33:17 AM > 00 09 00 00 00 00 00 03
                          9:33:17 AM < 06 1C D6
                          This is file_LoadImageControl(0,0,3) to load an image control from Flash. Note the handle returned, in this case 0x1CD6

                          Now select font 0 using send hex FE741CD60000
                          Code:
                          9:37:42 AM > FE 74 1C D6 00 00
                          9:37:42 AM < 06 00 02
                          This is the img_TxtFontID(handle, index) to select a font using the handle, so the second word is the handle from above and the third is the index of the font 0

                          Disconnect terminal and reconnect serial commander, now if you 'putstr' some text it will appear in the selected font
                          Code:
                          putstr[0018 "abcdef"] 0.011 (ACK 6 0x0006)
                          You can select font 1 using send hex FE741CD60001.

                          You can add more fonts in the project in Widgets, System/Media using the 'Font' button, and changing the settings by clicking on the font name.

                          Then rebuild and load the flash.

                          The fonts will be in the order added to the project, but if you want to check them, have a look at the twoFonts.4DWork\GCF.map file with a text editor
                          Attached Files
                          Mark

                          Comment


                          • #14
                            Hi Mark, that is a detailed explanation. Really appreciate it. It worked!

                            Now i need to understand and try to send those values from external pic via serial interface. So i can choose the font for my application.

                            There is a problem with a degree symbol in fonts. The one i have created via the font tool, is ok. Because i have replaced the star symbol * with the degree symbol.

                            But what about a degree symbol in other internal fonts.... 0,1,2???

                            Editted: i have temporarly used the circle symbol to place it between the commands.

                            It is not efficient at all but effected.
                            Attached Files
                            Last edited by astasuleo; 18 August 2021, 07:12 AM.

                            Comment


                            • #15
                              Internal fonts are ASCII and so only have characters from 0x20 to 0x7F

                              So the two fonts you loaded are ANSI, in general, in the ANSI character set character code 0xB0 is the degree symbol.

                              Both the Comic Sans and Arial character sets conform to this, so simply sending code 0xB0 when you want to see they degree symbol should work.

                              You can see what codes get used beyond 0x80 for each character set by using the windows CharMap utility.

                              Be aware that some editors, when you type in what appears to be a certain symbol, that the editor might change it to something in the unicode code space that has the same appearance but wont display correctly. Usually a copy and paste from CharMap will always result in the correct display.
                              Mark

                              Comment

                              Working...
                              X