220 likes | 368 Views
1. Encode binary value using PCM. Binary # --> How accurate can you get? (+/- 1 usec?). 2. Timer/Interrupt Examples: Timestamp Input Events. Keep a queue of input events Each event is a timestamp. 3. Stepper Motor Control. Simple idea
E N D
1. Encode binary value using PCM • Binary # --> • How accurate can you get? (+/- 1 usec?) Design Problems
2. Timer/Interrupt Examples: Timestamp Input Events • Keep a queue of input events • Each event is a timestamp Design Problems
3. Stepper Motor Control • Simple idea • (Timing of signals is important: Acceleration/Deceleration) Design Problems
4. Serial Communications • Sample the data bits at the right time • Can you adapt to the current data rate? Design Problems
Graphics Intro/Overview • Each location in memory corresponds to one pixel on the display • A process reads the memory and sends the value to the memory at the right time • The memory is called a “frame buffer” Design Problems
Frame Buffer • To display something, just write values into the frame buffer • The display happens automatically • The frame buffer memory is “dual-ported” • i.e. shared between two independent processes • Hardware assist for drawing objects • reduces bandwidth and computation • e.g. lines, rectangles, characters, triangles, ... Design Problems
Double-Buffering • What if the image changes from one frame to the next? • Use two frame buffers: change one while the other displays • then switch Design Problems
Double-Buffering • Redraw everything on the screen, every frame • Lots of computation Design Problems
Double-Buffering • Changing the display • 1. Erase and redraw every frame • 2. Erase what changes and redraw • Overlap? Design Problems
Drawing Objects • e.g. Lines • Bresenham’s algorithm • Forward differencing • Fast: add/subtract • pixel/clock • No accumulated error Design Problems
Windowing • Display only a part of the frame buffer • e.g. fast panning, scrolling Design Problems
Zoom/Shrink • e.g. Zoom by 2x • extend to 1.25x? • extend to .75x? • Cheap/fast hack • Works OK for someapplications • not images Design Problems
Rotations • Very similar to line drawing • Fast, cheap transformation Design Problems
Color Map • Maps each value in memory to a value for the display • e.g. color transformation (3,3,2) -> (2,2,2) • e.g. binary image planes • Use each bit to represent one color • Overlapping colors defined by color map • Mask a plane (color) by changing the color map • e.g. 4 bit image planes • Two images - switch between them by changing the color map Design Problems
Sprites • Objects display over the background • check origin values to decide what to display • transparency? Design Problems
VGA Timing Design Problems
One Frame • Vertical Synch tells the monitor when to go back to the top • The Blanking Interval turns off the video at the top and bottom of the screen Design Problems
One Line • Each frame is divided into many lines • Horizontal synch tells the monitor to go back to the start of the next line • Each line is divided into pixels • No timing signal: just change the value from one pixel to the next Design Problems
Using a 24 MHz clock • Line: 31.77 usec x 24 MHz = 762 clocks/line • Frame: 16.784 msec x 24 MHz = 402,816 clocks/frame (!) • 402,816 / 762 clocks/line = 528 lines • But: • we display 512 pixels/line • 480 lines/frame • The rest of the time? • Blanking • Syncs Design Problems
VGA Interface • Simple counting will work! • VGA interfacesupplies X, Y • User suppliespixel value • one/clock Design Problems
Design Problem: • Complete the VGA interface design • Sketch design for frame buffer memory • VGA supplies address • Reads one port of memory • There should be another port for writing (and reading) • Design the dual-ported memory Design Problems