Any reason I can't use CTRA NCO mode for video?
Bill Henning
Posts: 6,445
I'm in the midst of trying to get a new video driver running, and I am having "issues".
I realize it is not documented, but I thought I remembered reading in the forum (I tried search.parallax.com to find it) that I could use the NCO mode and get a video dot clock from that - without using the video PLL's.
I am trying something very simple, which works fine for generating a 40MHz square wave on an output - but I want to use it for the video generation, bypassing the video PLL.
Any ideas?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
I realize it is not documented, but I thought I remembered reading in the forum (I tried search.parallax.com to find it) that I could use the NCO mode and get a video dot clock from that - without using the video PLL's.
I am trying something very simple, which works fine for generating a 40MHz square wave on an output - but I want to use it for the video generation, bypassing the video PLL.
Any ideas?
mov ctra, ctra_val mov frqa, frqa_val ctra_val long %00100_111 << 23 + 30 << 9 + 30 'Establish mode and APIN (BPIN is ignored) frqa_val long $8000_0000
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Comments
I'm virtually certain it has to be a PLL. What you're probably remembering is the "discovery" that it doesn't have to be mode %00001, necessarily, but any PLL mode, including those that output to a pin.
-Phil
Ugh. That is a pain in the posterior - the 800x600 60Hz timing needs a nice 40MHz dot clock, so I was hoping I could get around my multi-cog sync problem by leaving the PLL out of the equation.
What I ended up trying was generating a nice 5MHz square wave, letting the video PLL multiply it up, and use that... but no joy.
I posted the SVGA driver on my downloads page, both it and the XGA driver have the same sync issue.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
I wrote the following to see if two 40MHz PLLs could be synced with each other, and it appears that they can. The phase error I'm measuring is a nanosecond or less.
-Phil
Thanks... very weird - I definitely have sync issues. I will ofcourse continue trying to get the code working. I appreciate your help.
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
I WAS NOT CLEARING PHSA!
(rookie mistake, not seeing the tree from the forsest)
That helped, but I am still seeing an offset on the video - but now I have a new path to investigate.
Update:
Fixed - just had to move clearing PHSA around to the right spot - now I have them synced!
THANK YOU - your example program is what showed me how to fix my bug.
Tonight I will fix both the 1024x768 and 800x600 drivers and start adding plot point/line/character [noparse]:)[/noparse]
Best,
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Post Edited (Bill Henning) : 8/17/2009 11:23:20 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
I just added a phsa=0 line in there and I think it's better now:
Seems to work after the first waitcnt, but not the second...
The timing appears better now, but one is still 1/2 a pixel off...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Basically I thought that when I initialized CTRA that it would clear PHSA, and Phil's code cured me of that... Chip sent me a code snippet I'll try later that does not need that clearing, I will try it later - but right now I am busy writing some graphics routines for my code!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
You can however use APIN with PLL modes, so it could still work for your serial output... look at lonesock et al effort with fsrw for examples.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
I think I would set frqa and ctra. Then do a waitcnt for the cogs to sync and the PLL to stabilize. Next, zero phsa right away, then set up your video registers last, once the cogs and PLLs are sync'd.
-Phil
Thank you (again) for your sample code! It allowed me to solve my issue immediately as it was different from Chip's multi-cog driver, which was my drivers inspiration.
Here is the code I am using right now, and it is rock solid... and similar to your suggestion, however I will try your and Chip's suggestions too
Today I am working on getting a graphics server cog running, initially with just two commands:
Plot(x,y,c) - plot a specified color pixel
PutChar(x,y,ch) - draw a character
Once those work, I will add a lot more:
Point(x,y) - returns pixel color at that location
PutStr(x,y,sptr) - print a string
Line(x1,y1,x2,y2,c) - draw a line, Bresenham's algorithm
FillRect(x1,y1,x2,y2,c) - draw a filled rectangle
My goal is to be able to do at least simple graphics and a virtual text mode by the weekend, with a nice font. Once that is done, I can start writing native utilities, code etc., and even more important - run the Largos shell without having to use an external serial terminal!
Then it is on to 256 color per pixel modes!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Don't forget that vscl permits dividing the PLL clock further.
-Phil