Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

NOKIA-1100 library
Goto page Previous  1, 2
 
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
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 320
Location: Japan

japan.gif
PostPosted: Mon Mar 20, 2023 2:19 am    Post subject: Reply with quote

It may be the same compiler problem for the ATmega2560 that recently occurred with [ILI9341]'s library.
https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=14405&start=15
Please let us know your symptoms in detail.
Back to top
View user's profile Visit poster's website
Mortezayavari1366

Bascom Member



Joined: 24 Dec 2022
Posts: 8

blank.gif
PostPosted: Mon Mar 20, 2023 7:46 pm    Post subject: Reply with quote

Mrshilov wrote:
It's very sad. Thanks, I'm safe.
---
You are always welcome in St. Petersburg. Don't worry about your safety - our city is very peaceful.





Hello Mrshilov

i want run nokia 1202 lcd with your library.
in mega 8-16-32 every think is ok but in atmega2560 not working.
this my code and photo of my lcd:

$regfile = "m2560def.dat"
$crystal = 16000000
$hwstack = 40
$swstack = 40
$framesize = 40
$baud = 9600
''''''''''''''''''''''''''''''''''''PIN'S MAP'''''''''''''''''''''''''''''''''''
'**LCD128*64 1202**
'RST = PORTL.0
'SCK = PORTL.3
'MOSI = PORTL.2
'CS = PORTL.1

'''''''''''''''''''''''''''''''''' PORT CONFIG '''''''''''''''''''''''''''''''''
Ddrh.6 = 1 : Porth.6 = 0 'OUTPUT AND DEFINE LOW / BUZZ
Ddrl.4 = 1 : Portl.4 = 1 'OUTPUT AND DEFINE HIGH / LCD BACK LIGHT
Ddrb.7 = 1 : Portb.7 = 0 'OUTPUT AND DEFINE LOW / STATUS LED

Buzz Alias Porth.6
Lcd_bl Alias Portl.4
Status_led Alias Portb.7

''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim I As Byte : I = 0


$lib "glcd-Nokia1100.lib"
Config Graphlcd = 128x64sed , Si = Portl.2 , Sclk = Portl.3 , Cs1 = Portl.1 , Rst = Portl.0


'*******************************************************************************
'*********************************** START *************************************
'*******************************************************************************

Lcd_bl = 0 'back light on

'*******************************************************************************
'*********************************** MAIN **************************************
'*******************************************************************************

Initlcd
Cls
Setfont Font6x8
Lcdat 1 , 1 , "+"
Lcdat 2 , 1 , "1"
Lcdat 3 , 1 , "aV"
Waitms 2000

Buzz = 1
Waitms 200
Buzz = 0

Do

Toggle Status_led
Waitms 500

Loop

End

'*******************************************************************************
'********************************** INCLUDE ************************************
'*******************************************************************************
$include "font6x8.font"
$include "font12x16dig.font"
$include "font8x8my.font"
Back to top
View user's profile
Mortezayavari1366

Bascom Member



Joined: 24 Dec 2022
Posts: 8

blank.gif
PostPosted: Tue Mar 21, 2023 2:03 pm    Post subject: Reply with quote

albertsm wrote:
do not ask too much., At the rate Mr Mrshilov is delivering tested code/hardware, he either must have a clone of himself, or get problems with Mrs. Mrshilov because he is always working Very Happy


Hi Mark,
What's different between Nokia 1202 and HX1230?
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Tue Mar 21, 2023 9:04 pm    Post subject: Reply with quote

i dont know the difference.
i do know that there is a bug in the lib.

- open the lib with notepad
- search for : lpm ; get byte
- change lpm into elpm
- save the file

rest of the lib looks good.

when connecting lcd, best to use pins from the lower ports like porta, portb, portc the high ports like portL do not support some asm commands.

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

Bascom Member



Joined: 24 Dec 2022
Posts: 8

blank.gif
PostPosted: Tue Mar 21, 2023 10:25 pm    Post subject: Reply with quote

albertsm wrote:
i dont know the difference.
i do know that there is a bug in the lib.

- open the lib with notepad
- search for : lpm ; get byte
- change lpm into elpm
- save the file

rest of the lib looks good.

when connecting lcd, best to use pins from the lower ports like porta, portb, portc the high ports like portL do not support some asm commands.


Hi Mark

I changed lpm to elpm but I still have the same problem.
I use Mrshilov "glcd-Nokia1100.lib" and I got an answer with mega 8-16-32 with this library and program. But I have a problem with Atmega2560.
for example, if I send a character for display, the display will show 16 characters in a row.
I attached the program file and library.
Thank you for your guidance
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Wed Mar 22, 2023 9:55 am    Post subject: Reply with quote

the problem is in the LIB.
R23 is not properly saved.
The reason it works with M8 is that there the ports have a low address and CBI/SBI can be used without use of a register.
In M2560 that can work too when using ports with a low address. But you are using ports on an extended IO address.
This means CBI/SBI do not work and the compiler use R23. but it also means in the lib you need to protect R23.
Now it was protected but not properly.
I fixed it and attached the mod.

Do notice however that MCS is not responsible for third party libs.

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

Bascom Member



Joined: 24 Dec 2022
Posts: 8

blank.gif
PostPosted: Wed Mar 22, 2023 1:59 pm    Post subject: Reply with quote

Thanks for your help Mark.
The problem was solved
Back to top
View user's profile
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
Page 2 of 2

 
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