hello Tear,
Tear>>In this very simple code I am just trying to play with the if statement. I have set port A pin 0 to be an input and have it hotwired to be high. However, the led connected to port B pin 0 WONT TURN ON. The led for port B pin 1 is just a heartbeat. I know that my circuit is wired correctly, and I can't see anything wrong in this code. Any help would be appreciated.<<
*IF* this is your WHOLE code ( I say IF), where are your pin Flags?
I don't know what chip you are using, but many many chips have port A pins that have MULTIPLE functions... Thus the pin can do a A/D, it can do a Comparitor operation, and it can also do Digital I/O.
you need to assign these pins the function you want them to do. (Data sheet is helpful here!).
for example
TRISA =%00000000
TRISB =%00000000
This assigns all the Port A pins as output pins. Your coding tells me this is what you want....
But now, do your Port A pins have AD coverters and comparitors?? If so, you must turn them off!!
CMCON to disable the comparators and
ANSEL to disable your AD's
CMCON=7 will probably do it. this turns off the comparators
Ansel = 0 will assign all pins digital.
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks