Jump to content
  • 0

Display non-ascii caracters on LCD


SamuelCroteau

Question

Hi,  I have a basys mx3 with a pic32MX370

I want to know how to write non-ascii caracters on the LCD. I want to make a Tetris game, but the LCD screen is only 2x16, so how to write very little caracters on the LCD, like one dot at the time. I guess I need to write at the accurate adress on the LCD, but how ? It could be done in assembly or C, I don't mind. I want to do something like the picture:

Thank you.

tetris_lcd.jpg

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Hello @SamuelCroteau,

Did you checked the chapter https://reference.digilentinc.com/learn/courses/unit-3/start#appendix_clcd_custom_characters  for creating custom characters? you can use it to create the Tetris blocks.

You can found the source code for the Unit 3 course at the bottom of the page https://reference.digilentinc.com/reference/microprocessor/basys-mx3/start

 

Also you can find some info here: https://www.makerguides.com/character-lcd-arduino-tutorial/

You also have some libraries here which I found them useful:

https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library

 

Link to comment
Share on other sites

Hi thank you, but Im not sure to have all the details with their instructions:

 

Listing C.1. Steps to Program Graphical Characters

Reset RS and R/W pins of the LCD to prepare the LCD to accept instructions.

Set the CG RAM address by sending an instruction byte from 64 to 127 (locations 0-63 in CGRAM).

Switch to DATA MODE by changing the RS pin to one.

Send bytes with the bit patterns for your symbol(s). The LCD controller automatically increments CGRAM addresses, just as it does cursor positions on the display.

To leave CGRAM, switch to COMMAND MODE to set the address counter to a valid display address (e.g., 128, 1st character of 1st line); the clear-screen instruction (byte 1); or the home instruction (byte 2). Now bytes are once again being written to the visible portion of the display.

To see the custom character(s) you have defined, print ASCII codes 0 through 7.

 

Do you have a code for that?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...