Hi,
I've just tried to explain you you were reading your outputs instead of the inputs ...
Of course, MPSIM has some trouble with that !!!
Alain
Hi,
I've just tried to explain you you were reading your outputs instead of the inputs ...
Of course, MPSIM has some trouble with that !!!
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
The HIGH and LOW commands automatically set the respective pins to outputs....but the few input statement still won't work....
Also, PIR is a named register on PICs. You might not want to use that name for a variable. Might mess you up in the future. Same with RESET (could be confused with the MCLR function somewhere sometime) and ACC (some might confuse that with Accumulator).
Hi, Skimask
the "reserved word" is PIR1 ... then, no Pb with PIR.
Now look at output initialisation :
- the named outputs are declared as inputs in the TRIS ... and vice-versa.
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi, Skimask
You know what ???
I really DO HATE "tuning" ....
LOL
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
More to try
1)Turn the Comparators OFF to get PORTA to work as intended
2)You set all of PORTA inputs here but make them outputs in your codeCode:TRISA = %11111111
3)You got the comment backwards (0=output, 1 = Input)Code:TRISB = %11000000 'portb.6 and .7 out puts all others in put
4)Remember RA4 is open drain so it needs a pullup on your real circuit
5)
Oh, and it it were me, I would start with this and make this work with the Simulator
Post back after you try some of theseCode:TRISB=1 MAIN: IF PORTB.0 = 1 then PORTB.1=1 ELSE PORTB.1=0 ENDIF GOTO MAIN
Paul Borgmeier
Salt Lake City, UT
USA
__________________
I have made these changes:
1 trisa is now %00000000
2 trisb is now %00111111
3 pir is now pirin this should reduse any confusition.
Would this be correct? I will later change armed from porta.4 to portb.6 to not have to use a pull up resister and reduse current draw to a min.
Now that i have the input output thing fixed, I have determined that the program is hanging in the "pause" statments, is there a trick to get thes to work? I changed them to "pauseus" and everything seem to be perfict. Thank you to all that help this noobe.
Bookmarks