View previous topic :: View next topic |
Author |
Message |
mfulde
Joined: 24 Apr 2007 Posts: 21 Location: Lonsee, Germany
|
Posted: Wed Jun 03, 2020 7:30 pm Post subject: Graphik-LCD 240x128 with T6963 compatible RA6963 Controller |
|
|
Hello all,
currently I'm working with a Graphic Display (to be precise, with 2 of them with a resolution 240x128 pixel and a T6963 compatible Controller. One Display is the ERM240128-2 and the other is a TGL47B-240128, both from noname suppliers.
I'm using BASCOM Version 2.0.8.2 with compiler build 2.0.8.2.003
What I see is, that BASCOM is supporting this display most likely completely. But ....
I connected my display exact on the same way like in the BASCOM HELP tutorial.
- Dataport on PORTA
- Controlport on PORTC
- PIN's connected like in the tutorial
My AVR is an ATmega2560.
Nearly everything is working very well.
Text in characters -> working
Graphic with pixels and lines etc -> working
Mixed Mode with Text in Graphic -> working
Special Commands like OR-Mode for Invert Display -> working
BUT ....Showpic for displaying a picture is not working. Neither standard pictures from the examples nor self generated BMP pictures are working. It is independednt whether I store the BGF in compressed or uncompressed version.
Pictures, working on my 64 pixel DOG-M display, are also not working.
It seems that there is a problem with the memory adresses of the Graphic Memory.
Everything I got on the display is completely rubish ....
I tried a couple of things out. For example reducing the clock for 14,7456 MHz to 8. I tried also an ATmega16 with 1 MHz and 4 MHz but got the same result. CPU speed seems to have no impact.
My question now is .... doesn somebody of you know the problem and is there a easy solution to get BGF running?
I mean, there could be a possibility to transfer the data manually to the display but honestly, I don't want to define 3840 bytes and transfer them manually to the memory.....
I would be very happy if you can give me a hint how to solve the problem or what I can check to understand the problem.
Thanks for your help!
Take care ans stay helthy,
Markus
(BASCOM-AVR version : 2.0.8.2 ) _________________ MaFu |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Thu Jun 04, 2020 9:59 am Post subject: |
|
|
Hello
If draw as line and text is working you can say your display is right
Without sample of code it is difficult to understand.
I forgot this king of display since years but I remember some pb about the program
you need to put the bgf file at the end of your program after the end line
Nextion display is so great for me now !
this code is 12 years old
JP
Code: |
'--------------------zodiac-------------------------------------------
Zodiaques:
If Doy >= 21 And Doy < 51 Then
Zodiac = 10 'Verseau
Elseif Doy >= 51 And Doy < 79 Then
Zodiac = 11 'poissons
Elseif Doy >= 79 And Doy < 112 Then
Zodiac = 0 'belier
Elseif Doy >= 112 And Doy < 142 Then
Zodiac = 1 'taureau
Elseif Doy >= 141 And Doy < 173 Then
Zodiac = 2 'Gémeaux
Elseif Doy >= 173 And Doy < 204 Then
Zodiac = 3 'Cancer
Elseif Doy >= 204 And Doy < 235 Then
Zodiac = 4 'Lion
Elseif Doy >= 235 And Doy < 266 Then
Zodiac = 5 'Vierge
Elseif Doy >= 266 And Doy < 296 Then
Zodiac = 6 'Balance
Elseif Doy >= 296 And Doy < 327 Then
Zodiac = 7 'scorpion
Elseif Doy >= 327 And Doy < 356 Then
Zodiac = 8 'sagittaire
Elseif Doy >= 356 Or Doy < 21 Then
Zodiac = 9 'capricorne
End If
Stringzodiac = Lookupstr(zodiac , Datazodiac)
Locate 12 , 1 : Lcd Stringzodiac
Select Case Zodiac
Case 0
Showpic 8 , 56 , Belier
Case 1
Showpic 8 , 56 , Taureau
Case 2
Showpic 8 , 56 , Gemeaux
Case 3
Showpic 8 , 56 , Cancer
Case 4
Showpic 8 , 56 , Lion
Case 5
Showpic 8 , 56 , Vierge
Case 6
Showpic 8 , 56 , Balance
Case 7
Showpic 8 , 56 , Scorpion
Case 8
Showpic 8 , 56 , Sagittaire
Case 9
Showpic 8 , 56 , Capricorne
Case 10
Showpic 8 , 56 , Verseau
Case 11
Showpic 8 , 56 , Poissons
End Select
Gosub Goldennumber
Locate 15 , 27 : Lcd "Nombre d'or:" ; Goldnumber
Gosub Epactnumber
Locate 16 , 27 : Lcd "Epacte:" ; Epacte
Return
Belier:
$bgf "belier.bgf"
Taureau:
$bgf "taureau.bgf"
Gemeaux:
$bgf "gemeaux.bgf"
Cancer:
$bgf "cancer.bgf"
Lion:
$bgf "lion.bgf"
Vierge:
$bgf "vierge.bgf"
Balance:
$bgf "balance.bgf"
Scorpion:
$bgf "scorpion.bgf"
Sagittaire:
$bgf "sagittaire.bgf"
Capricorne:
$bgf "capricorne.bgf"
Verseau:
$bgf "verseau.bgf"
Poissons:
$bgf "poissons.bgf"
Soleil:
$bgf "soleil.bgf"
Datadays:
Data " " , "LUNDI" , "MARDI" , "MERCREDI" , "JEUDI" , "VENDREDI" , "SAMEDI" , "DIMANCHE" 'one adds " " to start with idx=1
Datamonth:
Data " " , "JANVIER" , "FEVRIER" , "MARS" , "AVRIL" , "MAI" , "JUIN" , "JUILLET" , "AOUT" , "SEPTEMBRE" , "OCTOBRE" , "NOVEMBRE" , "DECEMBRE"
Daymonth:
Data 0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31
Datazodiac:
Data "BELIER" , "TAUREAU" , "GEMEAUX" , "CANCER" , "LION" , "VIERGE" , "BALANCE" , "SCORPION" , "SAGITTAIRE" , "CAPRICORNE" , "VERSEAU" , "POISSONS"
Dataepacte:
Data " " , "I" , "II" , "III" , "IV" , "V" , "VI" , "VII" , "VIII" , "IX" , "X" , "XI" , "XII" , "XIII" , "XIV" , "XV" , "XVI" , "XVII" , "XVIII" , "XIX"
|
_________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
mfulde
Joined: 24 Apr 2007 Posts: 21 Location: Lonsee, Germany
|
Posted: Thu Jun 04, 2020 11:47 am Post subject: |
|
|
Hello JP,
thanks for the answer.
You are completely right, without sample of code it is difficult to understand.
The code I use bringing the display into oparation is exactely the code from BASCOM HELP for CONFIG GRAPHLCD
Code: | '-----------------------------------------------------------------------------------------
'name : t6963_240_128.bas
'copyright : (c) 1995-2016, MCS Electronics
'purpose : T6963C graphic display support demo 240 * 128
'micro : Mega8535
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
$regfile = "m8535.dat" ' specify the used micro
$crystal = 8000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
'-----------------------------------------------------------------
' (c) 2001-2016 MCS Electronics
' T6963C graphic display support demo 240 * 128
'-----------------------------------------------------------------
'The connections of the LCD used in this demo
'LCD pin connected to
' 1 GND GND
'2 GND GND
'3 +5V +5V
'4 -9V -9V potmeter
'5 /WR PORTC.0
'6 /RD PORTC.1
'7 /CE PORTC.2
'8 C/D PORTC.3
'9 NC not conneted
'10 RESET PORTC.4
'11-18 D0-D7 PA
'19 FS PORTC.5
'20 NC not connected
'First we define that we use a graphic LCD
' Only 240*64 supported yet
Config Graphlcd = 240 * 128 , Dataport = Porta , Controlport = Portc , Ce = 2 , Cd = 3 , Wr = 0 , Rd = 1 , Reset = 4 , Fs = 5 , Mode = 8
'The dataport is the portname that is connected to the data lines of the LCD
'The controlport is the portname which pins are used to control the lcd
'CE, CD etc. are the pin number of the CONTROLPORT.
' For example CE =2 because it is connected to PORTC.2
'mode 8 gives 240 / 8 = 30 columns , mode=6 gives 240 / 6 = 40 columns
'Dim variables (y not used)
Dim X As Byte , Y As Byte
'Clear the screen will both clear text and graph display
Cls
'Other options are :
' CLS TEXT to clear only the text display
' CLS GRAPH to clear only the graphical part
Cursor Off
Wait 1
'locate works like the normal LCD locate statement
' LOCATE LINE,COLUMN LINE can be 1-8 and column 0-30
Locate 1 , 1
'Show some text
Lcd "MCS Electronics"
'And some othe text on line 2
Locate 2 , 1 : Lcd "T6963c support"
Locate 3 , 1 : Lcd "1234567890123456789012345678901234567890"
Locate 16 , 1 : Lcd "write this to the lower line"
Wait 2
Cls Text
'use the new LINE statement to create a box
'LINE(X0,Y0) - (X1,Y1), on/off
Line(0 , 0) -(239 , 127) , 255 ' diagonal line
Line(0 , 127) -(239 , 0) , 255 ' diagonal line
Line(0 , 0) -(240 , 0) , 255 ' horizontal upper line
Line(0 , 127) -(239 , 127) , 255 'horizontal lower line
Line(0 , 0) -(0 , 127) , 255 ' vertical left line
Line(239 , 0) -(239 , 127) , 255 ' vertical right line
Wait 2
' draw a line using PSET X,Y, ON/OFF
' PSET on.off param is 0 to clear a pixel and any other value to turn it on
For X = 0 To 140
Pset X , 20 , 255 ' set the pixel
Next
For X = 0 To 140
Pset X , 127 , 255 ' set the pixel
Next
Wait 2
'circle time
'circle(X,Y), radius, color
'X,y is the middle of the circle,color must be 255 to show a pixel and 0 to clear a pixel
For X = 1 To 10
Circle(20 , 20) , X , 255 ' show circle
Wait 1
Circle(20 , 20) , X , 0 'remove circle
Wait 1
Next
Wait 2
For X = 1 To 10
Circle(20 , 20) , X , 255 ' show circle
Waitms 200
Next
Wait 2
'Now it is time to show a picture
'SHOWPIC X,Y,label
'The label points to a label that holds the image data
Test:
Showpic 0 , 0 , Plaatje
Showpic 0 , 64 , Plaatje ' show 2 since we have a big display
Wait 2
Cls Text ' clear the text
End
'This label holds the mage data
Plaatje:
'$BGF will put the bitmap into the program at this location
$bgf "mcs.bgf"
'You could insert other picture data here
|
The display screen is also showing allways the same shit, depending to the used BGF file. It is NO random content. This is also the reason why I'm thinking, that the display working correctly, HW issue can be excluded and it might be a memory issue how the SW is transfering bytes to the display. Maybe adressing is not correct and maybe pointer increment is not working etc....
Regards,
Markus _________________ MaFu |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Thu Jun 04, 2020 11:53 am Post subject: |
|
|
@mfulde I cant confirm that problem. Everything works perfectly fine.
Years ago I made strip cables for quick attach and connect this display into some dev. boards so today it was a minute.
..and look what I compile today with Bascom 2082 An animation on this display based on the BGF (I export some frames from animated GIF and convert them)
At the end of animation the text in polish language means "You have mess on your desk"
(live looks better, camera cant show it)
LINK TO SHORT 20sec VIDEO
If you want I can try display your BGF if you attach it or compile some HEX but for this config will be prefferable.
Code: | Config Graphlcd = 240x128 , Dataport = Porta , Controlport = Portc , Ce = 4 , Cd = 7 , Wr = 5 , Rd = 6 , Reset = 3 , Fs = 2 , Mode = 8
'mode 8 gives 240 / 8 = 30 columns , mode=6 gives 240 / 6 = 40 columns
Cursor Off
Cls |
Last edited by EDC on Thu Jun 04, 2020 12:04 pm; edited 1 time in total |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Thu Jun 04, 2020 12:02 pm Post subject: |
|
|
when you create the bgf you can select the font. 6x8 or 8x8
this should match the setting of the config _________________ Mark |
|
Back to top |
|
|
mfulde
Joined: 24 Apr 2007 Posts: 21 Location: Lonsee, Germany
|
Posted: Thu Jun 04, 2020 7:08 pm Post subject: |
|
|
Hei Mark,
THAT's IT
Completely my fault ..... yes ... the problem was sitting in front of the Keyboard !
What ever I tried out in the last days, I did / had a not matching configuration ... mode 6 and mode 8, 6x8 and 8x8 ....
NOW, Mode is 6 and BMP was regenerated with 6x8 and .... wonder by wonder ....
ITs WORKING FINE!
Thanks for your help and the relevant hint.
Regards,
Markus _________________ MaFu |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5921 Location: Holland
|
Posted: Fri Jun 05, 2020 9:45 am Post subject: |
|
|
ok, glad it is solved. i added this info to the help since it was missing. _________________ Mark |
|
Back to top |
|
|
|
|
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
|
|