This description is a general one and doesn't necessarily relate directly to the FigNition. Let's start with the basics…
a complete video line, in PAL, lasts 64usecs. At 20MHz that means we have 1280 CPU clock cycles in every line.
A line is made up as follows…
4.7usec of line sync
5.8usec of blank video
51.95usec of active video
1.55usec of blank video
…turning those into the number of CPU clock cycles we have…
94 clocks
116 clocks
1039 clocks
31 clocks
We are going to use our CPU to generate the video so there must be a relationship between the CPU clock rate and the pixel rate.
Now pick your desired horizontal video resolution.
Lets imagine we want a 32 character display and that each character is 8 pixels wide. So we have a total of 256 pixels per line.
Those 256pixels need to fit into our 1039 CPU clocks.
It's not going to fit nicely so lets say that each pixel will last 4 CPU clocks. That means our character display will last for 1024 CPU clocks. What about the odd 1039-1024 = 15 CPU clocks? Well, we simply make our blank video sections a bit wider. This means that the generated video will not completely fill the possible screen width. It doesn't matter; we will simply see a bit more black down the left and right hand edges. As far as the video signal, and monitor, is concerned it's just video that happens to be black.
So, how to convert those pixels into video?
There are several ways, you can bit bang them onto an I/O line or use the SPI module. The SPI module is nothing more than a shift register. You parallel load it with 8 bits, supply it with a clock signal, and the pixels get shifted out onto a single pin one bit at a time.
So for our example we supply the SPI module with a clock signal every 4 CPU clocks and reload it with 8 pixels very 32 CPU clocks. Voila, our pixels appear at the correct rate on a pin.
For our sync signal we can use counters. Set a counter with the desired amount and clock it at CPU rate. Every time the counter eaches zero we set the sync output pin to the right state.
Take the signal from our pixel pin and from our syns pin, mix them in the right proportions with a couple of resistors and we have a composite video signal.
Right, time for dinner.
Brian Fairchild
minium limited
www.minium.co.uk
phone +44 (0) 1353 749101
fax +44 (0) 1353 749099
That was me :)
I also asked if the flickering on flat panels could be addressed in a
future firmware upgrade...
JonB
FIGGY 00123 FOREVER!!
On Dec 14, 10:25 pm, Julian Skidmore <theoriginalsn...@gmail.com>
wrote:
> >> to the FigNition. Let's start with the basics…****
>
> >> ** **
>
> >> a complete video line, in PAL, lasts 64usecs. At 20MHz that means we have
> >> 1280 CPU clock cycles in every line.****
>
> >> ** **
>
> >> A line is made up as follows…****
>
> >> ** **
>
> >> 4.7usec of line sync****
>
> >> 5.8usec of blank video****
>
> >> 51.95usec of active video****
>
> >> 1.55usec of blank video****
>
> >> ** **
>
> >> …turning those into the number of CPU clock cycles we have…****
>
> >> ** **
>
> >> 94 clocks****
>
> >> 116 clocks****
>
> >> 1039 clocks****
>
> >> 31 clocks****
>
> >> ** **
>
> >> We are going to use our CPU to generate the video so there must be a
> >> relationship between the CPU clock rate and the pixel rate.****
>
> >> ** **
>
> >> Now pick your desired horizontal video resolution.****
>
> >> ** **
>
> >> Lets imagine we want a 32 character display and that each character is 8
> >> pixels wide. So we have a total of 256 pixels per line.****
>
> >> ** **
>
> >> Those 256pixels need to fit into our 1039 CPU clocks.****
>
> >> ** **
>
> >> It's not going to fit nicely so lets say that each pixel will last 4 CPU
> >> clocks. That means our character display will last for 1024 CPU clocks.
> >> What about the odd 1039-1024 = 15 CPU clocks? Well, we simply make our
> >> blank video sections a bit wider. This means that the generated video will
> >> not completely fill the possible screen width. It doesn't matter; we will
> >> simply see a bit more black down the left and right hand edges. As far as
> >> the video signal, and monitor, is concerned it's just video that happens to
> >> be black.****
>
> >> ** **
>
> >> So, how to convert those pixels into video?****
>
> >> ** **
>
> >> There are several ways, you can bit bang them onto an I/O line or use the
> >> SPI module. The SPI module is nothing more than a shift register. You
> >> parallel load it with 8 bits, supply it with a clock signal, and the pixels
> >> get shifted out onto a single pin one bit at a time.****
>
> >> ** **
>
> >> So for our example we supply the SPI module with a clock signal every 4
> >> CPU clocks and reload it with 8 pixels very 32 CPU clocks. Voila, our
> >> pixels appear at the correct rate on a pin.****
>
> >> ** **
>
> >> For our sync signal we can use counters. Set a counter with the desired
> >> amount and clock it at CPU rate. Every time the counter eaches zero we set
> >> the sync output pin to the right state.****
>
> >> ** **
>
> >> Take the signal from our pixel pin and from our syns pin, mix them in the
> >> right proportions with a couple of resistors and we have a composite video
> >> signal.****
>
> >> ** **
>
> >> Right, time for dinner.****
>
> >> ** **
>
> >> Brian Fairchild
> >> minium limited
> >>www.minium.co.uk
> >> phone +44 (0) 1353 749101
> >> fax +44 (0) 1353 749099****
>
> >> ** **
>
> >> ** **
>
> >> ** **
>
> >> *From:* fign...@googlegroups.com [mailto:fign...@googlegroups.com] *On
> >> Behalf Of *craig
> >> *Sent:* 14 December 2011 19:20
> >> *To:* fign...@googlegroups.com
> >> *Subject:* PAL Video****
>
> >> ** **
>
> >> I've had my Fignition for quite a while and I'm trying to understand how
> >> it works. I've already looked at the Understand it section on the main site
> >> but I'm looking for more information on how the PAL video is generated on
> >> the chip. I've read the Fignition code and sources such as:****
>
> >>http://www.rickard.gunee.com/projects/video/pic/howto.php****
>
> >>http://www.batsocks.co.uk/readme/art_SerialVideo_1.htm****
>
> >>http://martin.hinner.info/vga/pal.html****
>
> >> ** **
>
> >> Can anyone point me to more detailed information or give any information
> >> here. I don't understand the relation of the AVR clock to the timing of a
> >> video signal, many PAL projects I've seen use various clock frequency with
> >> 16MHz being the most common but Fignition uses 20MHz. Syncs are a tricky
> >> subject for me as well so really I'm stuck on the most crucial parts of PAL
> >> video generation.****
>
> >> ** **
>
> >> Any Help appreciated and Thanks in Advance,****
>
> >> Craig****
>
> > --
>
> > The DIY 8-bit computer from nichemachines™
>
> --
>
> The DIY 8-bit computer from nichemachines™
>
> FIG - black on whiteMini.jpg
> 13KViewDownload
>
> NmLogoMini.jpg
> 4KViewDownload
The format for field 1 (starting at line 623.. ends at line 5 inclusive):
The format for field 2 (starting at line 311.. ends at line 317 inclusive):
The text quoted is wrong.
For PAL it is *always* 5 + 5 + 5 (source: Specification of Television Standards for 625-line System I Transmissions)
As far as the first field goes - it doesn't really matter as it will sort itself out next time around. Although if you wanted to be absolutely spot-on you'd start on Line 1 which is the start of the Broad Pulses (aka long sync pulses).
And yes, the delay is a high level for 30us. The '5 + 5 + 5' vertical sync sequence runs at twice the normal sync rate so that you get a falling edge every 32us. Note that it's the falling edge which is used as the timing reference point.
A quick web search brings up an amazing number of pages where the information on video sync is just plain wrong.
Brian Fairchild
minium limited
www.minium.co.uk
phone +44 (0) 1353 749101