Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

picbasic programming problem !!!

Status
Not open for further replies.

omid_juve

Full Member level 1
Joined
Jul 1, 2007
Messages
97
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,990
12c508a picbasic pro

Hi
I wrote a simple basic program for my PIC (12c508A) in a Picbasic Pro compiler
but I have this error after compilation "unable to fit variable soft_stack"
please see my program below and tell me the errors as I am beginner in PIC programming .
Thanks


lowinput VAR GPIO.0
overtemprature VAR GPIO.1
overload VAR GPIO.2
outputpin VAR GPIO.3
green VAR GPIO.4
red VAR GPIO.5
count1 var byte
i var byte

OUTPUT outputpin
input lowinput
input overtemprature
input overload
OUTPUT green
OUTPUT red

while i=0
if (lowinput=0) and (overload=0) and (overtemprature=0) then

outputpin =0
High green
Pause 500
Low green
Pause 500

ENDIF


if (lowinput=0) and (overload=1) and (overtemprature=0) then

while count1<2
gosub overloadmode
count1=count1+1
wend
outputpin =1

while count1<7
gosub overloadmode
count1=count1+1
wend

outputpin =0
count1=0
ENDIF

if (lowinput=1) and (overload=0) and (overtemprature=0) then

while count1<5
gosub lowinputmode
count1=count1+1
wend
outputpin =1
count1=0
ENDIF
if (lowinput=0) and (overload=0) and (overtemprature=1) then

while count1<5
gosub overtempraturemode
count1=count1+1
wend
outputpin =1
count1=0
ENDIF
if (lowinput=1) and (overload=1) and (overtemprature=0) then

while count1<5
gosub overtempraturemode
count1=count1+1
wend
outputpin =1
count1=0


endif


wend


overloadmode:
High green
low red
Pause 500

Low green
high red
Pause 500
return

lowinputmode:
High green
low red
Pause 500

Low green
high red
Pause 500
return

overtempraturemode:

High green
high red
Pause 500

Low green
low red
Pause 500

return

end
 

Hi Omid,

First off OUTPUT is a reserved word and can't be used like you are using it. Second, GPIO.3 is an input only pin. You might want to goto www.picbasic.co.uk for additional assistance.

HTH,

BobK
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top