View previous topic :: View next topic |
Author |
Message |
O-Family
Joined: 23 May 2010 Posts: 337 Location: Japan

|
|
Back to top |
|
 |
Mortezayavari1366
Joined: 24 Dec 2022 Posts: 8

|
Posted: Mon Mar 20, 2023 7:46 pm Post subject: |
|
|
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 |
|
 |
Mortezayavari1366
Joined: 24 Dec 2022 Posts: 8

|
Posted: Tue Mar 21, 2023 2:03 pm Post subject: |
|
|
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  |
Hi Mark,
What's different between Nokia 1202 and HX1230? |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 6173 Location: Holland

|
Posted: Tue Mar 21, 2023 9:04 pm Post subject: |
|
|
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 |
|
 |
Mortezayavari1366
Joined: 24 Dec 2022 Posts: 8

|
Posted: Tue Mar 21, 2023 10:25 pm Post subject: |
|
|
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 |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 6173 Location: Holland

|
Posted: Wed Mar 22, 2023 9:55 am Post subject: |
|
|
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 |
|
 |
Mortezayavari1366
Joined: 24 Dec 2022 Posts: 8

|
Posted: Wed Mar 22, 2023 1:59 pm Post subject: |
|
|
Thanks for your help Mark.
The problem was solved |
|
Back to top |
|
 |
|