• Pic® Basic


  • Proton Serial Graphics LCD

    Published on 29th November 2016 16:04


    Buy Now

    Introduction


    LCD displays are an invaluable aid to programming, as well as offering ...



    From £74.95 + VAT


    Buy It Now: Direct

    Introduction

    Graphic LCDs are not only great fun to use, they also offer a very professional finish to an end product. However, cost has always been a issue, as graphic LCDs are frequently many times more expensive than their alphanumeric counterparts. But thanks to the graphic LCDs that Crownhill supplies, this is now not an issue, as they offer both affordability and flexibility.

    The SGLCD

    This comprehensive development system will allow you to produce stunning displays using powerful commands via a serial interface to the LCD. This complete development system offers not only the Serial Interface board coupled to a high quality Graphics LCD panel, but also powerful utilities to download graphics to the Onboard memeory AND commented source code for the Serial Graphics LCD controller AND circuit diagrams. This development system is all that is required to both learn about and use Graphics LCD's.

    Please Note: this is a complete development system. Our 128x64 Graphics LCD's are very affordable, and the PCB's for the serial interface are available separately, so after purchasing the development system, why not build your own serial interface and integrate a Graphics LCD into your next PIC® BASIC application!

    See it in action

    See the Serial Graphics LCD in action, download these two 5MB QuickTime Movie files showing the SGLCD board running the sloppy dog screen images in real time !

    http://www.compile-it.com/support/glcd.mov

    http://www.compile-it.com/support/glcd2.mov

    Position the cursor over the file name and click the right mouse button, then select "save target as..." to save the file to your local machine

    Easy-to-use

    There are two main problems when interfacing to graphic LCDs: board layout and controlling software. Board layout can be a problem because the LCD requires up to 20 pins to be wired. Controlling software can be a problem because of the complex nature of displaying anything of any use on the LCD. The Proton PIC® BASIC Development Suite (available separately) takes the hardship out of controlling an LCD with commands such as PRINT, PLOT, LINE, CIRCLE etc, and now the complex interface is not a problem thanks to the PROTON Graphic LCD Serial Development Board (shown below).



    Using a simple RS232 serial interface, you can PRINT, SCROLL, PLOT, SAVE and LOAD screens, (plus much more) on the LCD. And not only that, but you can develop your own software then program the on-board PIC® microcontroller using either the Proton Development Suite's Bootloader, or a conventional Device programmer such as the EPIC®. These features coupled with full source code for the serial interface commands offers a truly enjoyable, educational and time saving development platform, as well as a finished product for your final There are two software source files and listings supplied with the development board, one for controlling it using the Proton Plus compiler’s Serial Terminal that uses standard ASCII text; which is ideal for testing and demonstrating some of its capabilities. And one that is intended to be controlled from another microcontroller using less cumbersome binary controls. We’ll take a look at the Serial Terminal controlled software to start with, as this is already loaded on the development board when supplied.

    Simple Test Set-up

    Supply 6 to 9 Volts of power to the board via its power socket, and a short splash screen will be displayed. While the splash screen is busy, open the serial terminal built into the compiler’s IDE, by clicking on VIEW->SERIAL TERMINAL (see below).

    You will be greeted with a window looking something like the screenshot below.





    Now the Com port and Baud rate requires setting up. Click on the open Com icon, and a small menu will appear (see below).

    Choose the appropriate Com port, according to the setup of your PC. The illustration above shows Com1 being chosen. Note: that the Com port chosen should be the same as the Com port used to download the program to the Development Board (more details later). When the Com port is chosen, another window will appear that will allow the Baud rate to be set (see below).





    Set the Baud rate to 9600 (as above), and we’re ready to send some commands to the graphic LCD.

    Just as a starter, type the following text on the terminal all in UPPER CASE and in quick succession.

    B3F1F1001

    And displayed on the graphic LCD should be a square, as shown below. OK, so it’s not an exact square, but that’s because of the aspect ratio of the graphic LCD’s pixels. They are approx 1.5 times taller than they are wide.



    If a square did not appear, then try again but type quicker, and don’t forget to type in UPPER CASE.

    The collection of characters told the serial LCD to draw a square “B” at X position 3F (decimal 63) and Y position 1F (decimal 31), with a RADIUS of 10 (decimal 16), and SET the pixels “01”

    Note that all the values are formatted as 2 character HEX values. This is true for all the commands that have parameters, and all future discussions will be based on Hexadecimal values unless otherwise stated.

    Now type ‘B3F1F1000’ and the square will disappear because the same XPOS, YPOS and RADIUS have been entered, but now a command to CLEAR the pixels was sent “00”

    With that small (but crucial) test carried out, we can continue with a detailed discussion of the commands available.


    PROTON Graphic LCD Serial Interface Commands


    - DISPLAY TEXT
    - CLEAR the LCD
    - POSITION the CURSOR
    - SET or CLEAR a SINGLE PIXEL
    - DRAW a CIRCLE
    - DRAW a SQUARE
    - DRAW a LINE
    - SCROLL the DISPLAY UP
    - SCROLL the DISPLAY DOWN
    - SMOOTH SCROLL the DISPLAY UP
    - SMOOTH SCROLL the DISPLAY LEFT
    - SMOOTH SCROLL the DISPLAY RIGHT
    - SMOOTH ROTATE the DISPLAY UP
    - SMOOTH ROTATE the DISPLAY DOWN
    - SMOOTH ROTATE the DISPLAY LEFT
    - SMOOTH ROTATE the DISPLAY RIGHT
    - SMOOTH ROTATE PART of the DISPLAY LEFT
    - SMOOTH ROTATE PART of the DISPLAY RIGHT
    - SAVE a SCREEN to EEPROM MEMORY
    - LOAD a SCREEN from EEPROM MEMORY
    - UPLOAD a SCREEN
    - DOWNLOAD a SCREEN
    - LCD BACKLIGHT CONTROL
    - ENABLE/DISABLE RESPONSE
    - ADJUST BAUD RATE


    SAVE a SCREEN to EEPROM MEMORY

    Explanation:

    Save the current LCD display to a particular portion of the I2C eeprom memory. Within a single 24LC256 serial eeprom, which contains 32 Kbytes of memory, Thirty two screens can be saved. If all 4 eeproms are fitted to the PROTON SGLCD board, then a huge 1Mbit of memory is available (128 Kbytes) which is capable of holding 128 screens. As you’ve probably gathered, a screen consists of 1 Kbytes (1024 bytes). Because of the delay required for writing to eeproms, a screen save may take a few seconds. The PROTON SGLCD board’s serial interface will acknowledge when a save is complete.
    Command:
    Z
    Syntax:
    Z LOCATION in MEMORY (00 to 7F)
    Example:
    C
    THELLO WORLD
    Z10
    In the example above, the LCD is first cleared (command C), and text is displayed (command T). Once the text has appeared on the LCD, the SAVE SCREEN command is issued (Z) with the location to save the screen. While the screen is being saved to eeprom memory, the PROTON SGLCD will not respond to any further commands. After a few seconds, an acknowledge character “A” will be transmitted from the PROTON SGLCD to signal the screen has been saved

    LOAD a SCREEN from EEPROM MEMORY

    Explanation:
    Load a screen (saved earlier) from a particular portion of the I2C eeprom memory. Within a single 24LC256 serial eeprom, which contains 32 Kbytes of memory, Thirty two screens can be stored. If all 4 eeproms are fitted to the PROTON SGLCD board, then a huge 1Mbit of memory is available (128 Kbytes) which is capable of holding 128 screens. As you’ve probably gathered, a screen consists of 1 Kbytes (1024 bytes).

    Command:
    X
    Syntax:
    XLOCATION in MEMORY (00 to 7F)
    Example:
    C

    The example above should be used after the SAVE to SCREEN example has been carried out. In the example, the LCD is first cleared (command C), and the LOAD SCREEN command is issued (X) with the location to load the screen from. The previously saved screen will then be loaded on to the LCD.
    Example2:
    C
    X01
    The PROTON SGLCD’s eeprom is preloaded with several sample screens. Example2 will load the screen stored at location 01 and the display shown below should appear.



    UPLOAD a SCREEN

    Explanation:
    Most complex images displayed on the LCD are usually created using the PC, so a means of uploading the images to the LCD is required. That’s what the UPLOAD SCREEN command is for. It accepts a list of HEX data; where each HEX byte represents a byte on the LCD working from top left of the LCD to bottom right. Once the image is displayed on the LCD, the SAVE SCREEN command can store it in eeprom memory.
    Command:
    U
    Syntax:
    U
    Example:

    In order to demonstrate uploading an image to the LCD, a small executable program has been created that will load an image from the PC, and upload the image to the LCD via the serial port.

    The Program IMAGE_UPLOAD.EXE is found on the CDROM supplied with the SGLCD.

    Choose the com port that the PROTON SGLD is attached to



    In the screen shot shown (below), com port 1 was chosen. Leave the baud rate as it is for now, because it defaults to 9600, which is the default baud rate of the PROTON SGLCD. Once the com port is chosen, the UPLOAD button will be enabled.

    Click on FILE, and load one of the pictures located in the same folder as the executable. The screen shot below shows the picture DOG1.BMP.



    Ensure power is applied to the PROTON SGLCD, and that the splash screen has completed its journey to the bottom of the display, then press the UPLOAD button.

    An image will be produced on the PROTON SGLCD’s display, scanning from top left to bottom right. Once this has completed, close the IMAGE UPLOADER, and save the screen to eeprom memory using the SAVE SCREEN command. Remember where you placed it, as we’ll use this in the next command’s example.




    1Pricing excludes Sales (or other applicable) Taxes, depending on your region <a name="vat"></a>

  • Recent Activity

    Oldhack-15978

    PicKit3 Programmer

    Thread Starter: Dave-S

    Trying to setup a PicKit3 Programmer. Has gone through the install programmer and the Dos screen flashes up but does not stay there, and it does not...

    Oldhack Today, 12:43 Go to last post
    towlerg-21522

    Issue with MID$

    Thread Starter: Frizie

    Hi people! I have a small issue with the MID$ command. If I put a semi-colon in the source-string then I get the compiler error: Unbalanced...

    towlerg Today, 12:59 Go to last post
    charliecoultas-16125

    complie issue

    Thread Starter: chuckieboy

    Hi All It's been a long time since I've played with PDS. Back in 2013 I wrote a program all working correctly, I've recently was required to make an...

    charliecoultas Today, 11:11 Go to last post
    Dave-S-350

    UMC Loader

    Thread Starter: Dave-S

    Trying to use the MicroCode loader, but when I select either Loader or Loader Options from the "View" menu it just opens my Melabs Programmer. How...

    Dave-S Today, 08:20 Go to last post
    towlerg-21522

    16F627 - How do I enable pull-ups on PORTB?

    Thread Starter: davroski

    Hi, Data sheet says OPTION register bit 7 (RBPU) should be set to 0 but compiler 3.5.9.9 doesn't seem to recognise OPTION.7 = 0 or RBPU = 0 Thanks...

    towlerg Today, 01:02 Go to last post