Strange behaviour from PIC16F877 on TMR0


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default 1 more Idea

    I thought of one more thing, if your encoder wires are really long the capacitance of the cable may be rounding off the tops of the signal and the PIC just might not like that, in which case and amplifier may be required.
    Good Luck
    JS

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


    Did you find this post helpful? Yes | No

    Default

    Maybe better if using opto-coupler instead... just too keep power and logic away. Harder to light a led than introducing a noise wich will be amplified later. Well that's what i did as now.

    Quote Originally Posted by mikebar
    I had a look to the link you posted. Sound interesting, but exactly in which way you perform the points:

    - i'll ensure the PIC Vdd line is correctly filtered
    those usual 0.1uF and 10-47uF tantalum as close as possible of the PIC and as many 0.1uF as you have IC... one on each.. still as close as possible.

    Bigger cap (47-220uF) + 0.1 uF close to the driver ics...

    - i'll screen the PIC and controller section properly to avoid incoming noise and spikes
    Proper ground plane design, ground routing, Power lines routing and size against regular signals. Maybe use a grounded metal cabinet to fit it.

    - i'll insert a bead on the PIC gnd line
    When i deal with multiple Gnds (analog, power, digital) i often add bead core on most of them, usually 1 on analog, 1 on digital.

    Do a search for bead core, ground loop, ground plane, ground boucing and i'm sure you may learn a lot of it. It's long to explain and i'm sure i'll mess and miss something. There's pro and cons on each methods... same for ground plane. Sometimes they're usefull, sometimes not. If they're done correctly they're usefull, case not... it will cause you more bugs than benefits.

    EDIT: oh i forgot... never leave unused pins floating... tie them somewhere, VDD, VSS via resistor or not. Leaving them floating but setting them to output do nothing good. At least never pass my tests in cars applications.
    Last edited by mister_e; - 17th August 2006 at 06:17.
    Steve

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

  3. #3
    Join Date
    Aug 2006
    Location
    Italy
    Posts
    72


    Did you find this post helpful? Yes | No

    Default Ok

    Thank you very much Steve.
    Except the suggestion about the bead core and the unused pin set as input and never let them floating, I'm already using all your other suggestions.
    This mean that I'm in the correct road.

    I will try the your other two suggestions.

    Thank again you for your time.

    Best regards,
    Mike.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Another Idea

    I have one LAST Idea as to the source of this problem:
    As I understand their operation, a hall Effect switch outputs 1/2 of it's supply voltage in the on condition, so 5v in 2.5 v out, That's dangerously close to the logic low threshold of TTL, so any voltage drop in supply or signal and POOF no encodeer operation. Check the logic high voltage out of the Hall effect sensor and see what it is.
    JS

  5. #5
    Join Date
    Aug 2006
    Location
    Italy
    Posts
    72


    Did you find this post helpful? Yes | No

    Default Uhmmm...

    Quote Originally Posted by Joe S.
    I have one LAST Idea as to the source of this problem:
    As I understand their operation, a hall Effect switch outputs 1/2 of it's supply voltage in the on condition, so 5v in 2.5 v out, That's dangerously close to the logic low threshold of TTL, so any voltage drop in supply or signal and POOF no encodeer operation. Check the logic high voltage out of the Hall effect sensor and see what it is.
    JS
    Yes, this could be. I've attached the schematics to this thread. As you can see around T2 there is a network made by a transistor. I think that also 2.5V are enough to switch the transistor on/off (really are needed only 0.7V) and is this transistor that drive (by another filter made by zener) the PIC pin RA4. I'm right or I'm missing/misunderstunding something?

    Thank you.

Similar Threads

  1. Strange Behaviour - Simple code+DT_INT+16F676
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th February 2010, 19:53
  2. Strange Serout Behaviour
    By bluesmoke in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th August 2009, 05:12
  3. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 05:52
  4. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 16:10
  5. strange int behaviour
    By tom in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th November 2005, 16:41

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