PORTB.0 Insanity


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Location
    Tempe, Arizona, USA
    Posts
    3

    Cool PORTB.0 Insanity

    Ok, I'm using a PIC18F8722. Whenever I change the state of ANY pins on portb, I end up with portb.0 going high and staying that way. If I set portb = 0, then pause 1000, I end up with portb.0 staying low for a second then going high again at the end of the pause. I already tried "INTCON2.7 = 1" to disable the pullups. I don't have this problem on any other pins or ports. What am I missing??? Any help would possibly save my sanity and my marriage. No pressure.

    -Mark Richards

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mokeymark View Post
    Ok, I'm using a PIC18F8722. Whenever I change the state of ANY pins on portb, I end up with portb.0 going high and staying that way. If I set portb = 0, then pause 1000, I end up with portb.0 staying low for a second then going high again at the end of the pause. I already tried "INTCON2.7 = 1" to disable the pullups. I don't have this problem on any other pins or ports. What am I missing??? Any help would possibly save my sanity and my marriage. No pressure.

    -Mark Richards
    Strange - Have you set TRISB = 0?

    What happens if you set the latch instead of the PORT? e.g., use "LATB = 0" instead of "PORTB = 0"

    What is connected to RB0?

    Are you using interrupts? (Is INTCON.7 = 0?)
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Aug 2007
    Location
    Tempe, Arizona, USA
    Posts
    3


    Did you find this post helpful? Yes | No

    Question Portb.0

    I'm using an interrupt on USART:

    INTCON = %11000000

    The program is running through a loop, waiting for something to show up on the serial port. I'm using a CASE statement, so when I get particular data received on the first serial port I do a TRISx = 0 (where x = the port in the CASE statement) and set the appropriate I/O's HIGH or LOW.

    I'll try the LATB = 0 when I get back in the lab.

    Thanks,
    Mark

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Sounds like an OSC issue to me.

    ===================
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    Still strange and still reaching here .... a long shot but it sounds like TRISB.0 could be getting changed somewhere during or after the Pause (by an erroneous interrupt?) – do you have an LCD hooked up where you can output the value of TRISB after your Pause that resets RB0 high?. The thought being you could monitor and see if it is getting changed. If you do not have an LCD or similar, you could put some lines like this in code AFTER the PAUSE for debugging purposes.

    Code:
    IF TRISB.0 = 1 THEN
    	High PortB.7	' or whatever pin you have available
    ELSE
    	Low PortB.7
    ENDIF
    Pause 10000     ' measure PORTB.7 and see how TRISB.0 is set
    Let us Know

    Sounds like an OSC issue to me.
    Sayzer ... OSC???? - I am interested in your theory – can you explain?
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  6. #6
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier View Post
    ....

    Sayzer ... OSC???? - I am interested in your theory – can you explain?
    When I worked with PICs with different internal OSC frequencies, like PIC18F8722, I had similar problems with latching PORTs.

    I am not sure if Mark is using Internal OSC but what he is having sounds like it.

    Mark, what is your OSC setting?

    =============
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Help with Count PORTB.0
    By jetpr in forum General
    Replies: 3
    Last Post: - 26th September 2008, 06:43
  2. reducing shiftout clock freq and PS2/PC interfacing ....
    By wireless magic in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th February 2008, 20:15
  3. my boxing timer
    By hoops2006 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th September 2007, 19:07
  4. PORTB vs PORTB.0
    By xzolian in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 4th March 2007, 00:33
  5. 2 interupts - portb.0 rising and falling edges
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th July 2005, 01:10

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