SX20 as clock/sync source for other devices?
T Chap
Posts: 4,223
I have two devices I want to sync, once device needs to clock out of phase.
The devices requires a minimum of 150uS on time on the positive clock phase, one turns on while the other turns off simultaneously. The max on time is 150ms but the faster the better.
Considering potential variances of times using discreet components, I was thinking to use the SX20 and two pins off of it to to the clocking.
Is the SX20 capable of near 150uS on times, and would it's own internal clock be adequate to insure an On time safely above 150uS?
Considering the cost of an inverter IC and discrete components, the confidence of a known(semi known) clock rate might make sense using the SX. It would be great not to need to add the resonator, but I can't tell from the data whether these speeds could be obtained with out one.
Thanks
The devices requires a minimum of 150uS on time on the positive clock phase, one turns on while the other turns off simultaneously. The max on time is 150ms but the faster the better.
Considering potential variances of times using discreet components, I was thinking to use the SX20 and two pins off of it to to the clocking.
Is the SX20 capable of near 150uS on times, and would it's own internal clock be adequate to insure an On time safely above 150uS?
Considering the cost of an inverter IC and discrete components, the confidence of a known(semi known) clock rate might make sense using the SX. It would be great not to need to add the resonator, but I can't tell from the data whether these speeds could be obtained with out one.
Thanks
Comments
If all you want to do is simultaneous alternating phase clocking on two channels, it takes a loop of only two instructions consuming four clock cycles, and the SX family can easily do that at speeds up to 12.5 MHz (80 nano seconds on and 80 off) with a 50 mHz resonator. Using the internal 4 mHz oscillator, the best you can get is 1 MHz (1 micro second on and 1 off).
As for slower; with a down counter you could program it to do almost any loop multiple slower.
Cheers,
Peter (pjv)
I am not an SX expert but have used a few some years back, is the speed I need something capable with SX-B?
I have spent a lot of time on Google looking at clock circuits and clocking IC's, and so far have not seen a simpler option than on SX20 smt with no external resonator or xtal. I wouldn't want to trust RC based discrete stuff for the life of the product.
Thanks
All you need to do is configure the chip to activate the internal oscillator, and disable the interrupts. Then make the two chosen port bits outputs, an load them with opposing values, one a zero, and the other a one. Then load the w register with bits set to match the positions of the chosen port bits. Next create a loop that XORs the w register into the output register, and you're done.
For example, using port B, bits 3 and 0;
··········· setb···· rb.0
··········· clrb····· rb.3
··········· mov···· w,#%0000_1001
Loop··· · xor······ rb,w
··········· ········· (in-line here put some other dummy instructions or a counter·to slow things down)
··········· jmp····· Loop
············
Now if you need to do other things such as SX/B simultaneously, things get a lot more complicated, and if you need the frequency continuously and at a steady pace, then it migt become very difficult without a real time O/S.
Those exist of course (see my Parallax contest entry of two years ago), but depending on your needs, is very much more complicated than this simple example which answers your original question.
Cheers,
Peter (pjv)
Considering you estimated that @ 4mhz and 4 lines = 1uS, just add something in there to delay it till it looks right and I am set.
Are unused pins OK left as is or should they be set to outputs to avoid floating as inputs?
Thanks
Post Edited (Originator) : 10/15/2008 7:34:55 AM GMT
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
http://forums.parallax.com/showthread.php?p=655817
http://forums.parallax.com/showthread.php?p=722736
The circuit is straight forward, 3v3 on the SX20. I used a 6volt power supply into an SK Key Ring, and the Key Ring regulator is outputting 4.59 volts. On attempting to program, I get a red light on the USB cable only if it is not plugged into anything, but get RED and green activity for a split second if it is plugged into any device.
I can measure 3v3 on the SX20, it also has 3.3 on the Osc2 pin, and approx .2 on Osc1.
The power is connected to the SX and metered at each pin.
I cam meter the 4.59 volts from the Key Ring getting up into the SX Key/Blitz on Vdd, as well as 3v3 on the Osc2 pin in the Key/Blitz, so everything seems connected all the way to the chip.
Using either device, there is the error always that says ' No Sx Key found on port 5". I have tried two computers that have formerly programmed SX's, one with serial port, and the lap top with USB serial adapter that works fine on the Propeller.
Any suggestions would be great.
If these programming devices are blown, then that makes 3 dead ones. One of my own, and two I Just borrowed from a friend today. I wonder what buying another one today is going to solve if I just blew these two borrowed ones? Are they really that fragile?
In the circuit, the 3v3 on the header is not really getting to the SX KEY, as the Key Ring does not allow it to get in, rather the 4.59v from the regulator powers the SX Key or blitz.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
Everything checks out from the Key ring to the pins of the SMT SX20.
Post Edited (Originator) : 10/15/2008 8:22:49 PM GMT
I was told in one thread when asking about the power to the SX KEY RIng to use 5 v, as well I had Googled the Key ring yesterday and read another post by Gunther that 5 volts was required on the Key Ring. I was using 6. I tried 12 just now and finally got it to program. Thanks for the suggestions guys. Now I understand it is a power issue. 5 volts may work, but it must require a hefty supply, probably 1amp and up.
Post Edited (Originator) : 10/15/2008 9:21:04 PM GMT