Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

EA DOGM204 nice 20x4 ultraslim display

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1136

poland.gif
PostPosted: Mon Nov 04, 2019 4:55 pm    Post subject: EA DOGM204 nice 20x4 ultraslim display Reply with quote

Hello. I got such a display Very Happy
It is :
* extremely compact at 66 x 40 mm at the standard font size of 4.8 mm (4 x 10)
* ultra-flat at 2.0 mm without backlight or 5.8 mm including LED backlight
* 4-bit, 8-bit, SPI interface (2-/3-/4-wire) and I²C (2-wire)
* typical power consumption of only 250µA in full operation (LED white backlight as of 3mA)
* easy installation by simply soldering into the board
* A whole range of design variants can be supplied as of single units
* Changing background color

Unfortunatelly I dont have backlight yet so first Im using flashlight and then some Rainbowled`s Very Happy
Backlight will arrive soon I think.

I have modified "4_anypin.lib" with some needed initialisation, and then anyone can use Bascom`s dedicated functions like Lcd and Locate.

Remember to choose 20x4A because adressess for rows are &H00, &H20, &H40 and $H60

Library and datasheet attached.
Tested on the 3V3 circuit. Not tested with Xmega but oryginally "4_anypin.lib" support Xmega so it should work.



Code:
$regfile = "m1284def.dat"
$crystal = 16000000
$hwstack = 64
$swstack = 16
$framesize = 64
Config Submode = New

$lib "EADOGM204_4_anypin.lib"                               'four bits

Config Lcdpin = Pin , Rs = Porta.0 , E = Porta.1 , Db4 = Porta.4 , Db5 = Porta.5 , Db6 = Porta.6 , Db7 = Porta.7
Config Lcd = 20x4a                                          ' <<< A is important!

Lcdreset Alias Porta.2 : Set Lcdreset : Config Lcdreset = Output       'set HI

Macro Resetlcd
 Lcdreset = 0
 Waitms 10
 Lcdreset = 1
 Waitms 1
End Macro

Resetlcd : Initlcd : Cls

Locate 1 , 1 : Lcd "Hello World"
Locate 2 , 1 : Lcd " EADOGM204A"
Locate 3 , 1 : Lcd " BASCOM"
Locate 4 , 1 : Lcd "EDC"

End
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6200
Location: Holland

blank.gif
PostPosted: Tue Nov 05, 2019 9:32 pm    Post subject: Reply with quote

Hi EDC

Thanks for sharing. Indeed a nice LCD.
I see you use side lighting Smile

I used similar lcd. contrast is great.

thanks for taking the time to share!

_________________
Mark
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1136

poland.gif
PostPosted: Tue Mar 22, 2022 8:54 pm    Post subject: Reply with quote

Hello. A small update.
This LCD`s are great. They have three internal ROM`s of your choice (ROMA, ROMB & ROMC).
By default ROMC is enabled but "non english-japanese" ROM have some cool icons Very Happy so you don`t need to define it.
Maybe you need more cyrillic characters? no problem!
I wrote a sub that allow you to select rest of ROM`s.

Yes, contrast is great. It is temperature compensated from -20 to +70 Rolling Eyes




Code:
Sub Select_rom(byval Rom_name As String * 1)
 R24 = &H2A                                                 'RE=1(b0) REV=0(b1) ->extended registers can be accessed
 ! call _lcd_control
 R24 = &H72                                                 ' "select ROM" command
 ! call _lcd_control
  Select Case Rom_name
   Case "A" : R24 = &H00                                    'ROMA
   Case "B" : R24 = &H04                                    'ROMB
   Case "C" : R24 = &H0C                                    'ROMC
   Case Else
    R24 = &H0C
  End Select
 ! call _Write_lcd                                          'RS Hi ->DataMode
 R24 = &H28
 ! call _lcd_control                                        'RS Lo ->CommandMode
End Sub

Select_rom "A"




Some copyrights signs are hidden Very Happy C is Chr(14) and R is Chr(15)

Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum