FIGnition FUZE Hardware Reference Manual page 17

Table of Contents

Advertisement

Each state begins with an interrupt that causes a short section of code to run at a precise
moment in time, a number of 400 nanosecond periods after the current state. The top and
bottom margin states simply set the time when the next state should start. The vertical
sync states change the width of the synchronisation pulses to match the pattern the TV
expects. The image scan states generate the actual image.
Generating Synchronisation Signals. FIGnition uses some built-in hardware called a
timer (Timer 2) to automatically generate synchronisation signals. During initialisation,
Timer 2 is set to tick at 2.5MHz, which is the 20MHz crystal frequency / 8 and set to oper-
ate in a Pulse Width Modulation mode, which keeps looping forever with a given timing pe-
riod and a pulse width. The timer's timing period is set to the length of a 64µs scan line x
2.5MHz; which is 160 ticks and the pulse width is set to 4.8µs (12 ticks). The pulse is in-
verted so that the pulse is low (0v) and the rest of the period is high (5v).
Generating An Image Scan. A scan line is 64µs and 51.2µs can be used for dots. To out-
put the dots we use the AVR's serial port in SPI mode and set the frequency to a conven-
ient value of 20MHz/4 = 5MHz. The 200 dots on the screen then take up 40µs. To make
each line of dots as central as possible we add a margin of (64-4.8-40)/2 = 9.6µs before
we start displaying them [Fig 3.7, Lower half]. The code for generating an image scan line
is written in assembler; you can find it in the routine
Vertical Sync:
PreEqualize
LastEqualize
PostEqualize
Timer1 Int
TopMargin
in 56*64µs
If ScanLine>0,
Timer1 Int in 55µs
Dec ScanLine, Gen-
erate Scan.
BotMargin
Equalize
Timer2:=2µs pulse over 32µs,
Timer 1Int in 5*32µs.
Timer2 set to 4.5µs pulse over
64µs. Timer1 Int in 56*64µs.
ScanLine=192
ScanLine
Timer1 Int in 9µs. Sleep
until Int (for exact timing)
ScanGen
If ScanLine=0,
Timer1 Int in 55µs
Fig 3.6
VideoScan
in the file
VideoScan.s
.

Advertisement

Table of Contents
loading

Table of Contents