How does the blink.bas program know to use port b without now trisb or port commands, just high or low, and how can it be changed.
How does the blink.bas program know to use port b without now trisb or port commands, just high or low, and how can it be changed.
Hi,
I think I'll just quote the manual on this:
There's more info in the manual....HIGH Pin
Make the specified Pin high. Pin is automatically made an output. Pin may be a constant, 0-15, or a variable that contains a number 0-15 (e.g. B0) or a pin name (e.g. PORTA.0).
/Henrik Olsson.
I read the manual. Here is the program, i still don't understand this with Microchip Pic 18f4520.
loop:
High 0 ' Turn on LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds
Low 0 ' Turn off LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds
Goto loop ' Go back to loop and blink LED forever
End
Tell me what, in this program, states PortB pin 0. How is it configured?
Last edited by merlinknight; - 8th March 2007 at 02:42.
Hi,
NOooooooo,
You didn't read your manual ... have a closer look to the TABLE in § 4.11 "PINS" ... page 26 Bottom.
Everything explained ...
Now, for your own sake ... much better to Write " High Portb.0 " !!!
and FULLY use the example shown in page 6 ... of the Manual !!! not that from a STAMP example ... even if compatible.
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 " !!!
*****************************************
Thanks for the reply. I did not look at that table because of it saying BASIC stamp.
You are correct. That is the area to explain the reason it works.
I will go back and read the manual again this time not skipping info on BASIC STAMPS just i ncase i run into this problem again.
Thanks,
Merlin Knight
Last edited by merlinknight; - 8th March 2007 at 02:54.
Bookmarks