Clock Trouble
edge87
Posts: 24
I need the whole propeller chip running at 80 Mhz , however a data sheet calls for a pin to send data at 8 mhz max. I'm having trouble doing the math to convert a delay that would accomplish this task. Thanks ahead of time for the help.
repeat outa[noparse][[/noparse]DotClock] := 1 waitcnt(????) <-- Trouble Spot outa[noparse][[/noparse]DotClock] := 0
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Also just so I understand. I understand it takes 4 ticks to perform a instruction. Would that be a 10 clock tick delay every time though the loop ? is that how that is calculated for future understanding.
As for the clock tick delay, yes, 10 cycles would be required for the whole loop. This means 5 each, low and high (as you toggle the clock line). But it has been pointed out already that SPIN is definitly too slow for this and assembler isn't everyone's cup of tea. But don't let that discourage you!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
1. You said a maximum of 8MHz. Is this the rate you plan to use?
2. What device's datasheet are you referring to?
3. What else accompanies the clock? Synchronous data? If so, there's a lot more that needs to be done than simply generating an 8MHz clock.
-Phil
1. I was assuming that 8 MHz would be the easiest to achieve. And since this is for a display I would prefer it to be faster.
2. The data sheet in question is here. It is a Vishay display.
http://www.vishay.com/docs/37006/apd128g.pdf
3. Yes I will be displaying data with another pin in this loop set above. I'm not 100% sure how I'm going to be sending the data as of yet. I'm still trying to determine if this is going to work on this platform before I do that. I do have it sort of thought through. I would declare some DAT section stuff with all the 1's and 0's laid out in 32 bit chunks as thats all a long can hold and i'd pull them in one by one and assign them to the pin as we go through the loop. But i'm not 100% sure on that part. So as a simple test I have the data pin set to 1 at the top of the code. This should give me a solid display with no flickering if i have done it correctly.
I really appreciate the help i have receive thus far. When I finish i'll be sure to contribute this to the Object Exchange.
Different example, a normal PASM instruction takes 4 cycles, each being 1/f = 1/80MHza = 12.5ns in length. Which gives you an average execution time of 50ns (average because there are longer instructions).
a Demoboard setup
My processor clock rate is 80,000,000 ticks per second.
i don't see how I divide 80 million into 150 ns and come up with 6.67 million. my units are getting mixed up. Or perhaps I'm backwards on this, How did 150 ns get multiplied to land at 6.67 million
There is no connection between anything propeller related and the 150ns. The datasheet gives you a cycle time for a display. Period. A cycle time can also be expressed as a frequency (1Hz = 1 cycle/s, cycle being low phase + high phase). Hertz are measured in cycles per second. A cycle with a length of 150ns fits 1s/150e-9s = 6.666.666,67 times into a second. Meaning a cycle time of 150ns is equivalent to 6.67MHz.
All I'm trying to say is that your suggested 8MHz clock is too fast. The display seems only capable of 6.67MHz. How this is achieved with the propeller is a different story.
Post Edited (kuroneko) : 5/25/2010 2:49:26 PM GMT
So now completing my understand if i was sending 128 bits , on a cycle of 6.67 Mhz it would take .000019199 seconds to complete. (cross multiplied and divided. 128 cycles X 1 second / 6,666,666.67)
Now that I'm though that, how would i go about picking the best clock to suit the requirement. I'm thinking of dedicating a whole propeller to the display just to avoid my core clock from having to be modified.
Anyway, generating the clock is just the tip of the iceberg here, but it's facilitated by the PLL circuitry in the Prop's counters, which can produce just about any frequency imaginable without having to divide the system clock frequency evenly.
-Phil
How do i use the PLL circuitry to set a freq?
I intend to just send all 1's so the display goes solid. then from there change it up a bit.
-Phil