Blink.bas Program


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    14

    Question Blink.bas Program

    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.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I think I'll just quote the manual on this:
    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).
    There's more info in the manual....

    /Henrik Olsson.

  3. #3
    Join Date
    Feb 2007
    Posts
    14


    Did you find this post helpful? Yes | No

    Question

    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.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Talking Rtfm !!!

    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 " !!!
    *****************************************

  5. #5
    Join Date
    Feb 2007
    Posts
    14


    Did you find this post helpful? Yes | No

    Talking

    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.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  3. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 14:51
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts