PDA

View Full Version : Using Nokia LCD



Pages : [1] 2

BobP
- 26th March 2004, 18:12
Hi all,

I have noticed recently that LCD displays from Nokia phones (6310, etc.) are being used in PIC projects.

I have collected datasheets and before I loose more hair I wondered if anyone has written PBP code to drive this display?

Any snippets of code or hints would be appreciated.


Thanks,
Bob


Edit from Moderator:
A Wiki has been created for one solution for the Nokia 3310 display from a few of the posts in this thread. It can be found here: http://www.picbasic.co.uk/forum/content.php?r=174-Using-Nokia-3310-LCD.

Original
- 27th March 2004, 00:07
Try here:

Is in CCS C code not picbasic pro though!

http://users.skynet.be/bk317494/

INIT_LCD:

SSPSTAT.6 = 1 'CKE
SSPCON.0 = 1 'TCK / 16
SSPCON.5 = 1 'ENABLE MSSP

HIGH CMD_DAT 'COMMAND / DATA LINE
HIGH LCD_C_S 'LCD CHIP SELECT
HIGH LCD_PWR 'LCD POWER ENABLE
LOW LCD_RST 'LCD RESET LINE
PAUSE 20
HIGH LCD_RST

LOW CMD_DAT

SSPBUF = 33 'EXTENDED COMMAND SET
PAUSE 1
SSPBUF = 200 'SETUP VOP
PAUSE 1
SSPBUF = 19 'SETUP BIAS
PAUSE 1
SSPBUF = 32 'NORMAL COMMAND SET
PAUSE 1

SSPBUF = 9 'TURN ON ALL SEGMENTS
PAUSE 100

SSPBUF = %00001100 'DISPLAY NORMAL
PAUSE 1

HIGH CMD_DAT ' GET READY TO SEND PIXEL DATA
HIGH LCD_C_S ' DESELECT LCD

RETURN

BobP
- 27th March 2004, 15:33
Thanks,

Thats enought to get me started. I will post the code here once I have finished it.

Thanks,
Bob.

Original
- 2nd April 2004, 03:26
Here's one submitted on the Proton Picbasic site.

Hawkesy
- 17th September 2004, 07:27
Hi all,

I have just got my Nokia 5110 LCD working, I tried the ASM code from Berty's page (http://sandiding.tripod.com/Bertys.html), however I had problems getting it going. I re-wrote the code using PBP, now I can display stuff. It is very code intensive as the display is dumb and you have to set each pixel. I used a PIC16F628 and the Shiftout command. I will attach the .BAS file. If anybody wants to improve the code please do I would be interested in any improvements. i would also like to know how to use a lookup table to display pre defined characters.

Cheers

Hawkesy
- 17th September 2004, 07:28
Oh yeah here is a txt file for the charater set and their associated hex codes.

bitmaniac
- 17th September 2004, 14:51
Hi!
Guys
I have already smth ready for you (I think)
two months ago I tried to figure out a way to drive a nokia
LCD using just a pic and Picbasic pro!
Here is the good news: SUCCESS

As i am at work now, as soon as I find some time I will dig-out and send you the simple schematic and of course the source!
Wait till then...
See you :)
P.S As I can remember the only limit was that you need a lot of eeprom space to 'throw in' the character bitmap mask data.

bitmaniac
- 18th September 2004, 22:49
Hi,Guys!

At last I managed to dig out the infos you want.
I attached the pbp source for anyone interested
Also I have written a very good utilty in VB (included in zip)that
helps you create the graphic data you can inport in
pic basic in order to diaplsy bitmap images on the nokia lcd!

I hope you find then usefull

:))
Also included is the connection to nokia lcd

NOTE:You MUST unzip the file in your c:\matrix , in order
to run properly!

Tim B
- 19th September 2004, 17:40
If you want a font to bit map converter have a look at the one written for PPrint.

http://users.picbasic.org/Howto/PPRINT/pprint_enabling_variable_fonts_o.htm

Tim

BobP
- 24th September 2004, 16:41
Many thanks for all the replies, I have written some code but it needed tidyed up before posting. But it will now gather dust on the hard drive.

look forward to building something (even an egg timer!) just to try the code.

Thanks,
BobP

stu746
- 23rd January 2005, 14:14
been trying to get this working for a while now, i am beginning to think my lcd does not work or maybe i damaged it when soldering it,

should the lcd turn black or anything when power is applied?

i used bitmaniacs code and compiled it for a 16f877a but the lcd does nothing when I power up :(

i also have a nokia 6610 lcd if anyone has a circuit and any code to get this working?

thanks for any help

Stu

srspinho
- 24th January 2005, 10:38
Hi Bob,

the same thing happened to me this weekend !


As I can not find the 16F648 to buy here in Brazil, I´m using the 16f877 to do the tests.

I Just removed the CMCON line from the code and changed the cristal to 10 Mhz, but the display still not responding.

I have conected the Vout pin to Gnd via a 1 uf Cap.

I´m powering up the display with 5 V (maybe I should change to 3,3v)

I have seen other project powering up the display with 5V with out problems.

After some hours testin the circuit and the software with no success, I decided to test another display. But the results were the same... a blank display.

If could someone help us, it will be apreciated.

Regards !

Sérgio

stu746
- 25th January 2005, 14:18
Hi Sérgio,

seems like you are having same problem as me, did u manage to get it working yet?

i am using 5v too and am unsure wether this is the problem, but i have seen a few circuits using 5v.


Stu

srspinho
- 25th January 2005, 16:28
Hi Stu,

I'm still trying... but the display still blank, showing nothing, even a small flash when I turn on the 5 Volts.

I got two more displays, but they are 9 pin version. I will connect them using the mobile's main board 8 pin (in the PCI's Back).

Other weird behavior I'm facing is the fact of the 877, sometimes, don't start. I have to wait for some minutes and try again.
I don't have much experience in electronics, as I'm just a curious but a behavior like that is really strange.

TInight I will try the other dispplay type and if I get some good result, don't worry, I will let you know ! ! !

Regards.

Sérgio Pinheiro (Brazil)
ps. sorry for my bad english... portuguese is my mother language...

stu746
- 25th January 2005, 16:37
Hi again,

yeah i have problems like that with pics sometimes, i usually find it is the batteries gowing flat and need to change them.

I also have one of the 9 pin versions from a nokia 5110 I think, it seems impossible to solder to the lcd, so i tried soldering to the back of the pcb, but i could not trace one of the connections, i took a bit of a guess in the end as i think it is connected to the lcd via a capacitor.

but could not get this working any better. let me know how u get one, i am begining to think i need a better power suplpy.

Stu

bitmaniac
- 25th January 2005, 21:30
Hi Guys
Well I see that you have problems with F877 andmy code
I will try and re-try my code on an F877 to see what happens
I hope to find some time this week to try and find out what happens:))

srspinho
- 25th January 2005, 22:25
Hi People,

Alexandros, your help will be really apreciated.

Well, in the link below, there's some explanation about on how to connect the nokia display to the pc's printer port in order to show Winamp's information.
I Know that it'is not what we want but there's some explanation about the different types of Nokia's LCD (8 and 9 Pins)

http://serdisplib.sourceforge.net/ser/pcd8544.html

And for those who can read and/or undestand spanish, the link bellow show how to connect a Pic to a COLOR nokia's LCD (Epson Controller). The code is in Pic CCS.

http://www.comunicom.com.py/juno/3595/

The link bellow is the original code used by the spanish guy above and his page is in English (source code in HiTec C)

http://67.15.78.55/~spiral/colorlcd/colorlcd.html


My idea is get the monochrome working first and change the code and work with the color version.
The Nokia's LCD are getting cheap, even the color modules, and I think they could be a very good option for some projects, like meters and machine monitors as we can buy them for a good price and every cell phone service store havem them to sell. In other hand, graphical displays are not very easy and, sometimes, expansive.

My best regards to all

Sérgio Pinheiro (Brazil)

stu746
- 26th January 2005, 11:12
Woohooo!!!

got it workin at last with a 6110 lcd

it was just the contrast setting in the code!

i had tried changing it ealier, but i changed the last number only

i now have it set at d1 and works great

it now reads

SHiftOUT Lcd_SDA , Lcd_CLK , MSBFIRST, [ $21,$d1,$20 ]

i hope this is some help to others as it was driving me nuts :)

i used a 16f877a in the end and also used 4.5v, so 3.3 is not required.

Stu

srspinho
- 26th January 2005, 14:15
Hi Stu,

Nice tip !

I ´ll try this tonight.

thank you.

Sérgio Pinheiro

stu746
- 26th January 2005, 14:40
just tried with a display from a 3310 again and worked great with the contrast changed :)

bitmaniac
- 26th January 2005, 17:56
Hi! Guys
I have just finished verifying my code with 16f648 and works Fine!
I was just about to mention to check lcd initilization, contrast, etc but you have already found it by yourself so.... ALL is FINE!

I hope you have success make it work with F877
Nokia lcds is a perfect option for projects.
Also download Nokia lcd pdf it will be very useful for seting differnet parameters to lcd

I am here for any help.
:)

srspinho
- 27th January 2005, 01:26
Hi Guys,

I changed the contrast value and guess what....

It is working ! ! !

thank you Alexandros and Stu

soon I will try a color display, and if I get it working fine I will let you know here in the forum

Just one more thiing : Have you ever faced problems with Pic's in a protoboard ?

I just can not make it working. It seems to have some parasite capacitancce between the holes.
I had to move the project to a experimental PCB and make all the soldering.

Thank you again

Sérgio Pinheiro

mister_e
- 27th January 2005, 02:05
at wich frequency??? 20MHZ, on protoboard it's a common problem due to the capacitance of your protoboard. In many case, you can simply remove the capacitor around your crystal. and the problem will be fix .... on proto only.

Monitoring your crystal oscillation amplitude with/without capacitor with a scope (10X probe or bigger) will teach you more.

Also you must add 0.1uF and 10uF tantalum, close to your PIC.

srspinho
- 1st February 2005, 09:26
Hi Steve,

thank you for your advice.

