Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Library for Nokia1616 display
Goto page 1, 2  Next
 
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
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Mon Oct 13, 2014 9:06 pm    Post subject: Library for Nokia1616 display Reply with quote

NOKIA-1616 series color display has resolution 128x160, size 1,8". Controller is SPFD54124B

Library works on NOKIA displays:
100, 101, 112, 113, 1616, 1661, 1662, 1800, 5030с, С1-00, С1-01, С1-02, С1-03, С2-00, X1-01 (12-pin socket):


And 2865cdma, 5070, 5200, 6060, 6061, 6070, 6080, 6085, 6086, 6101, 6102, 6103, 6125, 6136, 6151, 7360 (22-pin socket DF23-22):



Backlight is 3V or 7V, be careful.

Library has "Portrait" & "Landscape" mode and "Rotate 180" function.
Example in attachment.


Last edited by Mrshilov on Sat Mar 04, 2017 5:48 pm; edited 1 time in total
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5093
Location: Holland

blank.gif
PostPosted: Tue Oct 21, 2014 9:48 pm    Post subject: Reply with quote

Thanks for sharing your excellent libs Mrshilov. As usual there is a lib, circuit and sample. Great Very Happy
_________________
Mark
Back to top
View user's profile Visit poster's website
shams_iqbal

Bascom Member



Joined: 13 Feb 2013
Posts: 2

PostPosted: Sat Apr 02, 2016 9:13 pm    Post subject: Reply with quote

it seems very interesting library got this nokia tft then i have tried your library but when i tried to change microcontroler with atxmega32a4u it give me follwing error

Error : 221 Line : 128 Backward jump out of range [_CLEAR_GRAPH1 [ 101]] , in File : C:\Users\Shams\Desktop\nokia c1 lcd display\Sources\xmega64a4u.bas
Error : 221 Line : 128 Backward jump out of range [_CLEAR_GRAPH2 [ 104]] , in File : C:\Users\Shams\Desktop\nokia c1 lcd display\Sources\xmega64a4u.bas

otherwise with selected avr (any mega avr) microcontrollers it compiles without any error

here is my code
Code:
'----------------------------------------------------------------------------'
'                     NOKIA-1616 display library                             '
'                         resolution 128x160                                 '
'                                                                            '
'                         BASCOM-AVR  2.0.7.7                                '
'                         Shilov Sergey 2014                                '
'                            St-Peterburg                                    '
'                               RUSSIA                                       '
'                                                                            '
'----------------------------------------------------------------------------'
$regfile = "xm32a4udef.dat"
$crystal = 32000000
$hwstack = 64
$swstack = 64
$framesize = 64
'include the following lib and code, the routines will be replaced since they are a workaround
$lib "xmega.lib"
$external _xmegafix_clear
$external _xmegafix_rol_r1014

'First Enable The Osc Of Your Choice , make sure to enable 32 KHz clock or use an external 32 KHz clock
'Config Osc = Enabled , 32mhzosc = Enabled

'configure the systemclock
'Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1

'------------------------------- Setup -----------------------------------------
$lib "glcd-Nokia1616ap.lib"
Config Graphlcd = Color , Cs1 = Portd.7 , Si = Portd.4 , Sclk = Portb.1 , Rst = Portb.0

Const Portrait = 0                                          '1=Portrait, 0=Landscape
Const Rotate_180 = 0                                        '1=Rotated,  0=Not Rotated

'------------------- Variables & Constants -------------------------------------
Const Blue = &B00000011                                     ''predefined contants are making programming easier
Const Yellow = &B11111100
Const Red = &B11100000
Const Green = &B00011100
Const Black = &B00000000
Const White = &B11111111
Const Brightgreen = &B00111110
Const Darkgreen = &B00010100
Const Darkred = &B10100000
Const Darkblue = &B00000010
Const Brightblue = &B00011111
Const Orange = &B11111000
Const Violet = &B11100011

Dim I As Byte , N As Byte , M As Byte , P As Byte
'============================ Main prog ========================================
Initlcd

Cls

Do



   Boxfill(0 , 0) -(127 , 159) , Green
   Boxfill(0 , 0) -(127 , 159) , Red
   Boxfill(0 , 0) -(127 , 159) , Violet
   Boxfill(0 , 0) -(127 , 159) , Yellow
   Boxfill(0 , 0) -(127 , 159) , Blue

   Line(0 , 0) -(127 , 0) , Yellow
   Line(0 , 0) -(0 , 159) , Yellow
   Line(0 , 159) -(127 , 159) , Yellow
   Line(127 , 0) -(127 , 159) , Yellow

   Pset 1 , 1 , Yellow
   Pset 126 , 1 , Yellow
   Pset 1 , 158 , Yellow
   Pset 126 , 158 , Yellow

   Box(2 , 2) -(125 , 157) , Yellow

   For I = 1 To 63 Step 4
      Circle(64 , 80) , I , Green
   Next I

   Setfont Color8x8
   Lcdat 76 , 12 , "  Nokia 1616  " , Orange , Blue
   Wait 1

   Boxfill(0 , 0) -(127 , 159) , White
   Showpic 24 , 40 , Clock



