and here is yet another working piece of code.
dependend on your LCD
you will have to adjust the values in the LCD_Init Routine
and here is yet another working piece of code.
dependend on your LCD
you will have to adjust the values in the LCD_Init Routine
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Hello
I need a complete PICBasic Pro code for controlling Nokia 3310 LCDs, as I have plenty of those, can any one post it here please, also I need this LCD datasheets.
Thanks in advance
Crematory,
Pleas read this thread from the beginning.
There are several code examples and linlt to DataSheets etc.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
i could not tied the connection. Can you help me ?
1-Vdd-------- 5V
2-SCK--------Portb.4
3-SDIN-------
4-D/C--------Portb.6
5-SCE--------
6-GND--------GND
7-Vop--------
8-RES--------Portb.7
DEFINE LOADER_USED 1
DEFINE OSC 20
DC VAR PortB.6
DTA VAR PortB.5
RST VAR PortB.7
CLK VAR PortB.4
1-Vdd-------- 5V
2-SCK--------Portb.4
3-SDIN-------PORTB.5
4-D/C--------Portb.6
5-SCE--------
6-GND--------GND
7-Vop--------
8-RES--------Portb.7
DEFINE LOADER_USED 1
DEFINE OSC 20
DC VAR PortB.6
DTA VAR PortB.5
RST VAR PortB.7
CLK VAR PortB.4
Datasheet => http://www.myplace.nu/mp3/files/pcd8544.pdf
http://www.picbasic.co.uk/forum/show...7&postcount=40
Last edited by mister_e; - 9th December 2006 at 20:35.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
This wouldn't be the practically the same LCD as the one found at Sparkfun is it?
http://www.sparkfun.com/commerce/pro...oducts_id=569#
Hi all
any body deal with Nokia 6310 LCD ?
it is exist two opinion about this LCD :
first it is operate by i2c protocol .
the other operate by SPI 3-wire .
which is true ?
i make the data with using Matrix program but Where will i place data after scaned picture in pbp program? ? have you any example about it?
PROGRAM:
DEFINE LOADER_USED 1
DEFINE OSC 20
DC VAR PortB.6
DTA VAR PortB.5
RST VAR PortB.7
CLK VAR PortB.4
Chr VAR Byte
BitMap VAR Word
CharCount VAR Byte
PosX VAR Byte
PosY VAR Byte
Column VAR Byte [6]
LCDstr VAR Byte [26]
LcdData VAR Byte
PAUSE 100
GOSUB LCD_INIT
PAUSE 100
GOSUB LCD_Clear
Start:
Loop:
'PAUSE 2000
'LOW DC
'LcdData= %00001101:GOSUB LCD_ByteOut ' Invert
'PAUSE 2000
'LcdData= %00001000:GOSUB LCD_ByteOut ' Blank
'PAUSE 2000
'LcdData= %00001100:GOSUB LCD_ByteOut ' Normal
GOTO loop
LCD_Init:
LOW RST ause 20 : HIGH RST : LOW DC ' RESET LCD
LcdData= $21: GOSUB LCD_ByteOut ' LCD EXTENDED COMMANDS
LcdData= $c8: GOSUB LCD_ByteOut ' SET LCD Vop (CONTRAST)
LcdData= $06: GOSUB LCD_ByteOut ' SET TEMP COEFFICENT
LcdData= $13: GOSUB LCD_ByteOut ' LCD BIAS MODE
LcdData= $20: GOSUB LCD_ByteOut ' LCD STANDARD COMMANDS
LcdData= $0c: GOSUB LCD_ByteOut ' LCD IN NORMAL MODE
RETURN
LCD_ByteOut:
SHIFTOUT DTA,CLK,1,[LcdData]
RETURN
LCD_CharOut:
IF lcddata=32 THEN BitMap=216 ' SPACE
IF lcddata=42 THEN BitMap=240 ' *
IF lcddata=43 THEN BitMap=222 ' +
IF lcddata=45 THEN BitMap=228 ' -
IF lcddata=46 THEN BitMap=234 ' .
IF lcddata=58 THEN BitMap=246 ' :
IF LCDData > 47 THEN ' Numbers 0-9
IF lcddata < 59 THEN
BitMap=6*(lcddata-48)+156
ELSE ' Capital Letters A-Z
BitMap=(LcdData-65) * 6
ENDIF
ENDIF
FOR Chr=0 TO 5
READ BitMap+Chr,Column(Chr)
NEXT Chr
HIGH DC
SHIFTOUT DTA,CLK,1,[Column(0),Column(1),Column(2),Column(3),Column(4), Column(5)]
RETURN
LCD_StringOut:
FOR CharCount=0 TO 13
LcdData=LCDstr(CharCount)
PAUSE 80
GOSUB LCD_CharOut
NEXT CharCount
RETURN
LCD_Clear:
PosX=0:PosY=0:GOSUB LCD_GotoXY
HIGH DC
FOR Chr=1 TO 252
LcdData=0:GOSUB LCD_ByteOut
LcdData=0:GOSUB LCD_ByteOut
NEXT Chr
RETURN
LCD_GotoXY:
LOW DC
LcdData=%01000000 | PosY :GOSUB LCD_ByteOut
LcdData=%10000000 | PosX :GOSUB LCD_ByteOut
RETURN
'-------------------------------------------------
' Font DATA table
'-------------------------------------------------
' DEC Chr HEX
Data $7E,$11,$11,$11,$7E,$00 ' 65 A 41
Data $7F,$49,$49,$49,$36,$00 ' 66 B 42
Data $3E,$41,$41,$41,$22,$00 ' 67 C 43
Data $7F,$41,$41,$22,$1C,$00 ' 68 D 44
Data $7F,$49,$49,$49,$41,$00 ' 69 E 45
Data $7F,$09,$09,$09,$01,$00 ' 70 F 46
Data $3E,$41,$49,$49,$7A,$00 ' 71 G 47
Data $7F,$08,$08,$08,$7F,$00 ' 72 H 48
Data $00,$41,$7F,$41,$00,$00 ' 73 I 49
Data $20,$40,$41,$3F,$01,$00 ' 74 J 4A
Data $7F,$08,$14,$22,$41,$00 ' 75 K 4B
Data $7F,$40,$40,$40,$40,$00 ' 76 L 4C
Data $7F,$02,$0C,$02,$7F,$00 ' 77 M 4D
Data $7F,$04,$08,$10,$7F,$00 ' 78 N 4E
Data $3E,$41,$41,$41,$3E,$00 ' 79 O 4F
Data $7F,$09,$09,$09,$06,$00 ' 80 P 50
Data $3E,$41,$51,$21,$5E,$00 ' 81 Q 51
Data $7F,$09,$19,$29,$46,$00 ' 82 R 52
Data $46,$49,$49,$49,$31,$00 ' 83 S 53
Data $01,$01,$7F,$01,$01,$00 ' 84 T 54
Data $3F,$40,$40,$40,$3F,$00 ' 85 U 55
Data $1F,$20,$40,$20,$1F,$00 ' 86 V 56
Data $3F,$40,$38,$40,$3F,$00 ' 87 W 57
Data $63,$14,$08,$14,$63,$00 ' 88 X 58
Data $07,$08,$70,$08,$07,$00 ' 89 Y 59
Data $61,$51,$49,$45,$43,$00 ' 90 Z 5A
Data $3E,$51,$49,$45,$3E,$00 ' 48 0 30
Data $00,$42,$7F,$40,$00,$00 ' 49 1 31
Data $42,$61,$51,$49,$46,$00 ' 50 2 32
Data $21,$41,$45,$4B,$31,$00 ' 51 3 33
Data $18,$14,$12,$7F,$10,$00 ' 52 4 34
Data $27,$45,$45,$45,$39,$00 ' 53 5 35
Data $3C,$4A,$49,$49,$30,$00 ' 54 6 36
Data $01,$71,$09,$05,$03,$00 ' 55 7 37
Data $36,$49,$49,$49,$36,$00 ' 56 8 38
Data $06,$49,$49,$49,$3E,$00 ' 57 9 39
Data $00,$00,$00,$00,$00,$00 ' 32 20
Data $08,$08,$3E,$08,$08,$00 ' 43 + 2B
Data $08,$08,$08,$08,$08,$00 ' 45 - 2D
Data $00,$60,$60,$00,$00,$00 ' 46 . 2E
Data $14,$08,$3E,$08,$14,$00 ' 42 * 2A
Data $00,$36,$36,$00,$00,$00 ' 58 : 3A
DATA
$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 ,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$ 0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0, $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 ,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$ 0,
DATA $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 ,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$ 0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0, $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$F0,$F0,$0,$0,$0,$0, $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 ,$0,
DATA $0,$0,$0,$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$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$ 0,
;
Hi PCBB
As there has been a lot of time since last worked in this project (matrix proggy of mine e.t.c) I have to re-scan my nokialcd files to answer you...
Please wait a little and I 'll see what I can do for you.
Which program did you use for convert to hex ? there are many program for graphic lcd but they dont make 5 columns about data, more! So Microcode program give error "Address exceeds maximum range for this processor " My processor is 16F877
There are many converter in this site, h**p://www.compsys1.com/workbench/Benchware/GLiPIC2/glipic_2.html
Can you help me for this problem ?
Last edited by pcbb; - 9th February 2007 at 00:36. Reason: adding site
I didn't manage yet to visit my lab (upstairs) to compile and try my code for you !
I hope this weekend
hello bitmaniac,
In some previous posts, it is said that your code contains some errors. Can you point out those errors to me ? ? ?
I'm having a hard time getting the nokia 3310 LCD to work.
bitmaniac,
Where do i have to place the data generated by the matrix program ???
shahidali55, you have to place the data in the start of your program, after the device and xtal definition. However, I stumbled on a problem with bitmaniacs matrix program. It generates code in one long string for ech line of the display, however these lines get to long for the PICBASIC to interpret them, so it cuts them off when they are longer than 250 symbols, so the picture gets ruined. I tried to write my own program, that would split the data in more lines, but when i split the data it for some reason ads a $00 byte after each line which results in shifted lines, that also ruins the graphic. Does anyone know how to deal with this?
Any replies would be appreciated
Regards
Denis Tcherniak
I meant, that's not a bug in my program, it works perfectly, i mean the PICBASIC program. When I add multiple DATA statements eg.
DATA $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DATA $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
and then make the pic "paste" all the data to the screen it adds an empty column after each DATA line. It draws the first 11 black lines then it adds an empty line, and then it continues to the second data line.
Regards
Denis Tcherniak
I don't follow what you're trying to say...pic 'paste'...adds empty column...???
If it's not a bug in your program (what program? where?) and it's a PICBASIC problem, then post the code for the PICBASIC program. I've used DATA plenty of times without a problem, up to and including lines 254 characters long.
By, "my program" i meant a prog I wrote in VB.net for converting BMP pictures to PBP DATA code, so the lines wouldn,t get longer than 250 characters.
I am sorry, it is late, and it is hard to explain the problem. I have attached my PBP code. The data I want to use as picture is declared in the very start of the program, and it is slitted, so the lines are < 250. After the initialization of the display I call the LCD_SHOWIMAGE sub, this happens at line 95. The LCD_SHOWLCD is running a loop 504 times, each time advancing to the next DATA byte, to fill the entire display matrix with data. I am using a filled with black pixels image to make the debugging easier. I have attached a photo of the display, when my program has been run. The focusing isn't good, but notice the white lines. There are 8 of them, equal to the number DATA strings in the program.
Regards
Denis Tcherniak
MELabs PICBASIC forums? Are you writing this because I mentioned my .net program? I have not asked for help with .net. I am trying to get help with some PIC BASIC code I wrote. I mentioned .net just to explain the inconvenience we had before about me saying "my own program".
Regards
Denis Tcherniak
Well, good luck trying to get these lines:
DEVICE 18F458
XTAL = 4
@CONFIG_REQ
DECLARE RSOUT_MODE INVERTED , TRUE
.............
DECLARE SERIAL_BAUD 9600
DIM I AS BYTE
.................
DIM E_DATA AS BYTE
DELAYMS 50
SHOUT LCD_SDA , LCD_CLK , MSBFIRST, [ $21,$A7,$20 ]
VALIN = COUNTER PORTE.2 ,100
STR LCDSTR = "Freq:",0:GOSUB LCD_HOME:GOSUB LCD_SENDSTRING
STR LCDSTR = STR$(DEC VALIN):GOSUB LCD_SENDSTRING
STR LCDSTR = "KHz:",0
RSOUT DEC VALIN,$D,$A
RSOUT "MEMORY FULL"
DELAYMS 20
SHOUT LCD_SDA , LCD_CLK , MSBFIRST, [ LCD_DATA ]
SHOUT LCD_SDA , LCD_CLK , MSBFIRST, [ LCD_DATA ]
LCD_DATA=CREAD FONT1+J+I
SHOUT LCD_SDA , LCD_CLK , MSBFIRST, [ FONTCACHE[0],FONTCACHE[1],FONTCACHE[2],FONTCACHE[3],FONTCACHE[4],FONTCACHE[5] ]
RSOUT "BAR", DEC I2,":", DEC LCD_DATA, "PLOT:",DEC
RSOUT "0"
EWRITE CUR_ADR,[E_DATA]
CData $00,$00,$00,$00,$00,$00 'Graphic character 0
...............
CData $00,$08,$04,$08,$04,$00 '126 ~ - 7E
using the compiler that's listed at the top of this webpage, roughly 3rd line down, at the left of the screen.
Last edited by skimask; - 11th May 2007 at 23:34.
What Skimask try to say in it's own words ... this is Melabs PICBASIC forum and not Crownhill PROTON (PDS or else) forum.
PROTON Picbasic forum is located
www.picbasic.org/forum
Last edited by mister_e; - 11th May 2007 at 23:39.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Dough... I am sorry, guys... I actually thought that it was the same thing, since the code from this forum, end especially this topic always worked for me.. Is the syntax really the same??
I'll try the other forum...
sorry again..
Regards
Denis Tcherniak
Syntax are slightly different... but both are named PICBASIC, hence the confusion. Don't worry about that
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
hi guys, pls i need help on interfacing a game boyGLCD to PIC16F877.
thanks in anticipation
How can i make this in PicBasic Pro ?
http://free-vz.htnet.hr/Ivica-Novako...ometar-eng.htm
I want to use the 12F629 , a 3310 lcd and the DS1820.
Currently i have got the DS1820 running and readings displayed onto a 16x1 LCD.
Wow cool. Thanks Ioannis.
I'll modify the code to work with DS1820 and see if it works...
Thanks Again . . .
Ioannis,
could you please help me out with the variable names?
Can you give me the meaning of variable names like Bitovi,Predznak,Skala,MinusNaSkali,PrintSkala ?
I am having a hard time understanding what these variables mean...
I don't speak that lanquage too, but I think the meaning is as this:
Skala = scale
predznak = flag
MinusNaSkali = Negative Scale
PrintSkala = Print Scales on LCD
Hope it helps you a little.
Ioannis
Assuming it 'could be' Croatian, i think it mean 'Bit' or 'Digit'
well...
http://www.eudict.com/?lang=croeng&w...&submit=Search
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well, after looking the program again, bitovi is defined as byte to store a flag. That flag is 'predznak' which as you stated could be the sign.
The bitovi is not directly used anywhere in the program.
Ioannis
Bookmarks