Confusion and possible bug on 16f876


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    that's really strange... i use this PIC since many times and never see that problem but can you confirm those...
    1. Is your supply line clean and properly filtered (0.1uF close to your PIC)?
    2. If on a bread-board and you use crystal, did you try to remove those capacitor around the crystal?

    looks more an hardware problem. Unsufficient supply line filtering, VCC drop when you have too many load on PORTB OR your total current on a PORT exceed the maximum rating of the PIC.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    May 2005
    Posts
    33


    Did you find this post helpful? Yes | No

    Default information..

    just wat i've experimented lately... if u dnt set the tris register as in setting it to output it wont output high by doign portb.x = 1

    i foudn thsi out frm the matrix keypad example of lab-x1.

    for example if u do this:

    portb = $ff
    trisb = %10101010



    u get the even bits high... correct me if i'm wrong
    i've always tot tht u haf to set the tris b4 outputting something and this discovery has been very useful.

    sorry guys if u already knew bout this. just an info for those who doesnt
    Last edited by nimonia; - 20th May 2005 at 16:35.

  3. #3
    Join Date
    Oct 2004
    Posts
    46


    Did you find this post helpful? Yes | No

    Default Continuing saga

    My supply voltage lines are clean to the PIC and I have a .1uf cap sitting next to the Vcc pin. The board I am working with is a board I had built by PCBExpress so the crystal and other components are not mounted on a breadboard. My total current useage for all componenents on the board is less than 30mA.

    Some background...
    A month ago I built a board using an 16f876. PortB Pins1 & 2 were used for communicating with an AT45 memory chip using ShiftIn and ShiftOut. My memory would sporadically lose data I was sending to it. It didn't happen all the time. It was one of the horrible random things that would occasionally happen. I spent weeks going through the code and electronics trying to narrow the problem down. I finally gave up and redid the board. Now I am having trouble with the same pins which in this version are being used to simply turn on and off power to some components. The memory is working fine in this version. When I add two and two together the culprit seems to be these two pins... all the others work fine.

    In any event, I will try out the TRISB method tonight and post the results.

    Kind Regards,
    Eric Berg

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