Hello,
I want to build a DIY RC transmitter.
I have the joysticks, a lot of switches, pushbuttons and a 128x64 pixel LCD with a ST7920 controller inside.
At this moment I have nothing connected to the MEGA2560 except the display.
So I decided to try to change the ST7565 driver in the opentx/radio/src/targets/mega2560 folder to drive the ST7920 display.
the Init is ok and all of the data from the "displayBuf" variable gets transmitted and displayed on the LCD.
But all I can see on the dislay isn't readable.
Can anyone confirm, that my picture is okay for the opentx software?
I had never before a Transmitter with opentx, so I have no experience with that.
I wrote the Data of "displayBuf" in the first row and began with the second row with the next byte from "displayBuf"
row1 = byte0...15
row2= byte 16...31
...
If I get the driver working on my display I will share it here or in the Git Repository for everyone!
Please look over this informations and give me a little hint what is wrong here.
Thank you very much!
best regards
implement LCD12864 with ST7920 for MEGA2560 for opentx
implement LCD12864 with ST7920 for MEGA2560 for opentx
Last edited by Olli on Mon Apr 13, 2015 2:05 pm, edited 1 time in total.
- MikeB
- 9x Developer
- Posts: 17990
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: implement LCD12864 with ST7920 for MEGA2560 for opentx
The two chips address and display the graphic data differently. The ST7565 uses bytes vertically, while the ST7920 uses 16 bit words horizontally.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: implement LCD12864 with ST7920 for MEGA2560 for opentx
Hello,
thank you very much MikeB for the hint!
Now I found this site:
http://edeca.net/wp/electronics/the-st7 ... ontroller/
The is a explanation of the adresses of the ST7565 Controller.
With this I was able to write a data converter from the "displayBuf" content to the ST7920 Controller of my LCD.
I wrote the driver in the "lcd_driver_ST7565R.cpp" file, so I hadn't nothing to do with the makefile.
Maybe is is possible to add this file with a correct file name to the GIT repository and make it chooseable in tme makefile.
Now I will go on to build my own RC Transmitter.
Thanks for the good software and documentation!
Best regards
Olli
thank you very much MikeB for the hint!
Now I found this site:
http://edeca.net/wp/electronics/the-st7 ... ontroller/
The is a explanation of the adresses of the ST7565 Controller.
With this I was able to write a data converter from the "displayBuf" content to the ST7920 Controller of my LCD.
I wrote the driver in the "lcd_driver_ST7565R.cpp" file, so I hadn't nothing to do with the makefile.
Maybe is is possible to add this file with a correct file name to the GIT repository and make it chooseable in tme makefile.
Now I will go on to build my own RC Transmitter.
Thanks for the good software and documentation!
Best regards
Olli
- Attachments
-
- lcd_driver_ST7920.cpp
- (4.74 KiB) Downloaded 669 times
Re: implement LCD12864 with ST7920 for MEGA2560 for opentx
Awesome Olli!
I am stuck with 7290 based display that I purchased from Amazon without knowing what it is. Had a hard time debugging various problems, lot of soldering/desoldering and still no luck. The display would just stay blank.
Then started looking at lcd_driver and realized that the init code was doing something that didn't match with the datasheet and your code here seemed to make more sense. So, I tried it and it works!
I'd totally recommend getting this code merged and checked in with existing driver code.
Thanks!
I am stuck with 7290 based display that I purchased from Amazon without knowing what it is. Had a hard time debugging various problems, lot of soldering/desoldering and still no luck. The display would just stay blank.
Then started looking at lcd_driver and realized that the init code was doing something that didn't match with the datasheet and your code here seemed to make more sense. So, I tried it and it works!
I'd totally recommend getting this code merged and checked in with existing driver code.
Thanks!
Re: implement LCD12864 with ST7920 for MEGA2560 for opentx
Awesome Olli!
I am stuck with 7290 based display that I purchased from Amazon without knowing what it is. Had a hard time debugging various problems, lot of soldering/desoldering and still no luck. The display would just stay blank.
Then started looking at lcd_driver and realized that the init code was doing something that didn't match with the datasheet and your code here seemed to make more sense. So, I tried it and it works!
I'd totally recommend getting this code merged and checked in with existing driver code.
Thanks!
I am stuck with 7290 based display that I purchased from Amazon without knowing what it is. Had a hard time debugging various problems, lot of soldering/desoldering and still no luck. The display would just stay blank.
Then started looking at lcd_driver and realized that the init code was doing something that didn't match with the datasheet and your code here seemed to make more sense. So, I tried it and it works!
I'd totally recommend getting this code merged and checked in with existing driver code.
Thanks!
Re: implement LCD12864 with ST7920 for MEGA2560 for opentx
Hello,
I forgot to post the necessary changes in "board_mega2560.h"
In the section "LCD driver" the following pins have to be declared:
This pins are ususal IO pins without any special function. So they can be changed.
The names are the same on the pcb of the ST7920 LCD.
Best regards
Olli
I forgot to post the necessary changes in "board_mega2560.h"
In the section "LCD driver" the following pins have to be declared:
Code: Select all
// LCD driver
#define PORTA_LCD_DAT PORTA
#define PORTC_LCD_CTRL PORTC
#define OUT_C_LCD_E 7
#define OUT_C_LCD_RnW 6
#define OUT_C_LCD_RS 5
#define OUT_C_LCD_RES 4
#define OUT_C_LIGHT 2
The names are the same on the pcb of the ST7920 LCD.
Best regards
Olli