Out of SYNC?.....
Out of SYNC?.....
Dave Purola,
N8NTA
EN82fn
Not sure what "out of sync" means either. I doubt the transistors are causing much of a problem and the original idea/suggestion was to ensure that the transistors were driven hard enough to light the LED's. A schmatic/drawing would help if possible. Just an idea, maybe using "HPWM" to set your frequency might help? Perhaps even a combination of "HPWM" and "pause"? Yes I was talking about using 2 transistors. My guess is that you are placing your LED's on the emitter side of the transistors and not the collector?
Hi, Ramius
I see 25 pf as emitter capacitance ... ( see datasheet - Philips p.5 )
Also have a look to the used components for the switching time tests ...
Your comments ???
Now ... your delays are quite long ... could you tell what make you call them " false " ???
But looking at your program closer ... The false delays are obvious - but for some µs only @ each loop ...
do not shoot your transistor, but your program lines ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Alain - are you posing your questions to me or to Ramius? This thread was started by me so I don't know what you mean by 'false'. The PAUSEs (approx. 1.5 secs while LED is high, 0.5 secs while low) are the whole point of the circuit - I'm using a PIC to create blinking lights which match an existing model.
Here's the schematic:
Both PICs are programmed with the same code. For about a minute or so after connecting the power, they both blink their LEDs at the same time but slowly get out of sync (one starts flashing before the other) after about 1.5 minutes. Since I'm trying to create EXACT on/off timings, it looks like if I use a transistor (which I need to do as this circuit will light 4 white LEDs) then I have to do this by trial and error rather than relying on the values in the PAUSE command.
Those look like ceramic resonators. (?) The ceramic resonators aren't that accurate and I bet that the actual frequency differes ever so slightly between the two so your timing drifts. Capacitance in the breadboard may also have an effect on tha actual frequency.
If you really need to keep them in sync then I'd suggest driving both PICs from one oscillator or sync them thru one of the spare I/O's but I suspect that's not physically possible (?). Next suggestion is to use crystals instead of resonators, moving on from there there's almost no end to how much you want to spend to be accurate - temperature compensated?, oven controlled?, rubidium? - you name it.
/Henrik.
EDIT: I looked at a couple of resonators and they had a frequency tollerance of +/-0.5% typically. If you're unlucky and get one at +0.5 and the other at -0.5 (very unlikely but still) the difference between the two is 1%. Your 1000ms delay becomes 995ms on one and 1005ms on the other.
Last edited by HenrikOlsson; - 19th April 2012 at 06:24.
I agree with Henrik, that syncing PIC's is the easiest way to proceed.
If you use internal 4MHz OSC in master PIC and set GP4 pin to provide Fosc/4 out, then your system will be in sync. Rest of the PIC's will use master PIC clock as reference.
Two totally independent systems are always out of sync, already from the beginning. Difference might be small at the beginning, but....
Last edited by Gusse; - 19th April 2012 at 07:48.
It should be easy to prove to yourself it has nothing to do with the transistor - make the second circuit exactly like the first and observe how EXACTLY the same loss of sync happens.
Having 2 unrelated free running oscillators stay in sync is not a reasonable expectation. (Oscillators 101)
It can be EASY to check the OUT OF SYNC problem by having ONLY 1 of the PIC's with a resonator running and use the OSC output from the one running the resonator connected to the OSC input of one with out a resonator. There by both PIC's will be running at the EXACT same frequency. Unless there is some difference in the code running on each PIC they should not fall out of sync.
Dave Purola,
N8NTA
EN82fn
Bookmarks