Hi Tony,
When you use the HIGH or LOW commands with numeric pin specifiers like 0,1,2,3 etc,, it starts from RB0, and continues on to RC7. With 0 being RB0 and 15 being RC7.
Of course you can still use HIGH PORTB.0 too, but if you use the HIGH or LOW commands for port pins other than RB0 to RC7, then you can't use numeric pin specifiers.
You would specify port pins like this -
HIGH PORTA.0
HIGH PORTA.1
HIGH PORTD.1
etc,,.
If you specify an illegal bit # with one of these commands such as HIGH 16, PBP returns the error "illegal bit number".
Using numeric pin specifiers like HIGH 0, LOW 0 rather than HIGH PORTB.0, LOW PORTB.0 comes in handy.
Example;
Code:X VAR BYTE MAIN: ' LED Light chaser on RB0 to RC7 FOR X = 0 TO 15 ' Light LED's on RB0 to RC7 HIGH X PAUSE 50 NEXT X FOR X = 15 TO 0 STEP-1 ' Turn them back off LOW X PAUSE 50 NEXT X GOTO MAIN




Bookmarks