Running a Propeller with a 6 MHz Crystal.
Martin_H
Posts: 4,051
in Propeller 1
In my spare parts drawer I have a 40 pin propeller, a 3.3v regulator, various capacitors (.1, 10, 47, 100 uF), various resistors, and a 6MHz crystal. So I plan to breadboard a propeller circuit and see if the propeller chip works. Except for the Propeller backpack I've always used a 5 MHz , so I always use the standard clock multiplier.
My question is what happens when you use a nonstandard clock frequency? For example a 16x multiple yields a 98 MHz clock frequency, so if I try to generate composite or VGA video will it work?
What I ultimately plan to breadboard and then solder to a perf board is something like t PocketTerm:
http://www.brielcomputers.com/wordpress/?p=300
Note that I would buy it, but he no longer has any in stock, and I want something like this to free up my laptop when using one of my retro computers.
My question is what happens when you use a nonstandard clock frequency? For example a 16x multiple yields a 98 MHz clock frequency, so if I try to generate composite or VGA video will it work?
What I ultimately plan to breadboard and then solder to a perf board is something like t PocketTerm:
http://www.brielcomputers.com/wordpress/?p=300
Note that I would buy it, but he no longer has any in stock, and I want something like this to free up my laptop when using one of my retro computers.
Comments
CON
_CLKMODE = XTAL1 + PLL16X
_XINFREQ = 6_000_000
I took a quick look at the TV and VGA drivers and the timing appears to be done in clock cycles. You could multiply those constants by 1.2 (96/80) to run with a 6MHz xtal.
Reading through Vince's firmware it looks like he's using Oddbitcollectors from the Obix with minimal modifications. Cool, I think I can build most of this using odds and ends.
All my boards will run reliably at 6.5MHz (104MHz).
I also found all of the needed capacitors and voltage regulators. So next step is migration to veroboard.
http://www.mouser.com/ProductDetail/ABRACON/ABMM-6000MHZ-B2-T/?qs=sGAEpiMZZMsBj6bBr9Q9aWUu9Vmt5DeoeF7lUq6cMj4=
That link does not work. Can you repost it, please? Corrected.
-Phil
http://www.microchip.com/wwwproducts/en/DSC1001
To directly answer your question, any code that relies on a 80MHz clock for precision timing (such as RS-232 I/O) will probably be affected. The code may or may not self-adjust for the change in frequency.
Slower communication methods (and devices), such as I2C, might need adjustments.
I've had to adjust servo drivers because of a change in the clock.
Otherwise, zoom on!
Walter
Usually in SPIN Objects/Code the timing is based on clock freq. divided by whatever whoever needed it.
Especially all the serial objects. I do know of none not working with any combination of
_clkmode = xtal1 + pllXXx
_xinfreq = X_XXX_000
you choose.
Them usually just adjust the timing at compile time.
But the current used freq. is also saved at address 0 in HUB (if I remember correct) and should be changed when changing cock modes to ensure running software can adapt to the new clock freq.
Not sure how many serial driver do that.
Anyways, there is a way to write code that adjust to the current clock freq. and it is widely common in OBEX objects.
Mike
One weird thing. Vince Briel used an MAX232 for the TTL to serial which is a 5 volt part, and a 1K resistor on the RX lines. Normally when mixing 5 volt parts with the Propeller you use a 3.3K resistor, so that struck me as odd.
I substituted an ST232 which is pin compatible but uses .1 uF capacitors and it is much cheaper as well. But the 1K resistor did not work as the RX line acted erratic. So I pulled the power and used a 4.7K resistor which die the trick.
Honestly point to point wiring this thing is a drag, and I wish I could have purchased a PCB when Vince was selling them. But I am done with it now, so It OK.
The symptom is the monitor displaying "out of scan range 43.3 KHz/ 83 Hz." I imagine if I dove deep into PASM code I might be able to figure this own, but it is probably wisest to get a 5MHz crystal.
VGA.spin works fine for me with 5MHz and 6.25MHz crystals. You're probably just giving it bad parameters. Are you sure it doesn't think you're using a 5MHz crystal?
So I still think the VGA driver is incompatible with6 MHz or I can find the right knob.
When you start VGA.spin, you pass its start method a pointer to a whole lot of parameters. The last one is the pixel rate - what value are you using for it?
You are using the following clock settings, for a total of 96MHz, right?
Have you tried it with more than one Propeller? I've never had problems running Propellers at 100MHz with 6.25MHz crystals, but it's always a good idea to try different hardware.
Have you tried running your code (after setting _xinfreq to 5_000_000) on another board with a 5MHz crystal? Can you borrow a 5MHz crystal from another board and see if that works on this board?
Yes, I did that yesterday and it worked just fine. Today I swapped Propeller chips and got the same symptoms. I looked through the code and other than _clkmode and _xinfreq I don't see any way to adjust for a change in Propeller frequency. Below is the signature of the start method and it doesn't take any parameters like that:
PUB start(BasePin, ScreenPtr, ColorPtr, CursorPtr, SyncPtr) : okay | i, j
Now it's entirely possible there's a way to do this, but it doesn't seem obvious to me. So I think switching to a 5 MHz crystal is the path of least resistance.