SHOWALL FUN PRANKS HIGH VOLTAGE LAZARUS-64 PHOTOGRAPHY SPY GADGETS VIDEO GAME
Figure 26 - The latch is used to clean up any propagation delays
Figure 26 - The latch is used to clean up any propagation delays

While reviewing the recorded videos made earlier, it was notice that some vertical lines were seen in the moving graphics. Although hardly noticeable on the live view, I did not want any glitches in the video quality, so the problem was isolated to be a propagation delay difference between the path from the chrominance data and the luminance signals. It may seem surprising that a nanosecond time difference can create an artifact on the screen, but since the chroma processor as a longer pathway to travel before recombining with the luminance data; this created a line in the signal, especially when black and white data was overlaid on the color background. The fix was a single chip.

The addition of a 74HC373 data latch made the propagation delays disappear by latching both signals together on the falling edge of the master 14.318 MHz clock oscillator. Because the propagation delay was less than 70 nanoseconds (the clock period), the clocked latching of the data removed all delays between the chrominance and luminance signals, eliminating all screen artifacts. The edges of the pixels also seemed sharper due to the shoring up of all video signals. The output video was extremely crisp and stable now, although I still plan to add the output filters later to conform to the NTSC standard as closely as possible.



Figure 27 - The sound generator and R2R ladder DAC
Figure 27 - The sound generator and R2R ladder DAC

With the video system hardware mostly completed, it was time to add the sound generator and make sure that the two systems (sync and sound) can live together properly. The sound generator is the same microcontroller as the sync generator, an Atmega324p, but it has its own 20 MHz crystal oscillator in order to minimize noise on the main bus by creating an asynchronous system. The sound generator also requires a lot of power, since it will be required to control 6 fully independent sound channels with complex volume envelopes and filters, so a 20MHz clock speed is good. The sound generator lives on the main system bus as an addressable 256 byte memory. In other words, there are 8 address bits to set a command, and 8 data bits to send the command parameters. This will allow at least 42 possible commands for each of the 6 sound channels (256/6), which is more than enough addressable space. The sound generator will sync to the host processor much like the sync generator; using a pair of control lines to clock in the data (REQ and ACK).

The 6 sound channels are mixed by the sound generator using a time slicing method I stumbled upon by accident when trying desperately to make an 8 bit mixing routine that was would not suck up a lot of processor cycles or introduce horrible distortion into the output. Summing and dividing took a lot of power and did not sound very good, and averaging was so processor intense that the sound frequency suffered, so both ideas were scrapped. At first it seemed as if I would have to reduce the sound channels to only 2 or end up with some custom hardware DAC, which would ruin my goals of using only logic parts.



After some trial and error, I found that by simply outputting each channel in equal succession at a rate well above an audible frequency, the results were a perfect mix that seemed to be completely free of distortion. This time slice mixing also require almost no processor power, so 2 extra channels dedicated just to noise effects were added along with a bunch of new modulation filter modes. The resulting sound generator seems to have great promise, and although it is not able to fully communicate with the host processor yet, the sound quality is better than originally planned.

Back Home Last Next
You are Viewing... Page 14 of 15
Lucid Science Electronics from the Fringe AtomicZombie Hack-a-day SparkFun