Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

NOKIA-3310/5110 LCD library
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8
 
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
sielcon

Bascom Member



Joined: 16 Mar 2006
Posts: 74
Location: Argentina

argentina.gif
PostPosted: Mon Sep 30, 2019 4:35 am    Post subject: Reply with quote

I'm going to try it, thanks
Back to top
View user's profile Visit poster's website
sielcon

Bascom Member



Joined: 16 Mar 2006
Posts: 74
Location: Argentina

argentina.gif
PostPosted: Mon Sep 30, 2019 4:46 am    Post subject: Reply with quote

Change the screen and it works perfect.
Smile
Back to top
View user's profile Visit poster's website
rizzo

Bascom Member



Joined: 30 Oct 2014
Posts: 7

PostPosted: Fri Apr 24, 2020 10:28 pm    Post subject: Reply with quote

Hello is it posible with this lib... use pset command.

I also need box write how make this?

Thanks.
Back to top
View user's profile
sielcon

Bascom Member



Joined: 16 Mar 2006
Posts: 74
Location: Argentina

argentina.gif
PostPosted: Mon Apr 27, 2020 3:16 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
ampervadasz78

Bascom Member



Joined: 14 Jul 2016
Posts: 3

hungary.gif
PostPosted: Mon Nov 30, 2020 11:49 am    Post subject: Nokia 5110 problem Reply with quote

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
View user's profile AIM Address
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 320
Location: Japan

japan.gif
PostPosted: Tue Dec 01, 2020 2:09 pm    Post subject: Reply with quote

The same port is used for LCD and KEY.
Back to top
View user's profile Visit poster's website
sielcon

Bascom Member



Joined: 16 Mar 2006
Posts: 74
Location: Argentina

argentina.gif
PostPosted: Tue Nov 14, 2023 3:11 am    Post subject: Problems with Lib glcd-Nokia3310.lib Reply with quote

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
View user's profile Visit poster's website
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 320
Location: Japan

japan.gif
PostPosted: Wed Nov 15, 2023 1:28 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Thu Nov 16, 2023 8:18 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 320
Location: Japan

japan.gif
PostPosted: Fri Nov 17, 2023 1:49 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Fri Nov 17, 2023 1:35 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
sielcon

Bascom Member



Joined: 16 Mar 2006
Posts: 74
Location: Argentina

argentina.gif
PostPosted: Mon Nov 27, 2023 3:07 pm    Post subject: Reply with quote

Thank you all very much, it works perfectly.
Kind regards
Back to top
View user's profile Visit poster's website
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 68
Location: Ljubljana

slovenia.gif
PostPosted: Wed Dec 13, 2023 4:45 pm    Post subject: Reply with quote

Hi,

I am driving 84x48 LCD as described on ZL2PD's page with Reset connected to 10k and 4.7uF and CE connected to GND

That all worked well with the libs provided in this thread.

Lately I have got "same" LCDs, but these LCDs do not work at all in the same circuit. They work OK if I use all pins to drive, but shows nothing in my circuit.

So I had to modify LIB in the line 48: Temperature setting to &H08, it was &H06. After that some displays started to work however, I could not change contrast.

So I was wondering if anyone of you had same experience with these changed LCDs?

Best regards
Jure
Back to top
View user's profile Visit poster's website
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 320
Location: Japan

japan.gif
PostPosted: Thu Dec 14, 2023 2:04 am    Post subject: Reply with quote

The PCD8544 datasheet states that &H08 is an unused command.
There are four types of temperature coefficients: &H04, &H05, &H06, &H07.
There seem to be many compatible controllers for the PCD8544, so there may be differences in commands.

Similarly, we have confirmed that some modules cannot use contrast instructions due to differences in compatible PCD8544 controllers.
This is especially true for the red board type.
However, the contrast command is not available, but the contrast is automatically adjusted even if the power supply voltage changes.
Back to top
View user's profile Visit poster's website
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 68
Location: Ljubljana

slovenia.gif
PostPosted: Thu Dec 14, 2023 8:06 am    Post subject: Reply with quote

Thanks for explanation O-Family!
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
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8
Page 8 of 8

 
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