Port Error, Someone tell me something


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2011
    Location
    Myanmar
    Posts
    11

    Default Port Error, Someone tell me something

    Hi my friends,
    I wrote my very simple program with pic basic pro version 2.6 and something went wrong. please check it my code

    TRISB=0
    Main:
    PORTB = 7
    PAUSE 200
    PORTB = 0
    PAUSE 200
    GOTO Main
    END

    I put 3 LEDs in RB0, RB1 and RB2, I want all 3 LEDs want to be on and off. Here is the problem, all LEDs are on, but no OFF.
    Someone can help me something? I used PIC16F628A with internal clock
    Last edited by serial_bug; - 23rd November 2015 at 00:13.

  2. #2
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Port Error, Someone tell me something

    check to make sure you set the port pins to be digital.
    As I remember they come default as analog.

    there is an include file called alldigital.pbp that you can include in your program that pretty much sets any PIC that you might use so that all the pins are digital

    http://www.picbasic.co.uk/forum/atta...7&d=1419358332

    that is if you know how to do an "include" file.

    sorry I am at work so no time to elaborate.

    go read this thread also...
    http://www.picbasic.co.uk/forum/show...ght=alldigital
    Last edited by Heckler; - 23rd November 2015 at 18:53.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  3. #3
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Port Error, Someone tell me something

    that is if you know how to do an "include" file.
    Sorry, as I read this now that statement seems arrogant, which is not what I intended

    I was just concerned that I was giving you a solution that you might not know how to take advantage of.

    To do an include you just simply place the statement somewhere near the top of your code...

    INCLUDE alldigital.pbp

    and make sure to then place that file in the same directory where your program is also stored.

    this then has the effect of inserting that file's contents into your program at the location where you made the INCLUDE statement.

    I hope you got it working.
    if not come back here there's lots willing to help.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  4. #4
    Join Date
    Feb 2011
    Location
    Myanmar
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Re: Port Error, Someone tell me something

    Thank you so much Heckler, I guess you give me library file "alldigital.pbp". I m going to test it. But I am ok right now. I could find the problem. I substituted new microcontroller ic 16f628 and it worked well. So I think it may be bad IC. But I would like to test the old bad IC with library file which you gave me. Thanks a lot Heckler

  5. #5
    Join Date
    Feb 2011
    Location
    Myanmar
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Re: Port Error, Someone tell me something

    Dear Heckler and forum friends
    Today I got the real solution. I gave wrong solution reply to Heckler. My problem is Brown-Out reset. When I was installing hex file in 16f628 I choose BODEN to enable. That's gave me error. When I Disable it . It's ok. all my IC are good. Thank you very much Heckler

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Port Error, Someone tell me something

    That's still a problem that should be addressed.
    If it's battery powered they might be flat.

Similar Threads

  1. ERROR line 90: Sintax error----> [TabIndex]
    By martintorres in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th September 2012, 05:29
  2. Replies: 1
    Last Post: - 30th March 2012, 05:13
  3. 18F2520 - problem configuring fuse for port B as digital port.
    By hwhisperer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th October 2010, 12:41
  4. LCD R/S works on Port A but not Port B
    By TDonBass in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th February 2009, 13:41
  5. Duplicating port input to port output
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th April 2004, 22:43

Members who have read this thread : 1

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