Wait 2

Loop

End

'-------------------------------------------------------------------------------
$include "color8x8.font"
Clock:
$bgf "Clock.bgc"



can you plz help me that why this error is appearing wile compiling with any of atxmega controllers
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Sat Apr 02, 2016 10:15 pm    Post subject: Reply with quote

Use virtual port:
Code:
Config Vport0 = B
Config Vport1 = D
Config Graphlcd = Color , Cs1 = Port1.7 , Si = Port1.4 , Sclk = Port0.1 , Rst = Port0.0
Back to top
View user's profile
shams_iqbal

Bascom Member



Joined: 13 Feb 2013
Posts: 2

PostPosted: Mon Apr 04, 2016 8:39 pm    Post subject: Reply with quote

dear ,Mrshilov

thank you for quick reply and helping me out on the issue
now i am able to compile the code using atxmeg32a4u mcu but there is one last problem remained in the libraray that if i chose atxmega64a4u/arxmega128a4u it gives the same error as before this addition i am actually using atxmega128a4u but using
$regfile = "xm32a4udef.dat"

i can compile the code with out any errors and its running flawlessly while changing it to
Code:
$regfile = "xm64a4udef.dat"  

or
Code:
$regfile = "xm128a4udef.dat"    


gives me same previous error Sad as i mentioned earlier to this post any how great work thumbs up Applause

one more question if i want to use big fonts to display on lcd how this can be done thanks in advance
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Mon Apr 04, 2016 11:10 pm    Post subject: Reply with quote

I checked
Code:
$regfile = "xm64a4udef.dat"

and
Code:
$regfile = "xm128a4udef.dat"

No errors.
Back to top
View user's profile
endusa200

Bascom Member



Joined: 29 Jan 2017
Posts: 8

PostPosted: Thu Feb 02, 2017 9:09 pm    Post subject: mega128 Reply with quote

hello
when I change miro to mega128( $regfile = "m128def.dat" ) this erors seen :

bakward jump out of range

but it's working with atmega64
can you help me ? Crying or Very sad
Back to top
View user's profile
endusa200

Bascom Member



Joined: 29 Jan 2017
Posts: 8

PostPosted: Thu Feb 02, 2017 9:14 pm    Post subject: mega128 Reply with quote

back ward jump out of rang [_SHOW PICTURE2 [68]]
back ward jump out of rang [_SHOW PICTURE1 [75]]

WHEN I use "Showpic" code with meg128 this eror seen
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Fri Feb 03, 2017 12:10 am    Post subject: Reply with quote

Try this version.
Back to top
View user's profile
endusa200

Bascom Member



Joined: 29 Jan 2017
Posts: 8

PostPosted: Fri Feb 03, 2017 8:27 am    Post subject: mega128 Reply with quote

thank you
it's working Smile
Back to top
View user's profile
endusa200

Bascom Member



Joined: 29 Jan 2017
Posts: 8

PostPosted: Mon Feb 13, 2017 5:44 pm    Post subject: error Reply with quote

Hello
tanks for last code

It's working for atmega128 with port A,port B,port C,port D and port E , but when I use the port F for lcd , this error seen :

backward jump out of range[_Clear_Graph1[101]]
backward jump out of range[_Clear_Graph2[104]]

can you help me ?
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Tue Feb 14, 2017 12:44 am    Post subject: Reply with quote

This is not library problem - M1281 with the same pinout works fine.
In M128 due to M103 compatibility PORTF & PORTG will not work.
Back to top
View user's profile
endusa200

Bascom Member



Joined: 29 Jan 2017
Posts: 8

PostPosted: Wed Feb 15, 2017 4:52 pm    Post subject: Reply with quote

OK
thank you for answering
Back to top
View user's profile
yahi92

Bascom Member



Joined: 23 Feb 2014
Posts: 25

PostPosted: Sat Mar 04, 2017 6:31 am    Post subject: Reply with quote

Hello Mrshilov
Do you have any sample for loading "BMP" files from sdcard for this display?
(or any suggestion for doing that?)
Thanks for your great works(we should name you "Display Man"!)
Best regards
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Sat Mar 04, 2017 6:04 pm    Post subject: Reply with quote

IMHO it's not good idea - it will be very slow (several seconds per picture). Better use for this LCD with parallel interface. For example NOKIA3110 - the same resolution & controller.
http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13057&highlight=3110
Example of using SD-card BMP included.
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 1, 2  Next
Page 1 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