pasm input to output of an external clock
Jkane
Posts: 113
Hello,
I have a question
I have an external clock, 33Mhz, MX045T, which has the enable switch, I use pin 0 from the propeller to turn on the enable of the MX045T, which turns output of the external clock on and off, which works fine, so I turn the switch on for 20 us and off for 500 us and so forth and I get clocks of chucks of 33Mhz, but the problem I am having is the off time, 500us, the output which is not going thru the propeller is low, and for this project I need it to be high.
so what I did was purchase a hex inverter, and send all the data thru that, and this "kind" of works, but once in awhile, I get low's for the 500us, which messes up the device I am sending it to, the problem is the last pulse from the external clock could be high or low, and therefore the inverter sets the next 500us to high or low.
so I think what I need to do is send the output from the external clock back into the propeller, letting the 33mhz data flow thru and then making the output high during the 500us times.
so what I think should happen is: (for example)
:movedata
test would be
if enable pin high (pin 3) (then don't do anything)
input pin (pin 5 -33mhz external clock data) => output pin (pin 6 -33mhz external clock data)
if enable pin low (pin 3) then make output pin (pin 6) high and exit loop
jump to movedata
another idea would be make a 33Mhz clock with the propeller, which I have not had much luck with. I'm currently running a 6.25 Mhz crystal rather than the 5Mhz crystal, I tried NCO but could not get exactly 33Mhz which is 30ns, but I can go back and try again and this would be a better solution.
regards
Jeff
I have a question
I have an external clock, 33Mhz, MX045T, which has the enable switch, I use pin 0 from the propeller to turn on the enable of the MX045T, which turns output of the external clock on and off, which works fine, so I turn the switch on for 20 us and off for 500 us and so forth and I get clocks of chucks of 33Mhz, but the problem I am having is the off time, 500us, the output which is not going thru the propeller is low, and for this project I need it to be high.
so what I did was purchase a hex inverter, and send all the data thru that, and this "kind" of works, but once in awhile, I get low's for the 500us, which messes up the device I am sending it to, the problem is the last pulse from the external clock could be high or low, and therefore the inverter sets the next 500us to high or low.
so I think what I need to do is send the output from the external clock back into the propeller, letting the 33mhz data flow thru and then making the output high during the 500us times.
so what I think should happen is: (for example)
:movedata
test would be
if enable pin high (pin 3) (then don't do anything)
input pin (pin 5 -33mhz external clock data) => output pin (pin 6 -33mhz external clock data)
if enable pin low (pin 3) then make output pin (pin 6) high and exit loop
jump to movedata
another idea would be make a 33Mhz clock with the propeller, which I have not had much luck with. I'm currently running a 6.25 Mhz crystal rather than the 5Mhz crystal, I tried NCO but could not get exactly 33Mhz which is 30ns, but I can go back and try again and this would be a better solution.
regards
Jeff
Comments
-Phil
currently, just to make sure I understand, currently I connect the output of the external clock to the inverter ic, which inverts the signal, and the output is sent out to my device that receives it and the propeller is used to just activate the enable pin on the mx045t. there is no connection between the propeller pin, used to enable the external clock, and the output of the external clock, which allows the 33mhz data to flow thru the inverter ic (hex inverter) , so you suggest replacing the inverter ic with a nand gate ic, and sending both the enable pin (from propeller) and the external clock to the nand and the output would be high when required. (enable disabled)
so
external clock input| enable pin | output from external clock
0 0 => 1
0 1 => 1
1 0 => 1
1 1 => 0
that should do it. thanks, I'll update when I get the ic.
Jeff
ok, yes tri-states, high low and float, I'll add a 10K pull down resistor on the output of the 33mhz clock to pull it low prior to the inverter. I'll check the pulses, from what I have seen so far they seem to be fairly accurate.
I'll get back on what happens
regards
Jeff
Yes, tuning it is tricky, I haven't tried it since using th 6.25 Mhz crystal, before I was getting close, I think +/- a few ns, but I probably did it wrong, so I'll try again, so far there are three things I can do
1) get an nand ic
2) pull-down resistor of output of external clock
3) propeller 33Mhz clock using freq register, and full control
i'll try all three and get back
regards
Jeff
If clkfreq=66MHz, the NCOburst object could generate a programmable number of complete pulses at 33MHz. It uses overlap of ctra and ctrb to so that. The output would be high when not generating pulses.
(Sorry I don't know where to procure an 8.25 or 4.125 MHz crystal!)
I tried many pull-down resistors, 27K, 10K,8K,6k,5.2K, 3K,1K and 200 ohms, but the signals did not stabilize, sometimes more interference, sometimes less, but none were as good as no resistor at all. anyway, will try the nand ic, should be here Monday.
regards
Jeff
you can get the 8.25 at digikey, probably the 4.125, but changes the crystal will induce other timing issues,so I'm heading towards the nand ic, other things that I can try is running the input of the external clock into the propeller and the using nand gate logic to correct the output, or use a transistor to turn on the output, but odds are that that won't work. since the transistor will just be a replacement for the enable bit on the external mx045 clock.
regard
Jeff