I believe you have to add a 'wait' statement for quala and qualb.Originally Posted by Michael
PORTB.0 = SWITCH.0
PORTB.1 = SWITCH.1
PORTB.2 = SWITCH.2
What is the above?
Is it supposed to be
'IF switch = 0 then
portb.0 = 1'
???
I believe you have to add a 'wait' statement for quala and qualb.Originally Posted by Michael
PORTB.0 = SWITCH.0
PORTB.1 = SWITCH.1
PORTB.2 = SWITCH.2
What is the above?
Is it supposed to be
'IF switch = 0 then
portb.0 = 1'
???
I have other software that works fine without a wait in it...that's not to say it "should be there".....learning is a neverending process with Picbasic because there are no decent learning guides.
IE...I just bought the Chuck Helebuyck book and it says nothing more than anything else I've read.
I could write it both ways....
if switch.0 = 1 then
portb.0 = 1
else
portb.0 =0
endif
BUT again, I have software I've written for the 16c65b that woks just fine
with...
portb.0 = switch.0
I still don't understand. The way you have it written, SWITCH is a variable you are getting from your SERIN routine?? So, I will assume that you are setting a bit on the transmit side on say...portb. Then you are reading portb, and sending it as a variable. On the receive side just make PORTB = SWITCH.
Now open the PBP manual and look up SERIN. There should be an example of a wait statement. If not, use SERIN2. Copy it verbatim and do not substitute "[" for "(" or vice versa. If you don't, don't be at a loss why it does not work. These things are fussy about syntax.
Ron
yes switch is a variable (switch contacts on xmtr)
like I say, the software as I have shown....
SHOULD WORK
why it doesn't has me perplexed.
switch or switch.0 same thing....may be redundant but that's not what I need to know.
Hi Michael,
I thought I had an idea but I didn't read enough of the datasheet.
BobK
Last edited by BobK; - 22nd February 2006 at 04:34.
Well, as it turns out, the code on this post was fine and it works with no problem. I don't want to seem like a bozo so I had to post the facts. As it turns out, it was the problems I was having with my new EPIC programmer and trying to install meprog.
I discussed it with Jeff at Melabs and he confirmed there has been "some" compatibility problems.
I spent 2 days trying to get meprog to work right and it's what I was using when I tried to program the code in this post.
EPICwin on the other hand is flawless and I can look forward to learning from all of you and enjoying these 16F628 chips that were recommended.
Sure beats the OTP parts.
FYI.
Bookmarks