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.
Printable View
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.
Is your inc-file in the same folder where you have your main pbp-file?
If no, then you should include path to file before inc-file.Code:INCLUDE "LCD_3310v4.inc"
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-
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.
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/cont...Nokia-3310-LCD but no luck.
a very simple code i'm trying to display is the following.
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.Code: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 have also checked the nokia lcd with a circuit that work and didnt see a problem.
Maybe must to do this in your "LCD_3310.pbp" file :
I use a lot of 16F628A (and 648A) in my projects (see http://www.picbasic.co.uk/forum/show...204#post103204 and topic) and works verry fine !Code:'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
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.
with thisCode:Lcd_DC var PortB.0
Lcd_SDA var PortA.3
Lcd_RST var PortA.4
Lcd_CLK var PortA.2
Code:'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
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 !
i will follow your schematics,
i will post what error i get now after compiling the following program
Code: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
i get the following error
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.
@ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON
NO! that's PBP syntax, he must use MPASM syntax...
when i compile with PBP the following
i get the attached errorCode: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
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
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)
Seems you're out of codespace... choose another PIC (like PIC16F877) and see if this compile.
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.
Your PIC cannot use READCODE command.
.MAC -file contains:Quote:
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.
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.Code:READCODE?TB macro Regin, Bitin, Bout
MOVE?TB Regin, Bitin, EEADR
clrf EEADRH
L?CALL READCODE
MOVE?AB Bout
endm
READCODE_USED = 1
Also other note about READCODE
Quote:
For PIC16F devices, 14-bit-sized data can be read from word code space Addresses.
Variable cannot be WORD.Code:Addr VAR 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-
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.
You can always use the old way to print LCD
Instead of
useCode:@ PrintStr 0,0, "HELLO"
and remove "@ PrintStr" -part from LCD_3310 -file.Code: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_SendChar
BR,
-Gusse-
BTW, "Edit Post" time could be a little bit longer. Couple of hours would be OK. Any changes to get this changed?
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.
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.
Try this simple code ( http://www.picbasic.co.uk/forum/show...2927#post72927 ) , using 16F628A.
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.
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.
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:
The version of the INC file i use is the last one from that page.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
http://www.picbasic.co.uk/forum/cont...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,
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
Hi Ioannis,
i will also check the contrast number and play with it.
thanks
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.
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?
How to connect display...
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
Steve,
is the same. i like it more in blue.
The pinout are the same.
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.
Vop is a register in extended instruction set (see page 14, Set Vop)
http://www.nxp.com/acrobat_download2.../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.
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.Code:Lcd_Data= $c8: GOSUB Lcd_SendByte ' SET LCD Vop (CONTRAST)
BR,
-Gusse-
i have fixed the circuit from that page and work fine.
http://www.radiolocman.com/shem/sche....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.
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!
hi mister_e
i'm looking forward to see it. Thanks.
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
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.