Strange behaviour from PIC16F877 on TMR0


Closed Thread
Results 1 to 19 of 19

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Maybe the Mister_E to english dictionnary will be needed here

    OR your power supply is not good enough to provide more power. Assuming a spike when you need more power, the voltage may decrease enough at the input of the 7805 to make this one unable to provide the stable 5Volt at the output. If the output of the regulator drop under the Brown Out voltage of your PIC, it may badly reset the PIC and send the PC to an unwanted program location. Hence do some strange behaviours.

    How about if you use another transformer (let's say wall wart) to drive your PIC?

    I'll have a look to your schematic.. maybe i could find something in.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default About the power supply

    Thank you mister_e for the answer.
    I forgot to mention that I'm using a commercial switching power supply for the logic that is able to deliver 4A at 12V. Then I slow down from 12V to 5 with the LM7805. The power supply is really bigger than my needs.
    But let me explain what I've discovered next:
    The board that is "misunderstunding" the pulses is inside a big metal case. This big metal case is connected to the earth ground throught the switching power supply, BUT not to the GND of my boards.

    Then, when I was making my tests, a personal computer inside this big case was running in the same time. Then I was experiencing the erratic behaviour as I told you.
    I found that the personal computer inside the case was running by ANOTHER power extension that DOEN'T HAVE any earth socket!
    Now, I'm running this PC with the earth ground connected and SEEMs that this erratic behaviour is disappeared.
    I Hope...

    There is a logic in this?

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


    Did you find this post helpful? Yes | No

    Default

    Every missing earth or else ground could do something. Without seeing the whole it's a little bit hard but maybe you got one of the possible cause.

    Ground bouncing, ground looping is sometimes hard to find... Well keep us posted.
    Finger crossed!
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Filters!

    Oh boy...
    MAYBE I've discovered WHY so strange behaviours...
    I was supposing that my DC motors provider got me a couple of motor with filters capacitors inside (just like the invoice said).
    Instead I've found that NO CAPACITORS was inside the motors.
    Now I've mounted a couple of motors with capacitors inside and still seems that anything is working...
    The motors without the filter capacitors was a couple of big one that are not in the schematic I've posted, and seems that the disturbances are coming from the board that drive in PWM locked anti-phase these 2 motors.

    Anyway, Steve, some good suggestion on PCB design to avoid disturbance as much is possible?
    I'm using for the PWM section two LMD18201.
    These 2 drivers are very close to the regulator section...
    There is a ground plane on both side of the PCB connected to the logic gnd.

    Thank you.

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


    Did you find this post helpful? Yes | No

    Default

    probably something like that
    http://www.picbasic.co.uk/forum/show...14&postcount=3

    and keep driver far from the regulators. Well, my idea.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Filtering

    Thank you Steve.
    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
    - i'll screen the PIC and controller section properly to avoid incoming noise and spikes
    - i'll insert a bead on the PIC gnd line

    Regards,
    Mike.

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


    Did you find this post helpful? Yes | No

    Default Side note

    Mikebar
    Just a side note of 2 more things to try.
    Are your encoder lines shielded? And If strong magnetic field is near the hall effect device it might cause it to saturate, maybe move it away from the motor to the other end of driven shaft?

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