【HackGameBuino】Replace Nokia5110 to 12864 Dot matrix LCD

Modules, cases, buttons...

【HackGameBuino】Replace Nokia5110 to 12864 Dot matrix LCD

Postby maxims » Sun Jan 31, 2016 7:46 am

First of all, my English is very poor, very sorry.
This paper is a machine translation, please slowly read and understand. thank you.

I am very tired of the 5110 display of the rough dot matrix display.
But I like GameBuino very much, so I'm going to have to replace the display.

After the study of the program, due to hardware restrictions, can only use the LCD 96*64 screen.
But I hand only 128*64, use only a part of the demonstration effect, but also good.
128*64 only use the 96*64, and the rest of the 32*64 is also used, the direct write screen, used to display the score, tips, and the like is very good.

New screen driver chip:[uc1701x],Datasheet:http://www.sohya.com.tw/page/STN_UC1701x.pdf

Modify:
libraries
1.Display.cpp
Code: Select all
    // toggle RST low to reset
    if (rst > 0) {
        digitalWrite(rst, LOW);
        delay(10);
        digitalWrite(rst, HIGH);
    }

    clkport = portOutputRegister(digitalPinToPort(sclk));
    clkpinmask = digitalPinToBitMask(sclk);
    mosiport = portOutputRegister(digitalPinToPort(din));
    mosipinmask = digitalPinToBitMask(din);
    csport = portOutputRegister(digitalPinToPort(cs));
    cspinmask = digitalPinToBitMask(cs);
    dcport = portOutputRegister(digitalPinToPort(dc));
    dcpinmask = digitalPinToBitMask(dc);

    // get into the EXTENDED mode!
    command(PCD8544_FUNCTIONSET | PCD8544_EXTENDEDINSTRUCTION);

    // LCD bias select (4 is optimal?)
    command(PCD8544_SETBIAS | 0x4);

    // set VOP
    if (contrast > 0x7f)
        contrast = 0x7f;

    command(PCD8544_SETVOP | contrast); // Experimentally determined


    // normal mode
    command(PCD8544_FUNCTIONSET);

    // Set display to Normal
    command(PCD8544_DISPLAYCONTROL | PCD8544_DISPLAYNORMAL);

    // initial display line
    // set page address
    // set column address
    // write display data

    update();

To modify the above section of code below this section
Code: Select all
    // toggle RST low to reset
    if (rst > 0)
    {
        digitalWrite(rst, LOW);
        delay(10);
        digitalWrite(rst, HIGH);
    }
    command(0xE2);  //System Reset//系统软复位
    command(0x40); // Set display start line to 0 //从0,0开始显示
    command(0xC8); //Set SEG Direction//行扫描顺序0xA1
    command(0xA0); //Set COM Direction//列扫描顺序0xC0
    command(0xA2); //Set Bias = 1/9//设置偏压比
    command(0x2C); //Boost ON//升压开
    command(0x2E); //Voltage Regular On//升压步骤一
    command(0x2F); //Voltage Follower On//升压步骤二
    command(0xF8); //Set booster ratio to
    command(0x00); //4x//设置通讯速度
    command(0x22); //Set Resistor Ratio = 3//0x23对比度初调
    command(0x81); //对比度细调
    command(0x32); //Set Electronic Volume = 40
    command(0xAC);//Set Static indicator off
    command(0x00);
    command(0XA6); // Disable inverse//正显A6负显A7
    command(0xAF); //Set Display Enable//打开显示
    delay(100);
    command(0xA5); //display all points//全屏初始化
    delay(200);
    command(0xA4); //normal display//恢复正常显示
    Allclear();
    update();

2.display.h Related parameters.
3.Gamebuino.h and Gamebuino.cpp
4.Demo Loader Related parameters.
5.Compile and upload.

Now show you my results.
Game Test
gametest.jpg
gametest.jpg (63.46 KiB) Viewed 5627 times

Loader Test
loader test.jpg
loader test.jpg (60.31 KiB) Viewed 5628 times

Old loader Test
Old loader test.jpg
Old loader test.jpg (29.14 KiB) Viewed 5627 times


Bugs:
1.RAM capacity is too small, the system firmware library occupies a considerable number of RAM, so, currently only able to do DEMO. :(
2.The entire GameBuino programming idea that everyone feels there is a defect, hope to improve. :lol:
Last edited by maxims on Sun Jan 31, 2016 8:02 am, edited 1 time in total.
maxims
 
Posts: 5
Joined: Sun Jan 31, 2016 7:17 am

Re: 【HackGameBuino】Replace Nokia5110 to 12864 Dot matrix LCD

Postby maxims » Sun Jan 31, 2016 7:52 am

This is the library file and Loader modified files.
Programming level is limited, please a lot of.
Loader.rar
(7.82 KiB) Downloaded 433 times

Gamebuino.rar
(29.62 KiB) Downloaded 428 times
maxims
 
Posts: 5
Joined: Sun Jan 31, 2016 7:17 am

Re: 【HackGameBuino】Replace Nokia5110 to 12864 Dot matrix LCD

Postby rchpweblo » Thu Mar 17, 2016 5:54 am

Hello Maxims!

You said that the maximum resolution the Gamebuino could handle was 96*64, but you only had a 128*64 display. I'm assuming that that means that your code is ment to work with a 128*64 display.

What would I need to modify in your code for the Gamebuino to work with the resolution of 96*64?

And is there a particular screen or screen driver that you think would work most efficiently for using a 96*64 screen on the Gamebuino?

Thanks,
Rchpweblo.

P.S. Out of curiosity, what is your original language?
rchpweblo
 
Posts: 4
Joined: Thu Dec 18, 2014 4:55 am
Location: San Diego CA

Re: 【HackGameBuino】Replace Nokia5110 to 12864 Dot matrix LCD

Postby maxims » Sun Mar 27, 2016 6:55 am

My original language is chinese.

My hand on the screen is 128*64, but I only had a region of 96*64.

Because the Loader core inside the display buffer can only set up to 768 bytes, and 128*64 needs 1024 bytes, this function display game icon also need 128 bytes, will lead to more than LOADER core system memory.

According to my experience, the Arduino library file should be compiled from the new AVR GCC, in order to improve the efficiency of the implementation and memory efficiency.

On the screen, please refer to:
https://item.taobao.com/item.htm?spm=a1 ... 12riic4725

Driver chip: ST7585, SPI interface, resolution 96*64, comes with batteries, antenna and other icon display.

Need to build a new display driver library.

On the part of the game, with the new display driver and the original library files compiled once can be perfectly compatible with 96*64. The game itself does not need to modify the code.
maxims
 
Posts: 5
Joined: Sun Jan 31, 2016 7:17 am

Re: 【HackGameBuino】Replace Nokia5110 to 12864 Dot matrix LCD

Postby maxims » Sun Mar 27, 2016 10:33 am

有说中文的么?
maxims
 
Posts: 5
Joined: Sun Jan 31, 2016 7:17 am

Re: 【HackGameBuino】Replace Nokia5110 to 12864 Dot matrix LCD

Postby mougino » Sun Mar 27, 2016 11:19 am

User avatar
mougino
 
Posts: 75
Joined: Sat Jul 25, 2015 8:15 am
Location: Paris, France


Return to Hardware Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron