View previous topic :: View next topic |
Author |
Message |
sielcon
Joined: 16 Mar 2006 Posts: 68 Location: Argentina

|
Posted: Mon Sep 30, 2019 4:35 am Post subject: |
|
|
I'm going to try it, thanks |
|
Back to top |
|
 |
sielcon
Joined: 16 Mar 2006 Posts: 68 Location: Argentina

|
Posted: Mon Sep 30, 2019 4:46 am Post subject: |
|
|
Change the screen and it works perfect.
 |
|
Back to top |
|
 |
rizzo
Joined: 30 Oct 2014 Posts: 7
|
Posted: Fri Apr 24, 2020 10:28 pm Post subject: |
|
|
Hello is it posible with this lib... use pset command.
I also need box write how make this?
Thanks. |
|
Back to top |
|
 |
sielcon
Joined: 16 Mar 2006 Posts: 68 Location: Argentina

|
Posted: Mon Apr 27, 2020 3:16 pm Post subject: |
|
|
Hello, the truth is that I did not try it, but according to what I saw in the examples, only SETFON, SHOWPIC and LCDAT work, and they were the instructions I used.
Best regards. |
|
Back to top |
|
 |
ampervadasz78
Joined: 14 Jul 2016 Posts: 3

|
Posted: Mon Nov 30, 2020 11:49 am Post subject: Nokia 5110 problem |
|
|
Hy!
My little speak engish.
Nokia 5110 wiring problem.
Connetcted Nokia 5110 display <-> 8-channel Bi-directional Logic Level Converter - TXB0108 <-> Atmega 128
Pinout:
Display VCC connect +3,3V
Display GND connect 0V
Display SCE connect logic level converter (A1), (B1) connect Atmega 128 Port D.1
Display RST connect logic level converter (A2), (B2) connect Atmega 128 Port D.0
Display D/C connect logic level converter (A3), (B3) connect Atmega 128 Port D.2
Display DN<MOSI> connect logic level converter (A4), (B4) connect Atmega 128 PortD.3
Display SCLK connect logic level converter (A5), (B5) connect Atmega 128 PortD.4
Display LED -> 100ohm -> +3,3V
Load program Atmega128, not pixel, character, picture display
Display tipe:
https://learn.sparkfun.com/tutorials/graphic-lcd-hookup-guide?_ga=2.209351890.1371307869.1606689616-764629793.1606689616
What I ruined?
Program:
Code: | '-------------------------------------------------------------------------------
' Nokia-3310 LCD Test
' BASCOM-AVR
' Mrshilov 2014
'===============================================================================
$regfile = "m128def.dat"
$crystal = 8000000
$hwstack = 32
$swstack = 16
$framesize = 24
'*******************************************************************************
$lib "glcd-Nokia3310_V2.lib"
Config Graphlcd = 128x64sed , Rst = Portd.0 , Cs1 = Portd.1 , A0 = Portd.2 , Si = Portd.3 , Sclk = Portd.4
' Rst & Cs1 is optional
Dim Contrast_lcd As Byte : Contrast_lcd = 60 'Contrast 0 to 127, if not defined - 72
'Const Negative_lcd = 1 'Inverting screen
'Const Rotate_lcd = 1 'Rotate screen to 180°
Dim I As Byte , N As Word
Dim Text As String * 8
Upkey Alias Pind.0
Downkey Alias Pind.1
Config Upkey = Input
Config Downkey = Input
'***************************** Program *****************************************
Initlcd
Cls
Setfont Font6x8
Lcdat 2 , 16 , "NOKIA-3310"
Lcdat 4 , 30 , "84x48"
Wait 2
Cls
Showpic 0 , 0 , Walker
Wait 2
Cls
Setfont Font6x8
Lcdat 3 , 1 , "--------------"
Lcdat 4 , 22 , "1 March"
Lcdat 5 , 1 , " Saturday " , 1
Lcdat 6 , 31 , "2014"
Setfont Font12x16dig
I = 20
Do
Initlcd
Incr I
If I > 59 Then I = 20
Text = Str(i)
Lcdat 1 , 1 , "23:" ; Text
Waitms 500
Lcdat 1 , 1 , "23 " ; Text
If I.0 = 1 Then Showpic 66 , 1 , Ring Else Lcdat 1 , 66 , " "
Waitms 500
'----------------------------------------------- Contrast regulation
If Upkey = 0 Or Upkey = 0 Then
If Upkey = 0 Then Incr Contrast_lcd
If Downkey = 0 Then Decr Contrast_lcd
Lcdcontrast Contrast_lcd
End If
'-----------------------------------------------
Loop
End
'===============================================================================
Ring:
$bgf "Ring.bgf"
Walker:
$bgf "Walker.bgf"
$include "font6x8.font"
$include "font12x16dig.font" | [/code] |
|
Back to top |
|
 |
O-Family
Joined: 23 May 2010 Posts: 319 Location: Japan

|
Posted: Tue Dec 01, 2020 2:09 pm Post subject: |
|
|
The same port is used for LCD and KEY. |
|
Back to top |
|
 |
sielcon
Joined: 16 Mar 2006 Posts: 68 Location: Argentina

|
Posted: Tue Nov 14, 2023 3:11 am Post subject: Problems with Lib glcd-Nokia3310.lib |
|
|
Hello everyone, I have a problem with the library that I do not understand, I attach the code and photo of the result. On each line it prints the first character and then continues with the ASCII characters that follow in the list instead of the string sent. If this has happened to anyone, I would appreciate your help. The compiler version is :2.0.8.6
Thank you very much.
Code: |
$regfile = "m2560def.dat"
$crystal = 16000000
$hwstack = 128
$swstack = 128
$framesize = 128
$lib "glcd-Nokia3310_V2.lib"
Config Graphlcd = 128x64sed , Rst = Portl.0 , A0 = Portl.1 , Si = Portb.2 , Sclk = Portb.1
Const Negative_lcd = 0 'Inverting screen
Const Rotate_lcd = 0 'Rotate screen to 180°
Initlcd
Waitms 100
Cls
Setfont Font6x8
Lcdat 2 , 1 , "Nokia"
Lcdat 4 , 1 , "84x48"
End
$include "Font6x8.font"
|
|
|
Back to top |
|
 |
O-Family
Joined: 23 May 2010 Posts: 319 Location: Japan

|
Posted: Wed Nov 15, 2023 1:28 am Post subject: |
|
|
This problem occurs when the AVR chip is ATmega2560.
I think the compiler is probably causing an error when the flash exceeds 64K.
Please contact MCS support with your issue. |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 5838 Location: Holland

|
Posted: Thu Nov 16, 2023 8:18 pm Post subject: |
|
|
please notice that this is a third party lib. this means that it is not supported by MCS.
The reason is simple : for all supported hardware we have this hardware with documentation, connections, etc.
But for third party libs we do not have the hardware to check possible problems.
In this case i also wonder : which version is it?
when we discover a bug or handle things different we check and modify all libs but only the MCS supported ones.
I noticed you use a PORTL. this is an extended port.
it means cbi/sbi will need a temp register which is r23.
MCS rewrote some libs to use r11 instead of r23 but another option is to protect r23.
in the nokia lib i found this is done in _gwrite_datamisc with push r23 and when the code ends a pop r23
but that is not the proper entry point since now _gwride_cmd and _gwrite_data are not guarded.
so remark/remove the push r23 in _gwrite_datamisc and put it in both _gwrite_cmd and _gwrite_data
both labels end in _gwrite_datamisc so that is not a problem and the pop that exists there you need to keep.
i imagine this solves the problem. _________________ Mark |
|
Back to top |
|
 |
O-Family
Joined: 23 May 2010 Posts: 319 Location: Japan

|
Posted: Fri Nov 17, 2023 1:49 am Post subject: |
|
|
Mark, thank you for your quick advice.
The issue has been fixed.
I have faced R23 problems several times in the past, but since the problems occur in various patterns, I was late to notice them.
Since this issue is derived from the original library, we will need to continue to fix libraries with the same symptoms.
Please give me some advice at that time. |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 5838 Location: Holland

|
Posted: Fri Nov 17, 2023 1:35 pm Post subject: |
|
|
original libs are fixed by using R11 for R23.
in this lib you can also do this. R11 is not used with immediate code like LDI so you can simply replace them.
this eliminated the push/pop for r23
then some other remarks.
when the lib is included using $lib and the lib is not compiled/used as LBX you can change : *# into #
I mean for #IF #ENDIF
then LD/ST that use Y or Z with offset like : st y+1 should be written as STD y+1
and LDD for LD
not really important since the compiler and assembler will use proper code. but it is more clear. example you can find in all MCS libs.
thanks for your work and support on the various LCD libs. _________________ Mark |
|
Back to top |
|
 |
sielcon
Joined: 16 Mar 2006 Posts: 68 Location: Argentina

|
Posted: Mon Nov 27, 2023 3:07 pm Post subject: |
|
|
Thank you all very much, it works perfectly.
Kind regards |
|
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
|
|