PDA

View Full Version : problem with 2*16 lcd



ibra
- 29th April 2007, 08:45
hi...

i am a beginner in pic programming with picbasic...
i try to compile this code...but i have error message..

'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 23/04/2007 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
define lcd_dreg portd
define lcd_dbit 4
define lcd_rsreg portd
define lcd_rsbit 2
define lcd_ereg portd
define lcd_ebit 3
define lcd_bits 4
define lcd_lines 2





high portd.1

main:

low portd.1
lcdout $fe,1
lcdout "EMBEDED SYSTEMS pro."
pause 500

if portb.0=1 then l1
if portb.0=0 then l2

goto main

l1:
pause 500
lcdout $fe,1
lcdout "project1"
while portb.0=1
portb.1=1
pause 200
portb.1=0
pause 200
wend

return

l2:
pause 500
lcdout $fe,1
lcdout "project2"
while portb.0=1
portb.1=1
pause 600
portb.1=0
pause 600
wend

return
end

--------------------------------------------------------------------------

the error message is..

ERROR Line 61: Demo command limit of 31 exceeded. Time to purchase? (ibraheem.pbp)


what is the problem...and i need a solution !!!!

Archangel
- 29th April 2007, 08:58
hi...


the error message is..

ERROR Line 61: Demo command limit of 31 exceeded. Time to purchase? (ibraheem.pbp)


what is the problem...and i need a solution !!!!
It compiles without error on my non demo version, so the most probable answer is yes, "time to purchase".

paul borgmeier
- 29th April 2007, 09:04
Try this

define lcd_dreg portd
define lcd_dbit 4
define lcd_rsreg portd
define lcd_rsbit 2
define lcd_ereg portd
define lcd_ebit 3
define lcd_bits 4
define lcd_lines 2
main:
low portd.1
lcdout $fe,1, "EMBEDED SYSTEMS pro."
pause 500
if portb.0=0 then l2
pause 500
lcdout $fe,1, "project1"
while portb.0=1
toggle portb.1
pause 200
wend
goto main
l2:
pause 500
lcdout $fe,1, "project2"
while portb.0=1
Toggle portb.1
pause 600
wend
goto main
end

I didn't check the logic ... it should do the same thing you originally coded (except with a few errors fixed like changing your returns to gotos.

Archangel
- 29th April 2007, 09:16
Try this

define lcd_dreg portd
define lcd_dbit 4
define lcd_rsreg portd
define lcd_rsbit 2
define lcd_ereg portd
define lcd_ebit 3
define lcd_bits 4
define lcd_lines 2
main:
low portd.1
lcdout $fe,1, "EMBEDED SYSTEMS pro."
pause 500
if portb.0=0 then l2
pause 500
lcdout $fe,1, "project1"
while portb.0=1
toggle portb.1
pause 200
wend
goto main
l2:
pause 500
lcdout $fe,1, "project2"
while portb.0=1
Toggle portb.1
pause 600
wend
goto main
end

I didn't check the logic ... it should do the same thing you originally coded (except with a few errors fixed like changing your returns to gotos.
Compiled for a 16f877a the codes as listed: 320 words for Ibra's code 309 for Paul's.
Paul I think he is trying to compile using a demo version compiler and has too many lines of code for the demo version to handle.
I have not even looked at the code to attempt to see if it works. I only addressed his complaint of compiler error.
JS
Edit: Looks as if you addressed that problem too, you got it down to 29 lines so his compiler should do it :) Good Job! I gotta pay closer attention!

ibra
- 29th April 2007, 11:00
how to purchase??!!

malc-c
- 29th April 2007, 11:03
how to purchase??!!

http://www.crownhill.co.uk/level3.php?cat=40

mister_e
- 29th April 2007, 15:21
there's a few Melabs distributor, as you didn't mention your location in your user profile, it's hard to suggest the closest place.

I suggest to have a look at their distributor list
http://melabs.com/purchase.htm#Distributors