Monochrome Composite Video
The aim of this page is to contain all the basic timing information you'd need to get a microcontroller
to to output a greyscale display for a TV via a composite video signal.
I live in the UK, hence my bias is towards PAL signals. NTSC is not too different (when talking greyscale), and where possible, I'll include relevant details.
A later article/info page will probably cover methods to actually get a microcontroller to output this signal.
[edit: The resulting project, TellyMate, and an article that describes the design are now available]
- Uses Yellow Phono (aka RCA) connectors.
- "Greyscale PAL signal" is an oxymoron (PAL or 'Phase Alternating Line' describes the encoding of colour data).
"ITU System I" is more accurate.
- I still call it a 'black and white PAL signal'.
- I've missed off loads of details (broadcast engineers : run away - you'll be horrified).
- It's an old system at heart; many of it's features are to help old valve-era technology reliably display a reasonable picture.
- Modern TVs have to do lots of 'munging' to display the signal on a pixel-based screen.
My largest problem: Both of my 'fairly modern' TVs are too good. They'll take any signal that's vaguely correct and display it beautifully (Hence I can't easily work out if I've got it absolutely correct!).
Here's the potted summary of these notes in diagram form: (see further notes below)
One frame of full interlaced monochrome PAL video
One field of 'fake progressive' monochrome PAL video
- 0v to 1v
- 0v : "Sync"
- 0.3v : Black / Blank [not quite accurate for NTSC]
- 1v : White
Signal split into contiguous 'frames'.
A frame describes a whole, single, image to display on the screen.
Each frame is further split into (contiguous) scanlines.
Each scanline is 64μs long.
- 25 frames per second (NTSC: 30 [greyscale]).
- 625 scanlines per frame (NTSC:525)
- Each frame is 2 (contiguous) fields.
- "Field 1": image data for even lines (yes - this is correct).
- "Field 2": image data for odd lines.
- Interlaced display.
- Image data within scanlines, left to right, top to bottom.
- 50 fields per second.
- 312.5 scanlines per field (NTSC:262.5).
- PAL: Field 1 is an even field, Field 2 is odd.
- NTSC: Field 1 is an odd field, Field 2 is even. [TODO: check]
- Some carry field/frame boundaries.
- Some carry picture information.
- Some carry other information.
Number of "active video data" scanlines:
- 575 'active video data' scanlines per frame.
- 287.5 'active video data' in 'even' field.
- 287.5 'active video data' in 'odd' field.
- On digital equipment, this is often rounded up to 576 scanlines, 288 per field.
- Hence modern descriptor: 576i/50 : 576 display lines, interlaced, 50 fields per second.
- (NTSC: 480i/60)
Enables TVs to 'lock on' to signals.
Sync signal level is '0v'.
Always a small 'quiet' 0.3v 'blank' period around sync pulses (stops old circuitry getting confused).
Areas of synchronisation known as 'blanking periods'
Originally designed as times where the electron gun in the TV was 'blanked' for the retrace back to the left/top-left of the screen.
Two sorts of blanking period:
- Horizontal blanking period:
- Sits between lines of image data.
- Contains "start of line" point.
- Accurate timing is crucial in getting jiggle-free images.
- Field blanking period:
- Sits between fields of image data.
- Tens of scanlines long.
- Contains a special sequence of sync pulses.
- Contains the 'start of field' point.
- These periods overlap. (Sync pulses areas in field blanking period take precedence).
More details below.
The following (probably over-simplified) diagram shows how these blanking periods overlap.
In the real signal, the field blanking period covers more scanlines and there are far more scanlines in a frame!
Over-simplified diagram of blanking periods
Horizontal Blanking Period
Straddles 2 scanlines.
Contains the 'start of scanline' sync pulse.
The following diagram shows a signal's voltage level over a couple of horizontal blanking periods.
Horizontal Blanking Period
Note: Some scanlines with horizontal blanking periods fall within the Field Blanking Period. These scanlines do not carry Picture Data (they can, however, carry other data, such as teletext).
Horizontal Blanking Period = Front-Porch + H-Sync pulse + Back-Porch
Start of H-Sync signifies start of scanline.
Many more details (rise/fall times etc.) left out here.
Back-Porch is where colour synchronisation occurs.
Back-Porch is empty for monochrome.
|Blanking period (total)
|'Active Display' period
A scanline 'starts' when the H-Sync pulse starts (yes - worth repeating).
Timing of H-Sync pulse start is crucial.
Jitter on H-Sync pulse = wobbly picture (effect similar to poor video recorders from the 80's).
Length of H-Sync pulse less critical.
4μs pulse works nicely.
Most microcontroller video output seems to use 4μs H-Sync pulse.
Field Blanking Period
Hides movement of electron gun trace back to top-left of screen.
Contains 'field start' datum point.
Field Blanking Period for Odd and Even fields identical, but...
- Odd Field Blanking: starts at normal scanline boundary.
- Even Field Blanking: starts halfway through scanline.
3 sections of pulses at start of blanking period:
- Pre-equalising pulses
- Vertical Sync pulses
- Post-equalising pulses.
Each section lasts for 5 half-scanlines. (NTSC: 6 half-scanlines).
Each Pre/Post-equalising half-scanline:
- Single short pulse
- Nothing else.
Each Vertical Sync half-scanline
- Single broad pulse
- Nothing else.
A field's 'start point' is the start of the first broad sync.
||PAL / NTSC
|Short Sync pulse
|Broad Sync pulse
||(scanline_duration / 2) - 4.7μs
The 'Short Sync' pulse is exactly half the duration of the H-Sync pulse.
The following diagram shows the first 15 half-scanlines in the field blanking period.
Field Synchronisation Pulses
The diagram does not show the whole Field Blanking Period.
The blanking period extends for a further 18.5 (whole) scanlines.
Info from http://www.retroleum.co.uk/PALTVtimingandvoltages.html:
- Most TVs are happy with one single long sync-pulse in place of the 5 broad pulses.
- Short pulses can be ignored (e.g. just continue with start-of-whole-scanline H-Syncs)
- I've not tried this.
Indicators of incorrect field blanking:
- Continually Vertically rolling picture
- Intermittent vertically jumping picture.
Non-interlaced (progressive) trick:
- Only output even fields.
- Extend pre-equalising short-pulses to 6 sections (to get a whole number of scanlines in the field)
- Might need to reduce number of display lines to 304
- Tried, tested and recommended.
- Easier than full interlacing (if you don't need that level of picture detail).
Which areas are actually 'displayed' on the TV?
According to the standards...
- Even Fields: half-way across line 23 down to the end of line 310 are displayed.
- Odd Fields: line 336 to half way across line 623 are displayed.
- Display Scanline:
- The 'Active Display Area' of a scanline is 51.95μs.
Therefore 287.5 lines (288 in the digital world) per field.
Note: The short-sync pulse half-way through line 623 should still be output.
Note: The 'never displayed' scanlines (scanlines 7-22 and 320-335) can be used to signal data, such as teletext.
Generalised summary of 'active display area':
- Two fields of 288 lines, with 51.9μs per line in the 'active portion'.
Is all of the 'active display area' actually visible?
Depends on your TV & it's settings.
'Overscan' is the part that's not shown.
There are generally accepted 'safe areas'.
Text-safe / Caption-safe area (4:3 AR), as used by the BBC:
- 80% of active width.
- 80% of active lines.
- 230 text-safe lines.
- 29 text-unsafe lines at the top.
- 29 text-unsafe lines at the bottom.
- 41.6μs centre of the "active display" in scanline is 'text-safe'.
- 5.2μs text-unsafe at left.
- 5.2μs text-unsafe at right.
Picky details I've not yet worked out / included on diagrams (and they probably won't matter):
- Q. Should there be a blanking period before prior to the short-sync on line 623?
- A. Yes. I think that it actually starts Front Porch_μs earlier than the colouring on the above diagram shows.
- Q. Should the 'display from half way across line 23' be half way across the scanline or halfway across the picture data?
- A. It should actually display from (32μs + HSync_μs + BackPorch_μs) - e.g. the diagram above stops the coloured area too soon.
- Q. As it stands the diagram seems to show that 58% of the top display line on the even field is visible, and only 42% on the bottom display line of the odd field. Is this right?
- A. It's actually worse than this. I believe that the top display line (23) should only show 38% of the "picture data" and the bottom display line (623) should only show 38% as well.
Timing that I actually use:
- 4μs H-Sync
- 2μs Short-sync
- 28μs Broad-sync
Fake 'progressive signal' (as described at the end of the "Field Blanking" section).
It seems to work nicely on both of my TVs and also on an old (electron beam and phosphor) 14-inch telly at my parents':
Composite Video from a Mega8