Author Topic: Why does the PIC slow down when I connect some current loads?  (Read 2300 times)

0 Members and 1 Guest are viewing this topic.

Offline Tricka90Topic starter

  • Regular Contributor
  • *
  • Posts: 50
Why does the PIC slow down when I connect some current loads?
« on: October 09, 2013, 08:02:40 am »
I'm making a PIC controlled LED lamp. I'm noticing that every LED I add to the circuit the PIC program slows down more. Why is it happening and how can I work around this problem?
I'm using a PIC 16F876 with 12MHz chrystal oscillator.
If you need more information I'll be happy to give them.
 

Offline ve7xen

  • Super Contributor
  • ***
  • Posts: 1193
  • Country: ca
    • VE7XEN Blog
Re: Why does the PIC slow down when I connect some current loads?
« Reply #1 on: October 09, 2013, 08:31:08 am »
Are you changing the code when you add an LED? If the PIC is clocked from a crystal it won't appreciably change speed just because you've changed the load on its IO pins. Something in your code has changed, or is behaving differently, when you're adding the LEDs.

Posting your code may help.
73 de VE7XEN
He/Him
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Why does the PIC slow down when I connect some current loads?
« Reply #2 on: October 09, 2013, 10:30:36 am »
Quote
I'm noticing that every LED I add to the circuit the PIC program slows down more.

You must be living in an alternate universe, :).

Seriously, what exactly did you observe that led you to  that conclusion?
================================
https://dannyelectronics.wordpress.com/
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9951
  • Country: nz
Re: Why does the PIC slow down when I connect some current loads?
« Reply #3 on: October 09, 2013, 10:46:18 am »
My guess is he's doing some sort of matrix or pwm
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Why does the PIC slow down when I connect some current loads?
« Reply #4 on: October 11, 2013, 08:19:06 pm »
If you are running from internal oscillator, or any other external crystal which requires schmitt triggering, and the LED's are directly on the pic pins you might be exceeding maximum current limits.
Causing voltage drop, causing oscillator artifacts.
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Why does the PIC slow down when I connect some current loads?
« Reply #5 on: October 11, 2013, 10:17:34 pm »

If you are running from internal oscillator, or any other external crystal which requires schmitt triggering, and the LED's are directly on the pic pins you might be exceeding maximum current limits.
Causing voltage drop, causing oscillator artifacts.

I agree with your assessment.  All PIC FRCs have voltage for speed requirements.  You may be browning out the chip slowing the FRC OSC or even triggering the BOR whenever you turn on too many LEDs.  Either way it is starving for attention (pun).  :-)
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Why does the PIC slow down when I connect some current loads?
« Reply #6 on: October 11, 2013, 10:35:25 pm »
Quote
My guess is he's doing some sort of matrix or pwm

Yes, likely polling.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf