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.

new to Pic Basic Start help plz

Status
Not open for further replies.

janosandi

Full Member level 4
Full Member level 4
Joined
Jan 23, 2010
Messages
210
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,788
new to Pic Basic Need help plz

hello guys
what's wrong with this simple code?
as i guess it must keep at label "circoff" until portc.1 = 0 right ?
its not & jump to mainloop always

Code:
circoff:     
     if PORTC.1 = 0 then
     gosub   mainloop
     goto circoff     
     endif
thx for help
 

Re: new to Pic Basic Need help plz

Hello Janosandi,
Of course you should set the fuse-bits and config everything at header before anything else. You would add these below lines to your code lines:
Code:
TRISC.1=1           ;Set the C.1 as an input pin

Definitely, a pull-up resistor should be ( you've set this pin as low active!) on C.1

And if you don't mind share your mainloop segment here.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top