I`ve moved my circuit from the ProtoBoard to a PCB (universal one, with isolated holes), reduced the crystal speed to 10 Mhz and now, everything is soldered.
Just the power supply lines are a bit long (I´m using a regulated 5 V Power supply).

I still have problems to make the 16F877-20 and the 16F877A working. I have to touch the PIC with my fingers many, many times to make it working ! ! ! really strange...

I tried to substitute the crystal for a ressonator too... but I got the same problem...

Is there another option rahter than the Tantalum Caps ?

Is this problem related to the Power supply or to the Crystal Speed ? (maybe both ?)

Thanks

Sérgio Pinheiro

rastan
- 1st February 2005, 14:36
Originally posted by srspinho


I still have problems to make the 16F877-20 and the 16F877A working. I have to touch the PIC with my fingers many, many times to make it working ! ! ! really strange...



Hi, just noticed this, I had many problems all over the place to do with touching the pic to make it work, with serial comms, LCD etc etc.

It turned out that i did not connect MCLRE. it was floating. so it never worked untill my static charge from my fingers pulled the pin high. Also check that other main pins arnt floating. (by main i mean not output/input pins.)

capacitors from +V to Ground near the pic also help. They basically filter out noise from the powerline/regulator. 100nf usually do the trick

:)

phil

srspinho
- 1st February 2005, 16:16
Hi Phil,

thank you for your tips.

I will try them tonight

Regards.

Sérgio Pinheiro

srspinho
- 16th February 2005, 14:34
Hi everyone !

after some good results working with the nokia LCD, I decided to wite a routine in order to draw an small histogram in the Nokia´s LCD.
But, after reading the PCD8544´s datasheet, i discovered that the LCD doesn´t have a direct mode wich allow us to draw on it pixel by pixel, and when we need to set a single pixel, we need to know its other 7 neighbour pixels.
Is taht right ?

Do I need to read the memory first and make some logical operation with the bits to draw what I want ?

Have someone developped a routine to draw lines (for example) on this LCD ?

thank tou

Tim B
- 16th February 2005, 21:43
PCD8544 will not let you read the screen so the best you will ever be able to do is keep a copy of the screen in the PIC's ram and then dump the whole screen to it at once. The data rate to these devices is slow though so you will not want to do it often.

ice
- 29th June 2005, 12:50
Hello,
I am trying to interface the Nokia 3310 LCD to a PIC16F876A.

Im using bitmaniacs schematic/code
Im running on a 16Mhz crystal.

I tried everything possible mentioned in the last posts
change the contrast from $a7 to $d1

Theres no response on the LCD..doesnt even turn dark..

Is there anything im missing out.
Thank you

NavMicroSystems
- 29th June 2005, 13:51
ice,

attached is a working piece of code to play with.
(Tested on a 16F877A)

ice
- 30th June 2005, 07:51
Thank you Nav,
but it still shows no response..i tried it with 2 displays with the circuit as in bitmaniac's

are there any other values ,other than $d1 which i can use to adjust contrast?

Ive tried changing sll the other parameters like bias,temperature coeff..

Regards,

NavMicroSystems
- 30th June 2005, 13:14
ice,

the code example is tested and working.

There must be something wrong in your Hardware.

could you post your schematic?

ice
- 30th June 2005, 15:01
Nav..
It's the same schema as bitmaniac had given..(18th sep 2004)

I redid the connections according to the program u gave..

the schematic is attached

Thanks!

pcapelo
- 30th June 2005, 18:26
Hello friends, excuseme for my english, it's not my language...

It's so interesting to drive nokia LCD's, but i have questions:

1) The nokia LCD has an internal controller, or are you controlling directly the crystal display???
2) If in the fact it have a controller, where can i find information about how to drive my LCD. I have LCDs of nokia 8260, nokia 5120, nokia 6120... there are TDMA cell phones and I don't know what type of LCD they have.

Help me please

Thanks

Patricio Capelo
[email protected]
Cuenca - Ecudor

NavMicroSystems
- 30th June 2005, 19:48
ice,

please doublecheck your hardware setup.

I have only a small 100nF cap on Pin 7 (VOUT)
and Pin 5 (SCE) is directly tied to GND.

NavMicroSystems
- 30th June 2005, 19:54
...where can i find information about how to drive my LCD.
Help me please


All Information you need can be found on this thread.
Check the links and attachment posted here.
and see: THIS (http://www.picbasic.co.uk/forum/showpost.php?p=8765&postcount=2)

ice
- 2nd July 2005, 07:28
Nav,
I got ur code to work on a 873A.. i can move the cursor position to any place on the screen ..however,the digits which have to be displaying are all boxed..but i can notice the numbers changing...also the display keeps flickering..
I tried changing the init value in ur code too...but i cant seem to find the optimal ones..

Thanks alot

NavMicroSystems
- 2nd July 2005, 23:41
ice,

to be honest, the code is not mine,
it's is more a combination if things I have cut and pasted
for testing purposes.

I'll have a deeper look into it when I find time.

BTW.
I'm running the LCD @ 3.3V!

pcapelo
- 3rd July 2005, 04:23
All Information you need can be found on this thread.
Check the links and attachment posted here.
and see: THIS (http://www.picbasic.co.uk/forum/showpost.php?p=8765&postcount=2)


Thanks so much for your help, but I need more help...

I'm talking about the specific models of LCDs that you can found in nokia TDMA cell phones: Nokia 8260,Nokia 5120, Nokia 3320...

I seen the photos of the projects and i can see some diferences with my own LCDs, so my question is if your LCDs have an integrated controller or are you driving directly the crystal display, without an LCD's internal controller that can have communication with the external PIC micro?

Thanks again...

NavMicroSystems
- 3rd July 2005, 13:23
ok, here are some links:

http://serdisplib.sourceforge.net/ser/pcd8544.html
http://sandiding.tripod.com/lcd.html
http://67.15.78.55/~spiral/colorlcd/colorlcd.html
http://nokiaport.de/pinouts/pinouts.htm

most of the monochrome NOKIA LCDs have an embedded PCD8544 controller (PHILIPS)

If you google for NOKIA LCD you'll find many more.

NavMicroSystems
- 3rd July 2005, 16:28
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

crematory
- 2nd August 2005, 04:57
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

NavMicroSystems
- 2nd August 2005, 11:12
Crematory,

Pleas read this thread from the beginning.
There are several code examples and linlt to DataSheets etc.

pcbb
- 9th December 2006, 15:28
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

mister_e
- 9th December 2006, 20:29
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/showpost.php?p=10237&postcount=40

pcbb
- 9th December 2006, 22:29
Thanks for your tip. Lcd is working. :)

skimask
- 29th December 2006, 01:35
Thanks for your tip. Lcd is working. :)

This wouldn't be the practically the same LCD as the one found at Sparkfun is it?
http://www.sparkfun.com/commerce/product_info.php?products_id=569#

amro
- 2nd January 2007, 19:26
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 ?

pcbb
- 31st January 2007, 18:08
Have you 3310 lcd library for isis ?

pcbb
- 7th February 2007, 10:59
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 :pause 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,$0,$0,$0,$30,$7C,$C4,$86,$86,$86,$86,$4,$ 4,$0,$0,$C,$84,$86,$86,$86,$C6,$C4,$FC,$F0,$0,$0,$ 0,$FE,$FE,$8,$4,$6,$6,$6,$FC,$F8,$8,$4,$6,$6,$6,$F 0,$0,$0,$0,$FE,$FE,$8,$4,$4,$6,$6,$4,$C,$F8,$E0,$0 ,$0,$FF,$FF,$0,$0,$C0,$F8,$CC,$C4,$C6,$C6,$C6,$C4, $CC,$F8,$E0,$0,$0,$0,$0,$0,$0,$0,$0,$0,
DATA $0,$0,$0,$0,$0,$0,$18,$10,$30,$30,$30,$30,$11,$1F, $6,$0,$6,$1F,$11,$30,$30,$10,$10,$8,$3F,$3F,$0,$0, $0,$3F,$3F,$0,$0,$0,$0,$0,$3F,$3F,$0,$0,$0,$0,$0,$ 3F,$0,$0,$0,$FF,$FF,$10,$10,$30,$30,$30,$10,$18,$F ,$1,$0,$0,$3F,$3F,$0,$0,$1,$F,$18,$10,$10,$30,$30, $30,$10,$10,$18,$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,$7,$7,$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,$0,$0,$0,$0,$0,$0,$0 ,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$ 0,
;

bitmaniac
- 7th February 2007, 14:16
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.

pcbb
- 7th February 2007, 14:59
i wait your message back. Thanks for interest.

pcbb
- 9th February 2007, 00:31
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 ?

bitmaniac
- 9th February 2007, 13:40
I didn't manage yet to visit my lab (upstairs) to compile and try my code for you !
I hope this weekend :)

shahidali55
- 1st May 2007, 17:02
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.

shahidali55
- 5th May 2007, 17:26
bitmaniac,
Where do i have to place the data generated by the matrix program ???

Russian
- 11th May 2007, 22:24
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

skimask
- 11th May 2007, 22:30
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?

Well, since we can't see the program that you wrote and the problem that it entails, I can only speculate the problem is that you haven't changed the oil in your automobile or rotated the air in your tires yet this year.
Post some code!

Russian
- 11th May 2007, 22:41
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

skimask
- 11th May 2007, 22:54
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.

Russian
- 11th May 2007, 23:15
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.

skimask
- 11th May 2007, 23:21
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.

Look at the very top of this webpage, roughly 3 lines down, left side of the screen, and tell me what you see.

Russian
- 11th May 2007, 23:27
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".

skimask
- 11th May 2007, 23:32
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".

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.

mister_e
- 11th May 2007, 23:36
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

skimask
- 11th May 2007, 23:44
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

Awwwwww.....I was having fun too! :D

Russian
- 11th May 2007, 23:45
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..

mister_e
- 12th May 2007, 00:06
Syntax are slightly different... but both are named PICBASIC, hence the confusion. Don't worry about that ;)

babatundeawe
- 26th May 2007, 14:59
hi guys, pls i need help on interfacing a game boyGLCD to PIC16F877.
thanks in anticipation

shahidali55
- 27th May 2007, 10:02
How can i make this in PicBasic Pro ?
http://free-vz.htnet.hr/Ivica-Novakovic/Nokia%20Lcd%20Termometar-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.

Ioannis
- 27th May 2007, 12:15
Here it is.

Ioannis

P.S. And a bonus zip with other examples!

Ioannis
- 27th May 2007, 12:18
Sorry forgot the original!

Ioannis

GioppY
- 28th May 2007, 09:30
Very nice.
Me too i'm playng with this display.
Regards
Gianni

shahidali55
- 28th May 2007, 18:07
Wow cool. Thanks Ioannis.
I'll modify the code to work with DS1820 and see if it works...
Thanks Again . . .

shahidali55
- 25th September 2007, 17:22
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...

Ioannis
- 25th September 2007, 21:00
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

shahidali55
- 1st October 2007, 17:51
I think predznak = sign
What does "Bitovi" represent ???

mister_e
- 1st October 2007, 18:03
Assuming it 'could be' Croatian, i think it mean 'Bit' or 'Digit'

well...
http://www.eudict.com/?lang=croeng&word=bitovi&submit=Search

Ioannis
- 1st October 2007, 19:39
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

Emil G
- 2nd October 2007, 21:37
Predznak = prefix like - or +
Bitovi are bits (flags)

Emil

Gusse
- 10th December 2007, 11:11
Hi bitmaniac & all,

I used bitmaniac's matrix.zip files to wake up my LCD with 16F876A and wake up was success :)

Then I tried to add some new characters to EEPROM area (DATA), but EEPROM is quite limited. I made some modifications to (Lcd_SentChar, attachement) and removed all character from EEPROM area. Now I have both A-Z and a-z characters available, working fine :)

Also I added some extended ASCII codes, like Ä,Ö,ä,ö but then I noticed problems? It seems that LOOKUP cannot handle extended ASCII codes? Error message was: Argument out of range. Least signficant bits used and there was no exteded ASCII on LCD

LOOKUP2 didn't give any errors, but no extended ASCII characters on LCD.

Can somebody help, how to show extended ASCII with LOOKUP command?

HJota
- 22nd April 2008, 02:29
I hall

I know it's not very new, but I think is interesting.
This program receive text information true rs232, display in a Nokia 3310 LCD capital and small letters, display 3 sizes off characters, variable and fixes size of characters, normal and inverted screen and character.

I've test the program connecting the Tx of my Pc tru a 74ls04 and it works greatly with 3.3 v

Have a nice time!

shahidali55
- 28th April 2008, 14:36
Hi HJota,
Can you provide me the schematic you are using ?

HJota
- 29th April 2008, 14:56
Shahidali55

You can trie my (not finish) web page, were I have all he information about this project.
If you have any douts please tell me.

Hope it helps you a little.


http://pwp.netcabo.pt/hjota/

(Soon I will publisgh the PCB picture)

theguru56
- 3rd June 2008, 18:23
Hi,

can someone pls post simple 3310 lcd example, where i can only put a pixel on my screen. i dont need code where i can display characters, pictures etc. Just as simple and compact as possible.

Thank you...

skimask
- 3rd June 2008, 19:15
can someone pls post simple 3310 lcd example
http://www.picbasic.co.uk/forum/showthread.php?t=327
Simple examples all over...

theguru56
- 3rd June 2008, 21:01
But i'm newby to ccs c and i am not able to translate given code into basic.,...,

skimask
- 3rd June 2008, 21:11
But i'm newby to ccs c and i am not able to translate given code into basic.,...,
If you'd apply yourself, do a little bit of reading/looking/etc, you might (or might not) notice that not ALL of the code in the 80-odd posts is written in C.

theguru56
- 5th June 2008, 15:54
Ok, past few days i have been playing with different code examples and came to solution which is attached below (proov.zip). This code works fine on small pics (like 12f629, 12f675) but wont work on bigger pics (16f627/8), Can someone pls give me clue whats worng in that code.

skimask
- 5th June 2008, 16:06
Ok, past few days i have been playing with different code examples and came to solution which is attached below (proov.zip). This code works fine on small pics (like 12f629, 12f675) but wont work on bigger pics (16f627/8), Can someone pls give me clue whats worng in that code.

What's wrong with the code?
1 - It'll never compile in PicBasicPro. Not today, not tomorrow, not ever.
2 - It (the .bas, the includes, everything about it) it written for a 12F, not for the 16F series.
3 - You're in the wrong place. Most likely www.picbasic.org is what you really want. Since this (http://www.picbasic.org/forum/showthread.php?t=8603&highlight=nokia+3310) is where you got the code in the first place.

theguru56
- 5th June 2008, 16:52
Ok, ill try there.

szovertoplcd
- 12th July 2008, 10:42
If you try to get the datasheets, I suggest you following datasheets center:

www.pdfsea.com

Gusse
- 13th February 2009, 23:25
I don't know how many is still using old (monochrome) Nokia LCD displays, but I do.

To make it easier to write code for both 3310 LCD (PDC8544) or variants (Nokia 8210...) and 7110 LCD (SED1565), I made a common command library for both LCD types. So you can use same commands in your program and only change display and link right library file (see attachement for more info). Of cource there are more pixels in 7110 and therefore you must do some fine tuning for character/picture positions, but anyway it will work with a minimum effort. At least I hope so.

I use this by including it to main program

'----- LCD Setup -----
include "LCD_3310.pbp"
or

'----- LCD Setup -----
include "LCD_7110.pbp"

Most of the code is already posted here earlier (BIG thanks for that!), something is modified and something new.

-Gusse-

douglas.mauro
- 16th March 2009, 17:57
Just what I was looking for, thanks!

Questions:

(1) How do you recommend writing entire words "Hello World...". Do we really have to loop through every letter? Would be nice to issue a Lcd_Send_This("Hello World")

(2) Do you use a large LOOKUP table or CASE for A-Z ??

Right now I have a LOOKDOWN table for A-Z that gets the position and then uses that num*6 to LOOKUP the bits in my huge table (no eeprom here).

(thoughts) Looking ahead I worry about not being able to use a VAR in LOOKUP. In the end, isn't that what I really want to display?

Thanks again.

Gusse
- 17th March 2009, 08:46
(1) How do you recommend writing entire words "Hello World...". Do we really have to loop through every letter? Would be nice to issue a Lcd_Send_This("Hello World")

Check page 22 from Philips PCD8544 datasheet (http://www.nxp.com/acrobat/datasheets/PCD8544_1.pdf). It shows how characters are formed to LCD. If you are using 8x6 pixel fonts then you have to do 6 write operations (each of 6 column separately). This can be combined to one loop, so it writes one character or graphics at the same time. Yes, You have to loop through every letter.


(2) Do you use a large LOOKUP table or CASE for A-Z ??

Right now I have a LOOKDOWN table for A-Z that gets the position and then uses that num*6 to LOOKUP the bits in my huge table (no eeprom here).

(thoughts) Looking ahead I worry about not being able to use a VAR in LOOKUP. In the end, isn't that what I really want to display?

Thanks again.
LOOKUP table or CASE are good options, even IF - THEN can be used. I have tried all of them, now using LOOKUP2. If you don't need all alphabets then some limited table or direct data to LCD can be an option. With direct data I mean that you make characters like a graphics, turning on/off DB7:0 data bits.
In case you need A-Z and a-z then LOOKUP or CASE needs twice more space. Then external EEPROM becomes very handy.

BR,
-Gusse-

fratello
- 12th April 2009, 12:13
Hi to all !
I use the hardware from here : http://www.picbasic.co.uk/forum/showthread.php?t=8800&highlight=nokia+3310+display.
I try to modify the code of N3310+PIC 12F675+DS18B20 for using PIC 16F628A, like in attachament. But...nothing on display ! Can someone tell me what I do wrong ? Thanks in advance !

GioppY
- 12th April 2009, 22:45
Hi!
If you followed my schematic exactly, try the attached code.
It works fine for me.
Notice : Cs (PortB.3) must be Low ; Rst(PortA.4) needs a pullup ; Mode is disabled (you need another pin)
Regards
Gianni

fratello
- 13th April 2009, 12:59
You are one Gentleman ! Thank You verry much ! It's work fine now ! :D

fratello
- 14th April 2009, 09:03
Hi again ! I try to build one simple thermometer, based on schematic from GioppY and code from Ivica N., but with this code (attached) I see only some points, all over the display, and '85.0'. Some sugesstion ? What I do wrong ? Thanks in advance !

Gusse
- 14th April 2009, 10:08
Hi again ! I try to build one simple thermometer, based on schematic from GioppY and code from Ivica N., but with this code (attached) I see only some points, all over the display, and '85.0'. Some sugesstion ? What I do wrong ? Thanks in advance !

Try to clear the LCD, that should help. See my post (#95) couple of replies above for more info about LCD commands.

Do you want to measure temperature more than once? At least there is no loop back to Main. Also I have noticed that DS18B20 gives 85 degrees for some time at the first start (when powered). This might be the reason why you see 85 and some some dots on your screen.

BR,
-Gusse-

fratello
- 14th April 2009, 18:44
Using the command "goto main" I have some results ; now the display show the correct temperature...but still remains some 'points'... (see foto). I try different code for LCD_Clear, but not results... Please, help me more ! Thanks in advance !

Gusse
- 14th April 2009, 19:55
Using the command "goto main" I have some results ; now the display show the correct temperature...but still remains some 'points'... (see foto). I try different code for LCD_Clear, but not results... Please, help me more ! Thanks in advance !

Could you post your entire code here? At least I did not see where you write "TEMP:" to screen. Also at which point you do your LCD clear routine. Problem might be in that code area...
At least you managed to get DS18B20 to work. That's positive!

BR,
-Gusse-

fratello
- 14th April 2009, 20:18
Sorry...mea culpa ! This is the full code !

Gusse
- 14th April 2009, 20:46
Sorry...mea culpa ! This is the full code !

You are not using "LCD_Clear:" routine anywhere, so you are not clearing the LCD at any phase.

Add this before "Main:"

call LCD_Clear

If that doesn't help, try to replace manual LCD write commands with SHIFTOUT. Similar what you have in "LCD_ByteOut:"

BR,
-Gusse-

Gusse
- 14th April 2009, 20:58
I meant this (below) instead of "CALL"

GOSUB LCD_Clear

Why you are using CALL, shouldn't those be GOSUB instead?

BR,
-Gusse-

fratello
- 14th April 2009, 21:37
YES !!!! That work ! THANK YOU !
I have learning again one more thing. Thanks to You, all members of this great forum. I'm happy !
Now, I want to make the next step : "up-grading" the schematic from here - http://www.picbasic.co.uk/forum/showpost.php?p=68967&postcount=35 for using with N3310 display. I will keep You on line ! All the best !

fratello
- 15th April 2009, 18:30
Now my project it is in this stage - see photo 1. I ask -again, sorry ! - for help : how to make like in photo 2 ? I do not understand how 'advanced' to next line (I think because of my poor english... :( ). I read the N3310 display .pdf and many examples, but still don't understand... Can somebody explain to me, please ?

Gusse
- 15th April 2009, 20:36
Now my project it is in this stage - see photo 1. I ask -again, sorry ! - for help : how to make like in photo 2 ? I do not understand how 'advanced' to next line (I think because of my poor english... :( ). I read the N3310 display .pdf and many examples, but still don't understand... Can somebody explain to me, please ?

You want to have "Temp:" on Row0 and temperature reading on Row1? If this is the case then I recommend to use library from post #95.
This is how you can move positions on screen.

PosX=[X-axis pos]:PosY=[Y-axis pos]:Gosub Lcd_GotoXY


1) Goto PosX=0 and Pos=0

PosX=0:PosY=0:Gosub Lcd_GotoXYThen add LCD write routines to display "Temp:"

2) calculate where you want to write on Row1.
X-axis
84 pixel, 6 pixel width per character = 16 character per line
Temp: -> 5 character -> 5 * 6 pixel = 30 (start pixel for temp reading)
PosX=30
Y-axis
48 pixel, 8 height per character = 6 character per column
1st row = 0, 2nd = 1, ... 6th = 5
PosY=1

PosX=30:PosY=1:Gosub Lcd_GotoXY
Then add LCD write routines to display temperature reading.


To take library into use, insert this to your code and save & unzip-file Nokia_LCD_3310_7110.zip to same directory (or mod path).

'----- LCD Setup -----
include "LCD_3310.pbp"

You might want to use also other library functions... it might easier your life...

BR,
-Gusse-

Gusse
- 15th April 2009, 20:47
Library file is in post #93, not #95. Sorry!
BTW, why I cannot modify/edit my own posts after pressing "Submit Reply" -button??

BR,
-Gusse-

fratello
- 16th April 2009, 07:09
Thank You ! ... I modifiy the code like in attachament, but now I have nothing on display :( ... After the line of code that I inserted it's need to put another's commands ? Only this single line it's not enough ?
( ..... Char = 18
call PrintChar

PosX=30 : PosY=1 : Gosub LCD_GotoXY

if TempH > 99 then
Char = 1
call PrintChar
else
Char = 10 ' + plus
if Predznak = 1 then Char = 11 ' - minus
call PrintChar
endif


Char = (temph dig 1)
call PrintChar

Char = (temph dig 0)
call PrintChar

Char = 12
call PrintChar

Char = (temperature dig 3)
Call PrintChar

goto main )

Gusse
- 16th April 2009, 08:39
Thank You ! ... I modifiy the code like in attachament, but now I have nothing on display :( ... After the line of code that I inserted it's need to put another's commands ? Only this single line it's not enough ?
( ..... Char = 18
call PrintChar

PosX=30 : PosY=1 : Gosub LCD_GotoXY

if TempH > 99 then
Char = 1
call PrintChar
else
Char = 10 ' + plus
if Predznak = 1 then Char = 11 ' - minus
call PrintChar
endif


Char = (temph dig 1)
call PrintChar

Char = (temph dig 0)
call PrintChar

Char = 12
call PrintChar

Char = (temperature dig 3)
Call PrintChar

goto main )

Please, take a look how I did with my accelerator demo application
Nokia LCD with 3D-accelerometer (http://www.picbasic.co.uk/forum/showpost.php?p=69216&postcount=10).
In this demo, I didn't use library file, but all relevant LCD routines are under "LCD stuff" section in the code (zip-file).

You can always copy content of library to your code, if you have problems with included files.

One line is enough, it is so simple :)

BR,
-Gusse-

JLbart
- 16th April 2009, 11:01
I found a SatNav software on ZorroGPS.com, Has anybody used this software?:D

fratello
- 16th April 2009, 12:05
With the code below I have the results like in photo ! Thank You all for Yours cooperation !
Note : The dual function of reading two sensors DS18B20 it is not yet ready !

fratello
- 16th April 2009, 15:12
Me again ! My thermometer with two sensors is ready !!!!! Works great !!!!!
Unfortunate I can't making one best looking for display ...I don't -yet- understand how to display 'graphical things'....One border mybe is necessary...Every improvement will be apreciated ! Thanks - again :) _ to all !
All the best ! (...and sorry for my poor english...)

Archangel
- 16th April 2009, 17:28
All the best ! (...and sorry for my poor english...)
Not so poor . . . Middle Class :), Project coming along nicely, hang in there, you're getting it.

fratello
- 17th April 2009, 13:20
I did it ! This is my final version ! I'm happy !!!
I wish You all the best !

mister_e
- 17th April 2009, 16:53
Good job!

Don't give up!

Gusse
- 17th April 2009, 21:33
Great! More Nokia LCD applications are always welcome :)
I have plenty of Nokia color LCD. Maybe that is next step... , but not soon...

BR,
-Gusse-

fratello
- 21st April 2009, 08:14
Hi to all !
Based on the code from here : http://www.picbasic.co.uk/forum/showpost.php?p=68967&postcount=35, I intend to use the Nokia-LCD for the thermostat; I attach the schematic. Please, help with TRISB,TRISA,PORTB,PORTA,OPTION_REG setting, because, even I read the datasheet, I don't understand why Mr.GioppY say :
TRISB = %11000010
TRISA= % 10100010
In the schematic I see : RB6,RB7 not used - why "1" ?
RA7 not used - why "1" ?


Can someone explain me ? Thanks in advance !

Ioannis
- 21st April 2009, 08:34
May be he used it for some tasks and forgot to make it Output (0).

So if you do not intent to use them, make it output. If you still want to keep it Input suggest to tie pull up or pull down resistors. Do not let any pin float.

Ioannis

ScaleRobotics
- 21st April 2009, 17:06
Here is an include file that has been modified from many peoples code in this thread, and Darrel's PrintStr function, for the nokia-3310. It allows for very simple printing to the LCD.

You can also print different things on the same line, by using the x, and y, positions.

example:


DEFINE OSC 48

include "modedefs.bas"
include "LCD_3310.pbp"
start:

@ PrintStr 0,0, "I love being"
@ PrintStr 0,1, "able to print "
@ PrintStr 0,2, "so easily!"

Gusse
- 22nd April 2009, 07:42
Very nice! Now printing to Nokia LCD is definitely easier. :D
Thank You and Darrel!

fratello
- 24th April 2009, 17:36
Hi again !
Based on the schematic from post #119 I wrote the code from the thermostat ; but nothing happening when I push button on pin 7, or 8, or 9. I know that something is wrong, but I need help...Thanks in advance for every reply !

ScaleRobotics
- 25th April 2009, 04:38
Hello fratello,

Can you tell us if there are any parts that do work? It is always easier to trouble shoot if you know where to start.

Like:
Can it blink an LED, or are we unsure if it is even starting up?
Does it print to the LCD, and just not give you the temperature, or is the LCD blank?

fratello
- 25th April 2009, 06:43
Thanks for reply !
The display show like in picture from post #116. But pushing the buttons '+' , '-' or 'Mode' has no effect.

ScaleRobotics
- 25th April 2009, 17:01
Hello Fratello,

I have been looking over your code for a while now. I have not found anything obvious to me, although there may be something obvious to others.

One thing I did notice, is that your MainLoop will cycle through modes 0, 1, and 2, even without any buttons being pressed. This is fine, but one thing you are doing in mode 2, and after mode 2, is writing to the eeprom. At 4 mhz, you will reach that 1,000,000 write cycles quicker than you think (have not calculated it, but if this is really going to be a thermostat, I assume it is going to be running for a while). A better way to do it would be to only write the targettemp, etc to the eeprom when targettemp is different than the eeprom value for targettemp (ie, it has been adjusted).

Seems like the next step is to see if the 16f628a even knows if the buttons have been pressed. Why not make a simple light an LED line inside some of your if then statements to verify the chip knows a button has been pressed? This could help point to the source of the problem.

Walter

fratello
- 25th April 2009, 18:17
The code works PERFECT with LCD 2x16...I just try to insert the parts for Nokia display...(and removing, of course, the parts for other display). I think the problems are generated by wrong 'substitution'. Thanks anyway for reply !

ScaleRobotics
- 25th April 2009, 18:38
That's great! If it is working perfectly with the 2 x 16 lcd, you should be seeing the new changed values in your eeprom. This should be an indication that only your LCD_3310 code is bad, and that the thermostat functions are working!

Archangel
- 25th April 2009, 18:53
Hi fratello, Do you have pullup resistors on those switches ? You do not have WPU enabled, so you need them, or change the Option_Reg, to enable them.

fratello
- 26th April 2009, 14:10
Me again !
I found the mistake ; after MainLoop the code must be :
If PortB.3=0 then ; this is the missing line
If PortB.3=0 then MainLoop
...
...
Endif
Endif

Work correct on pushing MODE button , but...
Now I have another problem... I attach the code for display the temperature in both cases (LCD 2X16 ; N3310).
How do I convert this line :
LcdOut $FE, $C0, "OUT ", Sign, DEC (Temperature2 / 100), ".", DEC2 Temperature2, " ",223,"C "
for correct results on Nokia display ?
DEC (Temperature2 /100) it's what char ?
DEC2 Temperature2 it's what char ?
I try many codes but on display appears numbers and strange characters....
Thanks !

ScaleRobotics
- 26th April 2009, 16:11
How do I convert this line :
LcdOut $FE, $C0, "OUT ", Sign, DEC (Temperature2 / 100), ".", DEC2 Temperature2, " ",223,"C "
for correct results on Nokia display ?
DEC (Temperature2 /100) it's what char ?
DEC2 Temperature2 it's what char ?


Here I am assuming that at 25.1 degrees c , Temperature2 = 2510
On yours, it looks like it would be:


char = (Temperature2 dig 3) + 2 'get digit 3 ("2"510) and add 2 so it matches eeprom
move x y to right location and print it 'do whatever you do to print to lcd
char = (Temperature2 dig 2) + 2 'get digit 2 (2"5"10) and add 2
move x y to right location and print it
char = 14 'in you eeprom this is a "."
move x y to right location and print it
char = (Temperature2 dig 1) + 2 'get digit 1 (25"1"0) and add 2
move x y to right location and print it


But I thought from your picture in post #116 that you were printing temperature already?
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3335&stc=1&thumb=1&d=1239970805
Now I am confused again...

I now see that your change to MainLoop fixes the write to eeprom every cycle problem too. Very nice.

fratello
- 26th April 2009, 18:02
THANK YOU ! And THANK YOU ALL !
It's work ! Yes !!!!!! I'm -once again, thanks to you, all- happy !
This is the 1.0 version of code for dual zone & thermostat with Nokia 3310 display ! All the best to all !

fratello
- 27th April 2009, 16:01
Version 2. Some minors but necessary modifications. Tested - function of thermostat work fine. Not tested for negative temperatures...

fratello
- 27th April 2009, 20:11
Tested with negative temperatures; bug fixed !
I can't - insuficient memory ! - using design like in post #116 (borders & author name). How to free memory ? I think the code can be optimized...

Archangel
- 27th April 2009, 22:03
Tested with negative temperatures; bug fixed !
I can't - insuficient memory ! - using design like in post #116 (borders & author name). How to free memory ? I think the code can be optimized...
Easiest way . . . Use 16f648A, then you have room to stretch your legs.

ScaleRobotics
- 28th April 2009, 01:15
Agreed, to upgrade to bigger chip is probably the best way.
If you just need to try a little more room, you could try taking out your graphics:

cut out:


BorderLine:
'=================================== UP
LcdReg = %10000000 ' cursor X
call PrintCtrlLcd
LcdReg = %01000000 ' cursor Y
call PrintCtrlLcd
for y = 0 to 73
LOokup y, [$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$3F,$3F,$2 1,$21,$3F,$1E,$00,$3F,$3F,$00,_
$1E,$3F,$21,$29,$3B,$1A,$00,$3F,$3F,$00,_
$01,$01,$3F,$3F,$01,$01,$00,$3E,$3F,$09,$09,$3F,$3 E,$00,_
$3F,$3F,$20,$20,$20,_
$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,_
$18,$27,$27,$18,$00,$00,$00,$00,$06,$06,_
$00,$1E,$3F,$21,$21] ,LcdReg

' for y = 0 to 83
' LOokup y, [$01,$01,$01,$01,$01,$01,$01,$01,_
' $01,$01,$01,$01,$01,$01,$7F,$7F,$43,$43,$7F,$3D,$0 1,$7F,$7F,$01,_ 'DI
' $3D,$7F,$43,$53,$77,$35,$01,$7F,$7F,$01,$03,$03,$7 F,$7F,$03,$03,$01,_ 'GIT
' $7D,$7F,$13,$13,$7F,$7D,$01,$7F,$7F,$41,$41,$41,$0 1,$01,$01,$01,$01,_ 'AL
' $01,$01,$01,$31,$4F,$4F,$31,$01,$01,$01,$0D,$0D,$0 1,$3D,$7F,$43,$43,$43,_
' $01,$01,$01,$01,$01,$01,$01,01] ,LcdReg

call PrintDataLcd
next y


'=================================== DOWN
' LcdReg = %10000000 ' cursor X
' call PrintCtrlLcd
' LcdReg = %01000101 ' cursor Y
' call PrintCtrlLcd
' for y = 0 to 83
' LOokup y, [$80,$80,$80,$80,$80,$80,$FE,$CA,$CA,$B4,$80,$8E,$D 0,$D0,$BE,_ 'BY
' $80,$80,$80,$80,$FE,$88,$90,$FE,$80,$FE,$80,$BC,$C 2,$C2,$A4,_ 'NIC
' $80,$BE,$C0,$C0,$BE,$80,$FE,$C0,$C0,$C0,$80,$FE,$C A,$CA,$C2,_ 'ULE
' $80,$A4,$CA,$CA,$B0,$80,$BC,$C2,$C2,$A4,$80,$BE,$C 0,$C0,$BE,_ 'SCU
' $80,$80,$80,$80,$FE,$C2,$C2,$BC,$80,$FC,$92,$92,$F C,$80,$FE,_ 'DAN
' $88,$90,$FE,$80,$80,$80,$80,$80,$80] ,LcdReg
'
' call PrintDataLcd
' next y
return

'=================================== end of BorderLine

ScaleRobotics
- 28th April 2009, 06:54
Ok, the printing a variable solution:


PosX = 0 'position 0 of 84 in the x direction
PosY = 0 'row 0 (of 0-5)
gosub Lcd_GotoXY
Lcd_Data = (result dig 3) + 48
gosub Lcd_SendChar

PosX = 6 'position 6 of 84 in the x direction
PosY = 0 'row 0 (of 0-5)
gosub Lcd_GotoXY
Lcd_Data = (result dig 2)+ 48
gosub Lcd_SendChar

PosX = 12 'position 12 of 84 in the x direction
PosY = 0 'row 0 (of 0-5)
gosub Lcd_GotoXY
Lcd_Data = (result dig 1) + 48
gosub Lcd_SendChar

PosX = 18 'position 18 of 84 in the x direction
PosY = 0 'row 0 (of 0-5)
gosub Lcd_GotoXY
Lcd_Data = (result dig 0) + 48
gosub Lcd_SendChar


got a little old. So I managed to write my first macro. It lets you do the above with a two liner:



VarData = 12345 'load the variable with desired number
@ PrintVar 0,0 'print the variable VarData, starting at the desired location 0,0


The code does the rest, and moves to the next position to print the next digit, until done.
I also edited the PrintStr function to scroll to the next line when it runs past the end of the current line.



@ PrintStr 0,0, "If I write more than one line, it will scroll to the next one, and next."


It runs on an 18f67j50. Not sure if it would run on a 16f or not.

mvs_sarma
- 28th April 2009, 07:19
Tested with negative temperatures; bug fixed !
I can't - insuficient memory ! - using design like in post #116 (borders & author name). How to free memory ? I think the code can be optimized...

Hi Fratello,
I tried to compile the file you put here. It did not give any error to me like what you said. The resultant files are appended in the zip file for ready reference.

fratello
- 28th April 2009, 07:25
The code is full functionaly ! The graphics it's disable... If try to improve the way that "look" the display, it is no more space in memory...I think the solution it's to 'up-grade' to another PIC, with bigger memory !

mvs_sarma
- 29th April 2009, 03:52
The code is full functionaly ! The graphics it's disable... If try to improve the way that "look" the display, it is no more space in memory...I think the solution it's to 'up-grade' to another PIC, with bigger memory !
I feel if one could write straight in assembly language, it would be smaller, in size. my comments may not suite the site s it is meant for promoting BASIC

ScaleRobotics
- 4th May 2009, 16:53
I found out how to add variables to my macro, so now using the include file, you can print any variable to the lcd by using:

@ PrintVar x,y, _anyvariablehere

(instead of loading a specific variable , then using @ PrintVar that I had before). Small change, but I figured it might help someone.

Here is the segment of the macro that is part of the lcd_3310v31 include file (attached).


'@ PrintVar macro function
'format should look like this: @ PrintVar x,y, _anyvariable
ASM
PrintVar macro x, y, Variable ;input values from: @PrintVar 0,1, _any_variable
local OverVar
goto OverVar
OverVar
MOVE?CB x, _PosX ;move x from above statement to PosX
MOVE?CB y, _PosY ;move y from above statement to PosY
MOVE?WW Variable, _VarData ;move variable in statement to VarData
L?CALL _VariableOut ;call VariableOut function
endm
ENDASM

VariableOut:
@ bcf _digits
for n = 4 to 0 step -1 'cycles through all possible digts of number
Gosub Lcd_GotoXY 'place character at position PosX and PosY
Lcd_Data = (VarData dig n) + 48 'digit number n to character str format
if Lcd_data = 48 and digits = 0 then SkipChar 'skip if first char is 0
@ bsf _digits ;show that one character has been printed
gosub Lcd_SendChar 'print char to screen
PosX = PosX + 6 'next x position for character
SkipChar:
next n
return

Archangel
- 4th May 2009, 18:56
I feel if one could write straight in assembly language, it would be smaller, in size. my comments may not suite the site s it is meant for promoting BASICHi Sarma,
Certainly well written assembly code should use less space than assembly generated by a high level compiler, it all boils down to cost. If you live where the cost of living is very low and software engineers are paid little, assembly may be the correct path. If you live where everything costs way too much and software engineers start out at $50,000 and go way up from there, it becomes very difficult to recover that cost by saving $0.15 on the wholesale cost of the PIC. One other consideration in both instances, if the engineer uses the high level compiler, the time saved will be used to engineer more products. So IMHO, the way to achieve best overall results is High Level compiler WITH assembly assists, I E . . . Darrels Instant interrupts for example. As for your comments . . . Your comments are welcome here. We all benefit by sharing our Ideas and opinions, and we can keep them after sharing or adopt new ones, I believe it was Albert Einstein who said, " all knowledge is trial and error", which is to say the things you are taught are the result of somebody's mistakes.
Regards,
Joe S.

fratello
- 4th May 2009, 20:02
Hi to all !
Me again...with one new problem : I write the code attached, for 16F648A, because I want to display some graphics elements (see sus, rand 1, rand 2, rand 3, rand 4, jos) .But when I put the code in Microcode Studio I receive the message "Warn : Test_648.asm 790:[102] code crosses boundary @ 800h". I think the code it's too big; please give me some solution !!! I want that my display having one nice 'looking' and without the parts for graphics elements...What can I do ?
Thanks in advance !

ScaleRobotics
- 4th May 2009, 20:23
That is just a warning that you are crossing a boundary. All is good. How many bytes does it say you are using the lower left of microcode studio?

fratello
- 5th May 2009, 14:24
This is what MicroCode Studio say :

Gusse
- 5th May 2009, 14:55
This is what MicroCode Studio say :
Your code compiles OK (2932 words used). I don't understand what can be wrong with your setup? If you close and restart the MicroCode Studio, would that help? At least sometime that has helped me.

To get rid of "code crosses boundary" goto tool bar:

View -> Editor Options...
In General sheet, select "Disable 'code crosses boundary' ASM warning.

BR,
-Gusse-

mister_e
- 5th May 2009, 15:00
The first one is about your config fuse. intrc_osc should be replaced by

INTRC_OSC_NOCLKOUT
This one use the same config fuses as 16F628A & 16F627A. The complete list is in M16F62XA.inc file in pbp\inc folder.

The second one is just a warning,
http://picbasic.co.uk/forum/showthread.php?t=555&

Can be bypass within MicroCode Studio.
http://www.picbasic.co.uk/forum/showpost.php?p=46566&postcount=2

EDIT: Gusse, that's what happen when few people think the same thing at the same time ;)

Ioannis
- 5th May 2009, 15:20
Code is OK. May be you need a restart.

Steve, the define is OK. It exists this too!

Ioannis

fratello
- 5th May 2009, 16:06
OK ! Thanks ! I just wait for the 16F648A...

fratello
- 22nd May 2009, 09:14
I have the 648A. The code works just fine !
...but : I try to define anothers characters for display the temperature that I set ; the message is like in picture. How can I define anothers characters ?
Thanks in advance !

ScaleRobotics
- 22nd May 2009, 15:30
I found that I could add up to 6 more characters (30 more bytes) to your code without getting the same error. I don't know exactly why you are getting the stack overflow errors, but the eeprom space is very limited. Since you have so much more space with the 648a, you might think about storing all the character data in program memory. You would need to modify your code a little bit though. You can edit out the characters that you don't need to save a little space.



FC var byte [5]
Lcd_data var byte ' example Lcd_data = "I", gosub Lcd_SendChar , this will print the character "I"

Lcd_SendChar:
lookdown Lcd_data,[" !\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"],CharNum'[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"],CharNum
Lcd_data = CharNum +32
sELECT CASE lcd_data
Case 32
FC(0)=$00:FC(1)=$00:FC(2)=$00:FC(3)=$00:FC(4)=$00 ' // sp
Case 33
FC(0)=$00:FC(1)=$00:FC(2)=$2f:FC(3)=$00:FC(4)=$00 ' // !
Case 34
FC(0)=$00:FC(1)=$07:FC(2)=$00:FC(3)=$07:FC(4)=$00 ' // " (use \)
Case 35
FC(0)=$14:FC(1)=$7f:FC(2)=$14:FC(3)=$7f:FC(4)=$14 ' // #
Case 36
FC(0)=$24:FC(1)=$2a:FC(2)=$7f:FC(3)=$2a:FC(4)=$12 ' // $
Case 37
FC(0)=$c4:FC(1)=$c8:FC(2)=$10:FC(3)=$26:FC(4)=$46 ' // %
Case 38
FC(0)=$36:FC(1)=$49:FC(2)=$55:FC(3)=$22:FC(4)=$50 ' // &
Case 39
FC(0)=$00:FC(1)=$05:FC(2)=$03:FC(3)=$00:FC(4)=$00 ' // '
Case 40
FC(0)=$00:FC(1)=$1c:FC(2)=$22:FC(3)=$41:FC(4)=$00 ' // (
Case 41
FC(0)=$00:FC(1)=$41:FC(2)=$22:FC(3)=$1c:FC(4)=$00 ' // )
Case 42
FC(0)=$14:FC(1)=$08:FC(2)=$3E:FC(3)=$08:FC(4)=$14 ' // *
Case 43
FC(0)=$08:FC(1)=$08:FC(2)=$3E:FC(3)=$08:FC(4)=$08 ' // +
Case 44
FC(0)=$00:FC(1)=$00:FC(2)=$50:FC(3)=$30:FC(4)=$00 ' //
Case 45
FC(0)=$10:FC(1)=$10:FC(2)=$10:FC(3)=$10:FC(4)=$10 ' // -
Case 46
FC(0)=$00:FC(1)=$60:FC(2)=$60:FC(3)=$00:FC(4)=$00 ' // .
Case 47
FC(0)=$20:FC(1)=$10:FC(2)=$08:FC(3)=$04:FC(4)=$02 ' // /
Case 48
FC(0)=$3E:FC(1)=$51:FC(2)=$49:FC(3)=$45:FC(4)=$3E ' // 0
Case 49
FC(0)=$00:FC(1)=$42:FC(2)=$7F:FC(3)=$40:FC(4)=$00 ' // 1
Case 50
FC(0)=$42:FC(1)=$61:FC(2)=$51:FC(3)=$49:FC(4)=$46 ' // 2
Case 51
FC(0)=$21:FC(1)=$41:FC(2)=$45:FC(3)=$4B:FC(4)=$31 ' // 3
Case 52
FC(0)=$18:FC(1)=$14:FC(2)=$12:FC(3)=$7F:FC(4)=$10 ' // 4
Case 53
FC(0)=$27:FC(1)=$45:FC(2)=$45:FC(3)=$45:FC(4)=$39 ' // 5
Case 54
FC(0)=$3C:FC(1)=$4A:FC(2)=$49:FC(3)=$49:FC(4)=$30 ' // 6
Case 55
FC(0)=$01:FC(1)=$71:FC(2)=$09:FC(3)=$05:FC(4)=$03 ' // 7
Case 56
FC(0)=$36:FC(1)=$49:FC(2)=$49:FC(3)=$49:FC(4)=$36 ' // 8
Case 57
FC(0)=$06:FC(1)=$49:FC(2)=$49:FC(3)=$29:FC(4)=$1E ' // 9
Case 58
FC(0)=$00:FC(1)=$36:FC(2)=$36:FC(3)=$00:FC(4)=$00 ' // :
Case 59
FC(0)=$00:FC(1)=$56:FC(2)=$36:FC(3)=$00:FC(4)=$00 ' // ";"
Case 60
FC(0)=$08:FC(1)=$14:FC(2)=$22:FC(3)=$41:FC(4)=$00 ' // <
Case 61
FC(0)=$14:FC(1)=$14:FC(2)=$14:FC(3)=$14:FC(4)=$14 ' // =
Case 62
FC(0)=$00:FC(1)=$41:FC(2)=$22:FC(3)=$14:FC(4)=$08 ' // >
Case 63
FC(0)=$02:FC(1)=$01:FC(2)=$51:FC(3)=$09:FC(4)=$06 ' // ?
Case 64
FC(0)=$32:FC(1)=$49:FC(2)=$59:FC(3)=$51:FC(4)=$3E ' // @
Case 65
FC(0)=$7E:FC(1)=$11:FC(2)=$11:FC(3)=$11:FC(4)=$7E ' // A
Case 66
FC(0)=$7F:FC(1)=$49:FC(2)=$49:FC(3)=$49:FC(4)=$36 ' // B
Case 67
FC(0)=$3E:FC(1)=$41:FC(2)=$41:FC(3)=$41:FC(4)=$22 ' // C
Case 68
FC(0)=$7F:FC(1)=$41:FC(2)=$41:FC(3)=$22:FC(4)=$1C ' // D
Case 69
FC(0)=$7F:FC(1)=$49:FC(2)=$49:FC(3)=$49:FC(4)=$41 ' // E
Case 70
FC(0)=$7F:FC(1)=$09:FC(2)=$09:FC(3)=$09:FC(4)=$01 ' // F
Case 71
FC(0)=$3E:FC(1)=$41:FC(2)=$49:FC(3)=$49:FC(4)=$7A ' // G
Case 72
FC(0)=$7F:FC(1)=$08:FC(2)=$08:FC(3)=$08:FC(4)=$7F ' // H
Case 73
FC(0)=$00:FC(1)=$41:FC(2)=$7F:FC(3)=$41:FC(4)=$00 ' // I
Case 74
FC(0)=$20:FC(1)=$40:FC(2)=$41:FC(3)=$3F:FC(4)=$01 ' // J
Case 75
FC(0)=$7F:FC(1)=$08:FC(2)=$14:FC(3)=$22:FC(4)=$41 ' // K
Case 76
FC(0)=$7F:FC(1)=$40:FC(2)=$40:FC(3)=$40:FC(4)=$40 ' // L
Case 77
FC(0)=$7F:FC(1)=$02:FC(2)=$0C:FC(3)=$02:FC(4)=$7F ' // M
Case 78
FC(0)=$7F:FC(1)=$04:FC(2)=$08:FC(3)=$10:FC(4)=$7F ' // N
Case 79
FC(0)=$3E:FC(1)=$41:FC(2)=$41:FC(3)=$41:FC(4)=$3E ' // O
Case 80
FC(0)=$7F:FC(1)=$09:FC(2)=$09:FC(3)=$09:FC(4)=$06 ' // P
Case 81
FC(0)=$3E:FC(1)=$41:FC(2)=$51:FC(3)=$21:FC(4)=$5E ' // Q
Case 82
FC(0)=$7F:FC(1)=$09:FC(2)=$19:FC(3)=$29:FC(4)=$46 ' // R
Case 83
FC(0)=$46:FC(1)=$49:FC(2)=$49:FC(3)=$49:FC(4)=$31 ' // S
Case 84
FC(0)=$01:FC(1)=$01:FC(2)=$7F:FC(3)=$01:FC(4)=$01 ' // T
Case 85
FC(0)=$3F:FC(1)=$40:FC(2)=$40:FC(3)=$40:FC(4)=$3F ' // U
Case 86
FC(0)=$1F:FC(1)=$20:FC(2)=$40:FC(3)=$20:FC(4)=$1F ' // V
Case 87
FC(0)=$3F:FC(1)=$40:FC(2)=$38:FC(3)=$40:FC(4)=$3F ' // W
Case 88
FC(0)=$63:FC(1)=$14:FC(2)=$08:FC(3)=$14:FC(4)=$63 ' // X
Case 89
FC(0)=$07:FC(1)=$08:FC(2)=$70:FC(3)=$08:FC(4)=$07 ' // Y
Case 90
FC(0)=$61:FC(1)=$51:FC(2)=$49:FC(3)=$45:FC(4)=$43 ' // Z
' Case 91
' FC(0)=$00:FC(1)=$7F:FC(2)=$41:FC(3)=$41:FC(4)=$00 ' // [
' Case 92
' FC(0)=$02:FC(1)=$04:FC(2)=$08:FC(3)=$10:FC(4)=$20 ' // \ (we are using this for " above)
' Case 93
' FC(0)=$00:FC(1)=$41:FC(2)=$41:FC(3)=$7F:FC(4)=$00 ' // ]
' Case 94
' FC(0)=$04:FC(1)=$02:FC(2)=$01:FC(3)=$02:FC(4)=$04 ' // ^
' Case 95
' FC(0)=$40:FC(1)=$40:FC(2)=$40:FC(3)=$40:FC(4)=$40 ' // _
' Case 96
' FC(0)=$00:FC(1)=$01:FC(2)=$02:FC(3)=$04:FC(4)=$00 ' // '
' Case 97
' FC(0)=$20:FC(1)=$54:FC(2)=$54:FC(3)=$54:FC(4)=$78 ' // a
' Case 98
' FC(0)=$7F:FC(1)=$48:FC(2)=$44:FC(3)=$44:FC(4)=$38 ' // b
' Case 99
' FC(0)=$38:FC(1)=$44:FC(2)=$44:FC(3)=$44:FC(4)=$20 ' // c
' Case 100
' FC(0)=$38:FC(1)=$44:FC(2)=$44:FC(3)=$48:FC(4)=$7F ' // d
' Case 101
' FC(0)=$38:FC(1)=$54:FC(2)=$54:FC(3)=$54:FC(4)=$18 ' // e
' Case 102
' FC(0)=$08:FC(1)=$7E:FC(2)=$09:FC(3)=$01:FC(4)=$02 ' // f
' Case 103
' FC(0)=$0C:FC(1)=$52:FC(2)=$52:FC(3)=$52:FC(4)=$3E ' // g
' Case 104
' FC(0)=$7F:FC(1)=$08:FC(2)=$04:FC(3)=$04:FC(4)=$78 ' // h
' Case 105
' FC(0)=$00:FC(1)=$44:FC(2)=$7D:FC(3)=$40:FC(4)=$00 ' // i
' Case 106
' FC(0)=$20:FC(1)=$40:FC(2)=$44:FC(3)=$3D:FC(4)=$00 ' // j
' Case 107
' FC(0)=$7F:FC(1)=$10:FC(2)=$28:FC(3)=$44:FC(4)=$00 ' // k
' Case 108
' FC(0)=$00:FC(1)=$41:FC(2)=$7F:FC(3)=$40:FC(4)=$00 ' // l
' Case 109
' FC(0)=$7C:FC(1)=$04:FC(2)=$18:FC(3)=$04:FC(4)=$78 ' // m
' Case 110
' FC(0)=$7C:FC(1)=$08:FC(2)=$04:FC(3)=$04:FC(4)=$78 ' // n
' Case 111
' FC(0)=$38:FC(1)=$44:FC(2)=$44:FC(3)=$44:FC(4)=$38 ' // o
' Case 112
' FC(0)=$7C:FC(1)=$14:FC(2)=$14:FC(3)=$14:FC(4)=$08 ' // p
' Case 113
' FC(0)=$08:FC(1)=$14:FC(2)=$14:FC(3)=$18:FC(4)=$7C ' // q
' Case 114
' FC(0)=$7C:FC(1)=$08:FC(2)=$04:FC(3)=$04:FC(4)=$08 ' // r
' Case 115
' FC(0)=$48:FC(1)=$54:FC(2)=$54:FC(3)=$54:FC(4)=$20 ' // s
' Case 116
' FC(0)=$04:FC(1)=$3F:FC(2)=$44:FC(3)=$40:FC(4)=$20 ' // t
' Case 117
' FC(0)=$3C:FC(1)=$40:FC(2)=$40:FC(3)=$20:FC(4)=$7C ' // u
' Case 118
' FC(0)=$1C:FC(1)=$20:FC(2)=$40:FC(3)=$20:FC(4)=$1C ' // v
' Case 119
' FC(0)=$3C:FC(1)=$40:FC(2)=$30:FC(3)=$40:FC(4)=$3C ' // w
' Case 120
' FC(0)=$44:FC(1)=$28:FC(2)=$10:FC(3)=$28:FC(4)=$44 ' // x
' Case 121
' FC(0)=$0C:FC(1)=$50:FC(2)=$50:FC(3)=$50:FC(4)=$3C ' // y
' Case 122
' FC(0)=$44:FC(1)=$64:FC(2)=$54:FC(3)=$4C:FC(4)=$44 ' // z
' case 123
' FC(0)=$00:FC(1)=$08:FC(2)=$36:FC(3)=$41:FC(4)=$00' // {
' case 124
' FC(0)=$00:FC(1)=$00:FC(2)=$7F:FC(3)=$00:FC(4)=$00 ' // |
' case 125
' FC(0)=$00:FC(1)=$41:FC(2)=$36:FC(3)=$08:FC(4)=$00' // }
' case 126
' FC(0)=$10:FC(1)=$08:FC(2)=$08:FC(3)=$10:FC(4)=$08' // ~
end SELECT
Write_LCD:
High Lcd_DC
SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FC(0),FC(1),FC(2),FC(3),FC(4),$00 ]
Low Lcd_DC
Return


For the whole include file, you can look at: http://www.picbasic.co.uk/forum/showpost.php?p=73728

ScaleRobotics
- 23rd May 2009, 14:51
Ok, for some reason it works if you say DATA @10,some data here, then when you have gotten about half way through the eeprom, stop writting, then start writing again where you left off with DATA 128(or where ever you left off at),rest of your data here.

Don't know why you can't do it like you originally tried, but PBP does not seem to like it.

fratello
- 23rd May 2009, 19:55
Thanks for repply ! I will try both variants.
With this :
DATA @110,$7E,$11,$11,$11,$7E,_ ' 65 A 22
$7F,$49,$49,$49,$36,_ ' 66 B 23
$3E,$41,$41,$41,$22,_ ' 67 C 24
$7F,$41,$41,$22,$1C,_ ' 68 D 25
$7F,$49,$49,$49,$41,_ ' 69 E 26
$7F,$09,$09,$09,$01,_ ' 70 F 27
$3E,$41,$49,$49,$7A,_ ' 71 G 28 etc,etc...
I have another 25 characters ...enough for me. THANK YOU !

fratello
- 26th May 2009, 12:49
This is final version. I try to implement the function of clock (like this : http://www.picbasic.co.uk/forum/showthread.php?t=2129&highlight=clock+code ) but, even the code works verry, verry fine alone, I can't put together with my thermo....If somebody can do this...All the best !

fratello
- 3rd June 2009, 16:22
Hello ! Me again... Using PIC 16F628 (or A) with 4 MHz X-tal, one DS18B20 on port RA1, push-button for setting Hours on RB3 and for setting Minutes on RB2, I wrote the code for this thermo_clock. Works verry fine ! All the best !

tahirmaqsood
- 28th March 2010, 10:34
I want make digital code lock + speedometer with pic and 3310 lcd
Plz help me for code in picbasic
On the meter then first code lock on if code don then speedometer on
And distance save in pic internal eeprom


Tahir maqsood

fratello
- 4th April 2010, 20:32
Based on code that I post at #155, it is possible to use BIG fonts like in this example : http://users.picbasic.org/Howto/PPRINT/PROTON+%20Pprint%20update.pdf ? Of course, just display the temperature, with big font, without others graphical elements... The commands are in Proton+ ,but it's possible to use with PBP ? What are You thinking ? Thanks in advance for every repply !

ScaleRobotics
- 5th April 2010, 16:52
It looks possible. You would have to create custom characters for the 3310. Some helper bitmap font editors are available, like http://www.crystalfontz.com/forum/showthread.php?t=3619 to help you write the code for each character. How big are you wanting to go?. The link I showed goes to 10 x 14. But a font like this 10x14 (just look at fonts on this link) is bolder http://www.ageta.hu/pdf/gw64x16C-K610a-03.pdf. But perhaps you want even larger?

fratello
- 5th April 2010, 17:02
Please take a look at this ideea :
-in picture I figure how increase the size of characters ;
-in the code I try to explain how I see the problem.
Suggestions ? Thanks !

' So I define the normal characters :
DATA @10,$3E,$51,$49,$45,$3E,_ ';// 0
$00,$42,$7F,$40,$00,_ ';// 1
$42,$61,$51,$49,$46,_ ';// 2
$21,$41,$45,$4B,$31,_ ';// 3
$18,$14,$12,$7F,$10,_ ';// 4
$27,$45,$45,$45,$39,_ ';// 5
$3C,$4A,$49,$49,$30,_ ';// 6
$01,$71,$09,$05,$03,_ ';// 7
$36,$49,$49,$49,$36,_ ';// 8
$06,$49,$49,$29,$1E,_ ';// 9
$08,$08,$3E,$08,$08,_ ';// +
$08,$08,$08,$08,$08,_ ';// -
' and display the temperature :
'================= setting cursor for display the temperature
LcdReg = %10100000 + 22 ' cursor X
call PrintCtrlLcd
LcdReg = %01000010 ' cursor Y
call PrintCtrlLcd
'================= now display temperature
Char = (temperature dig 3)
call PrintChar
Char = (temperature dig 2)
call PrintChar
Char = 14 ' this is decimal point
call PrintChar
Char = (temperature dig 1)
Call PrintChar
'
'here I try to display with BIG font :
'===============================================
' try to define BIG zero :
DATA @10,$1F,$1F,$66,$66,$61,_ ';// the 1/4 left-down part of zero
$7C,$7C,$03,$03,$43,_ ';// the 1/4 left-up part of zero
$43,$33,$33,$7C,$7C,_ ';// the 1/4 right-up part of zero
$61,$60,$60,$1F,$1F,_ ';// the 1/4 right-down part of zero

' and display the temperature :
'================= setting cursor for display the temperature
LcdReg = %10100000 + 22 ' cursor X
call PrintCtrlLcd
LcdReg = %01000010 ' cursor Y
call PrintCtrlLcd
'================= now display temperature
Char = ??????????
call PrintChar
Char = ??????????
call PrintChar
Char = ?????????? ' redefine of decimal point
call PrintChar
Char = ??????????
Call PrintChar

HJota
- 5th April 2010, 23:02
Have you see the code of the post #82?

fratello
- 6th April 2010, 13:14
... but, please, on my code for simple thermometer, can You tell me how re-define the characters and how to display ? Just with BIG characters ! Thanks in advance, even for a little clue :) ...

'*********************************************
' Thermometer
' with Nokia 3310 display
@ DEVICE pic16F628A, XT_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_OFF, LVP_OFF, CPD_OFF, PROTECT_OFF

DEFINE NO_CLRWDT 1
DEFINE OSC 4

TRISB = %00001110 'portB configuration ; 0=out 1=in
TRISA = %10100010 'portA configuration

PortA = %11100010
CMCON = 7
VRCON = 0
INTCON = 0
OPTION_REG = %00000111 '

RST var PortA.4 'pin 3 Output reset display
SDIN var PortA.3 'pin 2 Output master data out
SCK var PortA.2 'pin 1 Output Spi clock
DQ var PortA.1 'pin 18 I/O DQ DS18b20
D_C var PortB.0 'pin 6 Output command/data sel. register


temperature var Word
tref var word
TempC var Byte
Float var Byte
Dummy var Byte
Flag var Byte
SignBit var Flag.0
Minus var Byte
LcdReg var Byte
x var Byte
y var Byte
Offset var Byte
Char var Byte
a var Byte
PosX var Byte
PosY var Byte
Chr var Byte
LcdData var Byte
V var Word
Sign var Byte
Busy VAR BIT ' Busy Status-Bit

DS18B20_12bit CON %01111111 ' 750ms, 0.0625°C


'================================================= ===================

DATA @10,$7E,$91,$89,$85,$7E,_ ';// 0
$00,$82,$FF,$80,$00,_ ';// 1
$82,$C1,$A1,$91,$8E,_ ';// 2
$42,$81,$89,$89,$76,_ ';// 3
$18,$14,$12,$FF,$10,_ ';// 4
$4F,$89,$89,$89,$71,_ ';// 5
$7E,$89,$89,$89,$72,_ ';// 6
$01,$E1,$11,$09,$07,_ ';// 7
$76,$89,$89,$89,$76,_ ';// 8
$46,$89,$89,$89,$7E,_ ';// 9
$08,$08,$3E,$08,$08,_ ';// + 10
$08,$08,$08,$08,$08,_ ';// - 11
$00,$C0,$C0,$00,$00 ';// . 12

'================================================= ===================
pause 100
RST = 1
PortB = 0
LcdReg = %00100001 'LCD Extended Commands.
call PrintCtrlLcd
LcdReg = $C8 'Set LCD Vop (Contrast)
call PrintCtrlLcd
LcdReg = %00000110 'Set Temp coefficent.
call PrintCtrlLcd
LcdReg = %00010011 'LCD bias mode 1:48.
call PrintCtrlLcd
LcdReg = %00100000 'LCD Standard Commands, Horizontal addressing mode.
call PrintCtrlLcd
LcdReg = $0C 'LCD in normal mode. $0D inverse

Call PrintCtrlLcd
Call CursorHome
Gosub LCD_Clear

'================================================= ===================

OWOut DQ, 1, [$CC, $4E, 0, 0, DS18B20_12bit]
Output DQ ' Make Pin Output
DQ=0 ' OneWire line Low
PauseUs 480 ' Keep down for 480 µS
Input DQ ' Make Pin Input
PauseUs 70 ' Wait 70 µS

OPTION_REG.7=1
TMR0=0
INTCON.2=0


W1:
OWIN DQ,4,[busy] 'Check for still busy converting
IF busy = 0 THEN W1 'Still busy?, then loop


CALL BorderLine


'================================================= ===================

Main:
ClockLoop: IF INTCON.2=0 THEN ClockLoop
INTCON.2=0
CALL BorderLine


OWOut DQ, 1, [$CC, $44]
OWOut DQ, 1, [$CC, $BE]
OWIn DQ, 2, [temperature.byte0, temperature.byte1]
SignBit = 0
if temperature.15 then
temperature = ~ temperature + 1
SignBit = 1
endif

Dummy = 625 * Temperature
TempC = DIV32 10
TempC = (Temperature & $7FF) >> 4
Float = ((Temperature.Lowbyte & $0F ) * 25 )>>2
Temperature=TempC*100 + Float
If SignBit then
V= 10000 - Temperature ' 25'C=12500 0'C=10000 -10'C=9000
SignBit = 0
else
V= 10000 + Temperature
EndIf

If V >= 10000 then ' Above 0 C.
Temperature=V-10000
else
Temperature=10000-V ' Below 0 C.
EndIf

GoSub SelectSign ' +/blank/- Sign

'================= setting cursor for display the temperature
LcdReg = %10001000 ' cursor X
call PrintCtrlLcd
LcdReg = %01000010 + 1 ' cursor Y
call PrintCtrlLcd
'================= now display temperature
if Tempc > 99 then
Char = 3
call PrintChar
else
Char = 12 ' + plus
if SignBit = 1 then Char = 13 ' - minus
call PrintChar
endif

Char = (temperature dig 3) + 2
call PrintChar
Char = (temperature dig 2) + 2
call PrintChar
Char = 14
call PrintChar
Char = (temperature dig 1) + 2
Call PrintChar
Char = (temperature dig 0) + 2
Call PrintChar

goto Main


'================== S U B R O U T I N E S ===========================

'========================== L C D ===================================

CursorHome: LcdReg = %10000000 ' cursor Home
call PrintCtrlLcd
LcdReg = %01000000 ' cursor Home
call PrintCtrlLcd
return

PrintChar: offset = Char * 5

for a = 1 to 5
read offset, LcdReg
call PrintDataLcd
offset = offset + 1
next a
LcdReg = 0
call PrintDataLcd
return

PrintCtrlLcd: D_C = 0

PrintDataLcd: for x = 1 to 8
SDIN = LcdReg.7
SCK = 1
LcdReg = LcdReg << 1
SCK = 0
next x
D_C = 1
return

LCD_Clear:
PosX=0:PosY=0:GOSUB LCD_GotoXY
HIGH D_C
FOR Chr=1 TO 252
LcdData=0:GOSUB LCD_ByteOut
LcdData=0:GOSUB LCD_ByteOut
NEXT Chr
RETURN

LCD_GotoXY:
LOW D_C
LcdData=%01000000 | PosY :GOSUB LCD_ByteOut
LcdData=%10000000 | PosX :GOSUB LCD_ByteOut
RETURN

LCD_ByteOut:
SHIFTOUT SDIN,SCK,1,[LcdData]
RETURN

'================================================= ===================
SelectSign:
If v = 10000 then ' Temperature = 0 C.
Sign=" " ' No sign
Else
If v < 10000 then ' <> 0
Sign="-" ' Temperature below 0 C.
Else
Sign="+" ' Temperature above 0 C.
EndIf
EndIf
Return


BorderLine:
' Raw 0
' Raw 1
' no space for post code here
Return

'===================================
End 'of program

ScaleRobotics
- 6th April 2010, 17:27
You might try something like this. The characters you show as an example could be simplified to fit into half the space, but this allows you to smooth the characters if you like. I did not smooth them, just kept to your example font, so hopefully you can see what I am trying to do. Each hex data point of the character is basically a binary image of the column. It starts at the base of the character, but since our character is going to take 4 character positions, our zero starts at half of the 16 pixels high. So the left column of the top of the zero is 11111100 (or $FC) all the 1's are black. As you can see, it takes a long time to make the characters. There may be a tool out there somewhere to make this easier for you. Hopefully you just need numbers!

The building of the characters are shown on the data sheet for the display on pages 8-9, and 22-23.


FA VAR BYTE[5] 'upper left of character
FB VAR BYTE[5] 'upper right of character
FC VAR BYTE[5] 'lower left of character
FD VAR BYTE[5] 'lower right of character

'-------------------------------------------------------------------------------
' This part demonstrates how to write to LCD
Lcd_SendChar:
lookdown Lcd_data,[" !\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"],CharNum
Lcd_data = CharNum +32

SELECT CASE lcd_data

Case 48 ' a zero
FA(0)=$FC:FA(1)=$FC:FA(2)=$3:FA(3)=$3:FA(4)=$C3 ' // 0
FB(0)=$C3:FB(1)=$33:FB(2)=$33:FB(3)=$FC:FB(4)=$FC ' // 0
FC(0)=$0F:FC(1)=$0F:FC(2)=$33:FC(3)=$33:FC(4)=$30 ' // 0
FD(0)=$30:FD(1)=$30:FD(2)=$30:FD(3)=$0F:FD(4)=$0F ' // 0
Case 49 ' a one


end SELECT
Write_LCD:
High Lcd_DC
SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FA(0),FA(1),FA(2),FA(3),FA(4)] 'upper left
'need to point to next position here
SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FB(0),FB(1),FB(2),FB(3),FB(4),$00,$00] 'upper right
'need to add code to change location to lower left position for bottom of character here!
SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FC(0),FC(1),FC(2),FC(3),FC(4)] 'lower left
'need to add code to change to next position
SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FD(0),FD(1),FD(2),FD(3),FD(4),$00,$00] 'lower right
'need to add code to move back to upper level (and shift right) for beginning of next character
Low Lcd_DC
Return

ScaleRobotics
- 7th April 2010, 08:01
The attached program fastLCD.zip will help you with text, as well as graphics. It will let you create characters, and it will create hex for them.

http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4159&stc=1&d=1270623366

fratello
- 7th April 2010, 08:44
Nice program, but I use already Excel (bin2hex) for those big characters...Unfortunately, I need to understand the codes You and HJota propose and modify all my code; the procedures for define and display the characters are different...Per aspera ad astra :) ...

fratello
- 7th April 2010, 12:13
I succeded to display "23.56" ! it's a step, don't ?!
Now, assuming that I succed to write the code for reading DS18B20, how display temperature instead "23.56" ?
It's correct so : " lookup i, [temperature DIG 3, temperature DIG 2, temperature DIG 1], j" or how ? Thanks !

ScaleRobotics
- 7th April 2010, 15:12
How about changing from this:


for i=0 to 4
lookup i,["23.56"],j
lcdstr(i)=j
next i


to something like this:


lcdstr(4) = 48 + temperature dig 3
lcdstr(3) = 48 + temperature dig 2
lcdstr(2) = "."
lcdstr(1) = 48 + temperature dig 1
lcdstr(0) = 48 + temperature dig 0


You would have to do something when your temperature goes to single digits though.

fratello
- 7th April 2010, 18:11
What I put here ?

lcdstr(4) = 48 + temperature dig 3
lcdstr(3) = 48 + temperature dig 2
lcdstr(2) = "."
lcdstr(1) = 48 + temperature dig 1
lcdstr(0) = 48 + temperature dig 0

Tc=2
for i=0 to 4
lookup i,["??????"],j
lcdstr(i)=j
next i
nC=5

ScaleRobotics
- 7th April 2010, 21:05
What I put here ?

lcdstr(4) = 48 + temperature dig 3
lcdstr(3) = 48 + temperature dig 2
lcdstr(2) = "."
lcdstr(1) = 48 + temperature dig 1
lcdstr(0) = 48 + temperature dig 0

Tc=2
for i=0 to 4
lookup i,["??????"],j
lcdstr(i)=j
next i
nC=5

remove the for i = loop. The code above will load the values in the lcdstr string.

fratello
- 8th April 2010, 12:29
like in picture attached. The code works great, with one DS18B20; next project is, of course :), termo with two zone, with thermostat, with clock, etc.,....
THANK YOU ALL !

tahirmaqsood
- 16th April 2010, 15:15
this code not compile
plz help me
Thnks

fratello
- 16th April 2010, 17:33
Proton IDE ?! MPLAB IDE...

fratello
- 17th April 2010, 06:42
Hex file (remove .txt extension); use 16F648A, for graphics elements.

tahirmaqsood
- 17th April 2010, 11:59
proton id and DEVICE 16f628a

fratello
- 17th April 2010, 12:46
Because this topic it's still "hot" I wonder if somebody have meeting this problem : I bought some Nokia 3310 displays and bottom of display appears these stranges characters...using same code and hardware (see post #169). The results on display are like in picture (original vs fake; both display look hardware just the same). Suggestions ?! Thanks !

ScaleRobotics
- 17th April 2010, 15:48
Not sure if this will help, but I did notice a difference in the way we initialize the display.

Try adding some time, and another pause after, and see if that helps.


Low Lcd_RST
pause 50
High Lcd_RST
pause 50


Otherwise, my only advice would be to try to get from same manufacturer. One display seems to have the part number info on it, the other does not. Is the one with the part info printed on it the working one?

fratello
- 17th April 2010, 16:21
Even with "pause 100" don't work ; still "fleas". And yes, the display with part info printed work good. The last line it's with problem !!!! She don't want to be erased !! I try another program and look at differences. First two foto are with good display; "main" program - and, after LCD_clear , "set" display. The last two are with "fake" display. The last line remain from "main" program display !!!

Gusse
- 18th April 2010, 20:58
Even with "pause 100" don't work ; still "fleas". And yes, the display with part info printed work good. The last line it's with problem !!!! She don't want to be erased !! I try another program and look at differences. First two foto are with good display; "main" program - and, after LCD_clear , "set" display. The last two are with "fake" display. The last line remain from "main" program display !!!
LCD seems to work OK if you can write text to it, to all 6 rows. Try some PAUSE after Lcd_Clear -command if that will make any difference. Could it be so that LCD controller is quite slow and next command will override Lcd_Clear. Just speculations ...

BR,
-Gusse-

fratello
- 19th April 2010, 11:56
Thanks for repply ! But...with "Pause" (10-200 !) it's worst !

Gusse
- 19th April 2010, 18:25
Are you using similar LCD_Clear code as in post #161 (http://www.picbasic.co.uk/forum/showpost.php?p=87839&postcount=161)?

Would code below make any difference?
At least it has worked for me very well with several different 3310 LCD modules.

<code><font color="#000000">Lcd_Data <b>VAR BYTE </b>[6]

Lcd_Clear:
PosX=0:PosY=0:<b>GOSUB </b>Lcd_GotoXY
<b>HIGH </b>Lcd_DC
Lcd_Data(0)=0:Lcd_Data(1)=0:Lcd_Data(2)=0:Lcd_Data (3)=0:Lcd_Data(4)=0:Lcd_Data(5)=0
<b>FOR </b>Char=1 <b>TO </b>84
<b>GOSUB </b>Write_LCD
<b>NEXT </b>Char
<b>RETURN

</b>Write_LCD:
<b>SHIFTOUT </b>SDIN,SCK,1,[ Lcd_Data(0),Lcd_Data(1),Lcd_Data(2),Lcd_Data(3),Lc d_Data(4),Lcd_Data(5) ]
<b>RETURN

</b></code>

BR,
-Gusse-

fratello
- 20th April 2010, 16:46
She drives me crazzy ! Don't work ; still "fleas"... verry disappointed :( ... I have now five display useless...

fratello
- 25th April 2010, 19:06
Here : http://www.edaboard.com/ftopic324477.html&usg , I find something interesting...

Gusse
- 26th April 2010, 03:08
So, somebody is selling fake 3310 LCD displays, that are actually with 102*80 controllers. Nice practical joke!
I bet that those aren't made by Philips, Samsung or Seiko Epson. :rolleyes:

BR,
-Gusse-

Gusse
- 30th April 2010, 06:16
She drives me crazzy ! Don't work ; still "fleas"... verry disappointed :( ... I have now five display useless...
Hi Fratello,

Try this one. It will change row after it has cleared 84 pixels. Old version changed row also after 84, but if you have 102 pixels per row then 502 positions are not enough.


<code><font color="#000000">Lcd_Data <b>VAR BYTE
</b>Cursor <b>VAR BYTE

</b>Lcd_Clear:
<b>FOR </b>Cursor = 0 <b>TO </b>5
PosX=0:PosY=Cursor:<b>GOSUB </b>Lcd_GotoXY
<b>HIGH </b>Lcd_DC
Lcd_Data = 0
<b>FOR </b>Char = 1 <b>TO </b>84
<b>GOSUB </b>LCD_ByteOut
<b>NEXT </b>Char
<b>NEXT </b>Cursor
<b>RETURN

</b></code>

or


<code><font color="#000000">Lcd_Data <b>VAR BYTE </b>[6]

Lcd_Clear:
PosX=0:PosY=0:<b>GOSUB </b>Lcd_GotoXY
<b>HIGH </b>Lcd_DC
Lcd_Data(0)=0:Lcd_Data(1)=0:Lcd_Data(2)=0:Lcd_Data (3)=0:Lcd_Data(4)=0:Lcd_Data(5)=0
<b>FOR </b>Char=1 <b>TO </b>102
<b>GOSUB </b>Write_LCD
<b>NEXT </b>Char
<b>RETURN

</b>Write_LCD:
<b>SHIFTOUT </b>SDIN,SCK,1,[ Lcd_Data(0),Lcd_Data(1),Lcd_Data(2),Lcd_Data(3),Lc d_Data(4),Lcd_Data(5) ]
<b>RETURN


</b></code>

BR,
-Gusse-

fratello
- 30th April 2010, 15:45
Thank's ! Of course, You are right ! So simple solution...Great !

Lcd_Clear:
For cursor = 0 to 5
PosX=0:PosY=Cursor:Gosub Lcd_GotoXY
High Lcd_DC

For i= 1 to 84
Lcd_Data=0:Gosub Lcd_SentByte
Lcd_Data=0:Gosub Lcd_SentByte
Next i
Next cursor
Return

Gusse
- 1st May 2010, 10:34
Thank's ! Of course, You are right ! So simple solution...Great !
Nice to hear that it worked.

BR,
-Gusse-

tahirmaqsood
- 13th May 2010, 13:59
hi all
i am new in this filed plz help me code in Micro Code Studio fore this
schematic.
Thanks

ScaleRobotics
- 13th May 2010, 14:18
hi all
i am new in this filed plz help me code in Micro Code Studio fore this
schematic.
Thanks

Hello tahirmaqsood,

Your schematic seems to be advertising used cars. I am not sure how any code I could come up would be related to used cars, so I can't really help with the code for the sensors.

But here is some code for talking to the LCD display:
http://www.picbasic.co.uk/forum/showthread.php?t=327&p=73728#post73728

Please do not cross post copies of the same question to other threads.

By the way, are you still using Proton, or have you switched to PicBasicPro?

ScaleRobotics
- 5th June 2010, 06:50
The Nokia 3310 display just became available at Sparkfun for $2.95 each. Pretty good price for what it can do! You can check it out here http://www.sparkfun.com/commerce/product_info.php?products_id=9924. Here is the wiki page about interfacing it, based on posts in this thread: http://www.picbasic.co.uk/forum/content.php?r=174-Using-Nokia-3310-LCD

wjsmarine
- 4th July 2010, 08:38
Hi Walter,

Great job on your macro for the Nokia 3310 LCD, so much so that I think I'll move across to using these instead of the 16x2 I've been using everywhere so far. Thank you.

I'm not having much luck getting the @ PrintVar x,y, _anyvariable to work though. I declare a word variable in my main program (j var word), give it a value to test (j=12345) then
@ PrintVar 0,4, _j
but only random values print and only 2 or 3 characters. Weird.

Can you perhaps show me a working section of how to do it please? I'm using PbP 2.60, 18F252.

Thanks and regards,
Bill

ScaleRobotics
- 4th July 2010, 17:01
Thanks Bill.

I double checked the code I posted here: http://www.picbasic.co.uk/forum/content.php?r=174-Using-Nokia-3310-LCD, and it is working for me. I am using this hardware: http://www.picbasic.co.uk/forum/showthread.php?t=10820 running at 48mhz.

You are using the right syntax, so I can't really find the problem.

The PrintVar is how I am printing the word variables in this example: http://www.picbasic.co.uk/forum/content.php?r=210-Angle-determine-tilt-from-3-axis-g-sensor

You want to post your code, and I will see if if runs on my hardware? I don't have an easy way to change my hardware for the display.

wjsmarine
- 5th July 2010, 07:25
Hi Walter,

Attached code for the 18F252 also an edited copy of your Include file - only a few small font changes but it's what I'm using so here it is.

I tried using Variable in place of j but same result. I'm sure it is something simple but I can't see it...

Thanks for your help,
Bill

ScaleRobotics
- 5th July 2010, 17:53
Hi Bill,

After looking at it and testing for a while, there was an error in most of my early includes files. I learned about the jumpover a little late. I compensated for this in my example programs, but it made it harder for others to use.

For instance, in your LCD_3310v32.inc file, please change goto Start to goto OverLCD

and at the very bottom of this include file, add this line: OverLCD:

This fixed your code for me.

Edit: and you should have _j or any other variable, but not _Variable as your variable. _Variable is used in the macro to get your variable. So use: PrintVar x,x, _j or something.

wjsmarine
- 6th July 2010, 14:58
Hi Walter,

That did the trick, thank you! Now if we can only get it to work on 16F chips... any takers?

Regards to all,
Bill

ScaleRobotics
- 6th July 2010, 16:33
Good to hear Bill.

But what is the problem with 16f's? Mine compiles without errors for a 16f876a, if I change the ports to match. But I don't have a way to test it here.

wjsmarine
- 7th July 2010, 08:26
Hi Walter,

Making the appropriate changes per chip (cmcon, adcon, etc.) and my same code with the same INC file as compiles correctly with the 18F252, I have no luck with a 16F648A or 16F876A.

I thought the INC font string may have been too long also so shortened it to about half its size but no difference. Here is what I get...

With a 16F648A:
Error[113] e:\wjs\pbp260\pbppic14.lib 449 : Symbol not previously defined [EEADRH]
Message[303] e:\wjs\pbp\NOD157~1.ASM 185 : Program word too large. Truncated to core size. (4920)
too many errors

With a 16F876A there are 20 lines of:
Message[303] e:\wjs\pbp\NOD157~1.ASM 187 : Program word too large. Truncated to core size. (4920)

Does this give you any ideas where my problem with 16F's is? What are the chip requirements for using this macro - codespace, ram size, etc,?

Thanks and regards,
Bill

ScaleRobotics
- 12th July 2010, 06:37
Hey Bill,

I think this might be a version issue for Mpasm, or PBP, but really not sure. I get a nicely compiled result at 2312 words for your version of include file.

I can fit 96 more bytes in RAM, so there is a bit more left, but as you can see, my program is small.

4600

tahirmaqsood
- 1st August 2010, 08:18
i am new in pbp i want this schematic code in pbp
and step by step detail this code for learning purpose
plz any body help me

Thanks

ScaleRobotics
- 1st August 2010, 08:41
i am new in pbp i want this schematic code in pbp
and step by step detail this code for learning purpose
plz any body help me

Thanks

Here you go....

Step 1: Don't ask people to write all your code for you and expect to learn a thing from it.
Step 2: Read the manual.
Step 3: If the project is over your head, start with something you can do, with some work.
Step 4: Blink some LED's to start off, then try progressing to bigger projects.
Step 5: Take a look at http://www.picbasic.co.uk/forum/showthread.php?t=12677 for inspiration. Someone working hard and learning fast.

With time and effort, you will be able to return to the project you are yearning for.

Walter

astanapane
- 2nd June 2011, 18:45
hello all,

i'm trying to compile a program based on 16f628a and nokia LCD 3310.

I'm trying to right a simple program just to print a HELLO WORLD on the nokia LCD but no luck.

My problem is that when i try to INCLUDE "LCD_3310v4.inc" i get an error that cannot open the inc file.

Also when i open the file in the microcode studio (the LCD_3310v4.inc file) i get the error "Symbol not previously defined EEADRH"

Do you have any suggestion please?

many thanks for your help in advance.

Gusse
- 2nd June 2011, 22:46
This is causing your EEADRH problem.

Readcode Addr, CharEasiest way to go forward is comment or remove following parts of the code:

@ printstr macro function from Darrel and edited to work for this lcd
'format should look like this: @ PrintStr x,y, "your text string goes here"Meaning StringOut and ASM-part above it.
This is disabling string printing function, so you should figure out other ways to put stuff on LCD.

Those who know better why READCODE doesn't work with 628A could answer to you.
Even better if some workaround is available.

BR,
-Gusse-

astanapane
- 3rd June 2011, 07:00
Hi Gusse,

thanks for your answer. That means that when i also get an error "cannot open inc file" the time i try to compile, it has to do with the 628a?

Sorry for my silly question but cannot understant why is not compatible.

Gusse
- 3rd June 2011, 16:23
Is your inc-file in the same folder where you have your main pbp-file?

INCLUDE "LCD_3310v4.inc"If no, then you should include path to file before inc-file.
If yes, then I don't know why you get this error message. Is syntax or file name OK?

I think, it has nothing to do with 628A.

BR,
-Gusse-

astanapane
- 4th June 2011, 09:16
it is in the same folder.

I will try once more. the code and the syntax are also ok.

thanks for your time.

If i have any news i will let you know.

astanapane
- 14th June 2011, 10:12
hi all again,

i see that a lot of you having problem to write on the nokia lcd using the pic16f628a.

i'm also stragling to do it and i havent been able to fix my problems.

i'm trying to use the following files from the page http://www.picbasic.co.uk/forum/content.php?r=174-Using-Nokia-3310-LCD but no luck.

a very simple code i'm trying to display is the following.


DEFINE OSC 4

@ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF, CPD_OFF, PROTECT_OFF

include "modedefs.bas"
include "LCD_3310.pbp"


TRISB = %00011100 'portB configuration 0=out 1=in
TRISA = %10100000 'portA configuration
PortA = %11100000
CMCON = 7
VRCON = 0
INTCON = 0

OPTION_REG=%00000111 'weak pullups on, TMRO prescale = 256

Lcd_DC var PortB.0
Lcd_SDA var PortA.3
Lcd_RST var PortA.4
Lcd_CLK var PortA.2

start:

@ PrintStr 0,0, "I love being"
@ PrintStr 0,1, "able to print "
@ PrintStr 0,2, "so easily!"

goto start

i will post later on the full code using the pic16f628a. It is seems that is been compiled but i dont see anything on the screen. I have checked connection and everything is ok.

I have also checked the nokia lcd with a circuit that work and didnt see a problem.

fratello
- 14th June 2011, 11:42
Maybe must to do this in your "LCD_3310.pbp" file :

'Port Mapping 'Change to match your application
Lcd_CLK VAR Portc.3 'LCD Clock
Lcd_DC VAR Portf.6 'LCD Data/Command
Lcd_SCE VAR Portf.7 'LCD Chip Enable
Lcd_RES VAR Portd.3 'LCD Reset
'Lcd_VCC VAR Porte.2 'LCD Power (always powered for this hardware)
Lcd_SDO VAR Portc.5 'LCD Data
I use a lot of 16F628A (and 648A) in my projects (see http://www.picbasic.co.uk/forum/showthread.php?t=14888&p=103204#post103204 and topic) and works verry fine !

astanapane
- 14th June 2011, 14:53
fratello,

thank you very much for your info and nice to meet you.

I've read all the articles here from you.

I only want to use the Nokia LCD for one of my RFID projects.

Nokia LCDs are fearly cheap and hopefully i manage to get them work.

Once i go home i will try to change as you suggested.

thanks again.


Lcd_DC var PortB.0
Lcd_SDA var PortA.3
Lcd_RST var PortA.4
Lcd_CLK var PortA.2

with this


'Port Mapping 'Change to match your application
Lcd_CLK VAR Porta.2 'LCD Clock
Lcd_DC VAR Portb.0 'LCD Data/Command
Lcd_SCE VAR Port 'LCD Chip Enable ??? here i also need to assign a port for enable??? or this goes to ground?
Lcd_RES VAR Porta.4 'LCD Reset
'Lcd_VCC VAR Port? 'LCD Power (always powered for this hardware) any port assigned to give power????
Lcd_SDO VAR Porta.3 'LCD Data

fratello
- 14th June 2011, 15:45
I ALWAYS use this LCD with SCE to ground :) . Try to find Nokia 5110 display ; it's more easy to "interfacing".
LE : I don't use LCD_VCC from PIC's. Just be careful to power with maxim 3.3 volts !!! Now I use this (second) schematic, with good results !

astanapane
- 14th June 2011, 17:13
i will follow your schematics,

i will post what error i get now after compiling the following program


DEFINE OSC 4
@ device P16F628A
@ __INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF, CPD_OFF, PROTECT_OFF

include "modedefs.bas"
include "3310.inc"

TRISB = %00011100 'portB configuration 0=out 1=in
TRISA = %10100000 'portA configuration
PortA = %11100000
CMCON = 7
VRCON = 0
INTCON = 0

OPTION_REG=%00000111 'weak pullups on, TMRO prescale = 256


start:

@ PrintStr 0,0, "I love being"
@ PrintStr 0,1, "able to print "
@ PrintStr 0,2, "so easily!"

goto start

astanapane
- 14th June 2011, 17:26
i get the following error

mister_e
- 14th June 2011, 17:40
1. Must use MPASM to compile
2. You need to change the way you set the config fuses, check the FAQ.
3. I've never used this program, so I can't tell if this will grandpa 16F628's codespace, may need to use a 'bigger' one.

fratello
- 14th June 2011, 17:42
@ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON

mister_e
- 14th June 2011, 17:50
NO! that's PBP syntax, he must use MPASM syntax...

astanapane
- 14th June 2011, 17:54
when i compile with PBP the following


DEFINE OSC 4
@ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON
include "modedefs.bas"
include "3310.inc"

TRISB = %00011100 'portB configuration 0=out 1=in
TRISA = %10100000 'portA configuration
PortA = %11100000
CMCON = 7
VRCON = 0
INTCON = 0

OPTION_REG=%00000111 'weak pullups on, TMRO prescale = 256


start:

@ PrintStr 0,0, "I love being"
@ PrintStr 0,1, "able to print "
@ PrintStr 0,2, "so easily!"

goto start

i get the attached error

astanapane
- 14th June 2011, 18:31
when i compile with MPASM

i get EEADRH erros how can i correct it? please help. I think i will never manage to use my nokia lcd

astanapane
- 14th June 2011, 20:09
i would like to mention also that the nokia LCD i have is the nokia 5110 which does not have the Vout pin. (if that helps)

mister_e
- 15th June 2011, 02:28
Seems you're out of codespace... choose another PIC (like PIC16F877) and see if this compile.

astanapane
- 15th June 2011, 06:52
ok i will try later in the afternoon. But i just included the 3310.inc file and i just used @ print command. The 3310 took all the space from the pic?

is there any way to eliminate the 3310.inc and just take small bits from it in order to use only the @ print command.

My goal is to use it for the RFID tag number. I have done it with 2x16 lcd very simple with uLCD from 4D systems and now i would like to use Nokia lcd because is inexpensive compare to uLCD.

Gusse
- 15th June 2011, 08:37
Your PIC cannot use READCODE command.

READCODE: Some PIC16Fxxx and PIC18Xxxxx devices allow program code to be read at run-time. This may be useful for additional data storage or to verify the validity of the program code..MAC -file contains:

READCODE?TB macro Regin, Bitin, Bout
MOVE?TB Regin, Bitin, EEADR
clrf EEADRH
L?CALL READCODE
MOVE?AB Bout
endm
READCODE_USED = 1
And if you check from PIC16F627A/628A/648A datasheet, there is no EEADRH register in the these PICs (reason for error). Therefore you cannot use Scalerobotics (Walter's) great addon (=@ PrintStr) as it is now.

Also other note about READCODE

For PIC16F devices, 14-bit-sized data can be read from word code space Addresses.
Addr VAR WORDVariable cannot be WORD.

Easiest is to change to some other PIC, which support READCODE (e.g 16F8/74A/76A etc...) and which have also more code space :)

BR,
-Gusse-

astanapane
- 15th June 2011, 09:11
Hi gusse,

thanks, so that means that i cannot use any of the pic16f628a or a small pic 12f629.

I have seen fratello that used the pic but he didnt use the READCODE command.

Not using a small pic for such a simple code is annoying.

I will try with a bigget pic.

In case i want to print the number of the RFID tag do i need the READCODE command to my program?

If i can avoid or use other method to print letter as a label like fratello did then i might be able to use a small pic.

Thanks all of you for helping. And really sorry for my questions again.

Gusse
- 15th June 2011, 09:18
You can always use the old way to print LCD
Instead of

@ PrintStr 0,0, "HELLO"use

PosX=0:PosY=0:Gosub Lcd_GotoXY
Lcd_Data = "H"
Gosub Lcd_SendChar
Lcd_Data = "E"
Gosub Lcd_SendChar
Lcd_Data = "L"
Gosub Lcd_SendChar
Lcd_Data = "L"
Gosub Lcd_SendChar
Lcd_Data = "O"
Gosub Lcd_SendCharand remove "@ PrintStr" -part from LCD_3310 -file.

BR,
-Gusse-

BTW, "Edit Post" time could be a little bit longer. Couple of hours would be OK. Any changes to get this changed?

astanapane
- 15th June 2011, 09:49
i will follow your suggestion. Because right now i'm at work i will try that in the afternoon.

thanks again. I will let you all know for my results.

astanapane
- 15th June 2011, 19:58
i tried to write simpler the code but seems that the pic doesnt work. I also tried with bigger pic.

thank you all for your help. Its me that i cannot make it.

thanks again for your time.

fratello
- 15th June 2011, 20:19
Try this simple code ( http://www.picbasic.co.uk/forum/showthread.php?t=327&p=72927#post72927 ) , using 16F628A.

astanapane
- 16th June 2011, 07:07
thanks fratello,

i will give the last try. What i have noticed, is that the 3310.inc cause a problem to pic16f628a, and its is not working at all.

I did used on my code the following just to see if the LED flashes but no luck.

for example:

high LED
pause 100
low LED
pause 100

When i created a new pbp file on a different folder without the inc file included, my code was working.

Strange.

mister_e
- 16th June 2011, 09:58
Please, post your whole code and specify which version of the include you're using. There seems to have a couple of version 'round. Best thing attach your both file here as .TXT file.

This LCD seems fun to work with,I see the .INC could be tweaked in many ways. What I'll do is to order one, and see how this lib could be modified to use with other PICs. I should have it next week.

astanapane
- 17th June 2011, 07:37
Thanks Steve,

i didnt have a time yesterday to play with, because i came back home from work and was very tired. Apart from that, during the day i will post the code. Actually i have post the code before. It is very simple. I just wanted to use the @ print command with pic16f628a.

Gusse said to use the traditional way to print a string but i didnt have a time to do it.

this is my code:

DEFINE OSC 4
@ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON
include "modedefs.bas"
include "3310.inc"

TRISB = %00011100 'portB configuration 0=out 1=in
TRISA = %10100000 'portA configuration
PortA = %11100000
CMCON = 7
VRCON = 0
INTCON = 0

OPTION_REG=%00000111 'weak pullups on, TMRO prescale = 256


start:

@ PrintStr 0,0, "I love being"
@ PrintStr 0,1, "able to print "
@ PrintStr 0,2, "so easily!"

goto start

The version of the INC file i use is the last one from that page.
http://www.picbasic.co.uk/forum/content.php?r=174-Using-Nokia-3310-LCD

Regards,

if you get the LCD, and you find the way, i will be much appreciated to see your work.

I just want to print somehow letters (or a small image as DATA) using any small pic like 16f628 or 16f88 or smaller.

My project is to print the value (number of the RFID TAG) using the nokia 5110 lcd.

I have done this project using 2x16 lcd and the uLCD 128x128 from 4D systems. That was easy because both of the displays have parallel and serial interfaces, and for 2x16 picbasicpro has a library for them.

Regards,

Ioannis
- 17th June 2011, 08:31
You make a fast loop and this may cause dim display. Use a pause 1000 before goto start.

Also how about contrast adjustment of the LCD? Maybe it is set too dim to display something.

I have no LCD to test here, just guessing.

Ioannis

astanapane
- 17th June 2011, 09:06
Hi Ioannis,

i will also check the contrast number and play with it.

thanks

mister_e
- 17th June 2011, 12:55
Everything is plausible on any PIC, however, there's some more efficient way than other to handle Strings, and some better PIC to handle it. Oh well, It should be fun.

astanapane
- 17th June 2011, 13:31
Steve,

i will try this weekend again everything i can do with compiling and checking the display.

When you receive yours you can also try out.

Which kind of Nokia did you order? 5110? http://www.sparkfun.com/products/10168

This kind of display does not have the Vop pin. Do i make any mistake on this stage?

fratello
- 17th June 2011, 15:23
How to connect display...

mister_e
- 17th June 2011, 21:56
I thought I would order that one but the other Canadian distributor I found don't have any in stock and couldn't tell me when he'll receive some more... too bad.

I found a place near who'll have the following in stock next week, I'll pick it directly at their shop.
http://www.inexglobal.com/downloads/glcd5110.pdf

astanapane
- 17th June 2011, 22:33
Steve,

is the same. i like it more in blue.

The pinout are the same.

astanapane
- 20th June 2011, 11:15
on the one i have as you see there is no Vop pin. This pin as from the code i see that is connected to ground through a 4.7uf capacitor and controls the Contrast.

The point is that on the LCd i have there is no Vop pin. So how can i control the Contrast.

If anyone have the display 5110 nokia from sparkfun, could make it easier if he can upload the schematic and a simple code.

Gusse
- 20th June 2011, 19:27
Vop is a register in extended instruction set (see page 14, Set Vop)
http://www.nxp.com/acrobat_download2/datasheets/PCD8544_1.pdf

"8.9 Set VOP value" (on page 16) describes how to calculate setting value.

Contrast is set in "Lcd_Init" section in LCD_3310 -file.

Lcd_Data= $c8: GOSUB Lcd_SendByte ' SET LCD Vop (CONTRAST)Here it seems to be $c8, with some older I have to use $d1 and other newer might need $bf. Try to change the value and check which is best with your display.

BR,
-Gusse-

astanapane
- 21st June 2011, 10:32
i have fixed the circuit from that page and work fine.

http://www.radiolocman.com/shem/schematics.html?di=44132

he is using the following

LcdReg = %00100001 'LCD Extended Commands.
call PrintCtrlLcd
LcdReg = %10101001 'Set LCD Vop (Contrast).
call PrintCtrlLcd
LcdReg = %00000110 'Set Temp coefficent.
call PrintCtrlLcd
LcdReg = %00010011 'LCD bias mode 1:48.
call PrintCtrlLcd
LcdReg = %00100000 'LCD Standard Commands, Horizontal addressing mode.
call PrintCtrlLcd

that means that the HEX of the Vop is $A9.

He is also says:

If by any chance the contrast isn't to your liking, it can be changed during the programming of Pic12F629, in the program location D2h. the current value A9h is the one I use with my LCD and don't know it will be for other LCDs. The value can be set to anything between 80 h and FFh, 80 h being minimum contrast and FFh maximum.

mister_e
- 25th June 2011, 20:18
OK, I've finished the new Include/driver/wrapper thing here. I'll post it in the next days. Still have some improvement to do. No big changes, but probably easier to use, a tad more flexible too.

You guys should love it :D

Stay tunned!

astanapane
- 26th June 2011, 11:52
hi mister_e

i'm looking forward to see it. Thanks.

ruijc
- 27th June 2011, 20:58
Hi all,

i've been looking at this topic for some time now.
I managed to get an original 3310 display and made some tests.

First i tried the INC solution but i got the "Truncated to code size" errors ( using 16F88 or 16F628A ).

Tried some examples posted here ( always changing ports to my configuration ) with a blank screen.

Tried the test file with big numbers and it worked.

Then moved to a 18F2550 micro-controller and once again the INC solution did not worked ( just had some ! simbols all over the place ).

The only solution i got was to use the INC file together with Gusse's sugestion on using "Gosub Lcd_SendChar" instead of "@ PrintStr" format.

This way works like a charm!

Do you guys know of an 18 pin chip that would work ( since it doesnt work with the 16Fs ) ?

Or Steve ( Mister-e ) will have a fresh new solution that will work on more chips ?

Regards

mister_e
- 27th June 2011, 21:05
My solution should work with anything, at compile time it decide which macro to build/compile/use.

It should even work with many 12F... with some limitations.

mister_e
- 27th June 2011, 21:07
Out of curiosity, which PIC didn't worked for you?

ruijc
- 27th June 2011, 21:29
Hi Steve :)

I was using the 16F88

Regards

astanapane
- 28th June 2011, 06:52
i was trying to use pic16f628a.

I have seen over the internet some others they succeed with pic12f629

mister_e
- 28th June 2011, 15:59
it could even work with a 10F, but probably not with PBP as it consume too much RAM, but that's another story ;)

varunksr
- 28th June 2011, 18:17
hi
can anyone please send info regarding interfacing the nokia 6610 display with 8051..

mister_e
- 28th June 2011, 18:26
You're probably out of luck on a Microchip PIC oriented forum like here, but
http://www.google.ca/search?q=nokia+6610+display+with+8051&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:fr:official&client=firefox-a#hl=fr&client=firefox-a&hs=Ucx&rls=org.mozilla:fr%3Aofficial&q=nokia+3310+8051&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=62d0b8dad8682010&biw=1366&bih=596

then
http://www.lcdinterfacing.info/Nokia-3310-LCD-Interface.php

astanapane
- 28th June 2011, 21:28
Hi Steve,

i'm looking forward to see the new driver.

I have 5 of the Nokia 5110 and i would like to play with them.

I'm sure you did a good work.

mister_e
- 29th June 2011, 01:31
You can work with them right now, everything here work as long as you're aware of some Macro limitations. Which PIC do you plan to use ???

BTW, I'll take no credits, all the job have been done here and well done. I just put some of my spices in, some user configurables settings and some ease of use. It will be like my Keypad routine (http://www.picbasic.co.uk/forum/showthread.php?t=3250&highlight=).

Still working on the final touch, code optimisation, documentation, some code example, basic schematics... fun job.

mister_e
- 29th June 2011, 02:19
i was trying to use pic16f628a.

I have seen over the internet some others they succeed with pic12f629
Note to self, always read previous posts :D sorry 'bout that...

ruijc
- 29th June 2011, 10:53
Hi Steve,

you are right about being able to using it except of some Macro limitations.

It works like a charm with the 16F88 microcontroller IF i dont use the "@ PrintStr x,y, "string goes here"" :) . But...IF i use that i get the truncated errors.

Regards