Signal generator for avr with display. TV signal generator. Description of CTC mode

Greetings to all!
Dear visitors to the site, I want to offer you a circuit and a printed circuit board of the GTIS (television test signal generator), which I made a year ago at the request of a friend. The task was set to develop a printed circuit board that should
fit into the "Ranitsa RP-201" case. (watch - radio receiver). Because. I'm in mine
time already assembled a universal test generator television signals(version 2.0 "Radio Amateur" 1999 No. 5 p. 5. Authors: Chirkov & Larionov)
I decided to use the version 3 circuit as a base option (m/c CXA1645M PAL encoder,
TDA8505 - SECAM encoder)
As a generator - shaper of a clock signal and test image signals, I decided to try two options:
1. test signal generator - author: Marcelo Maggi


2. small-sized television signal generator. Author: Alexander Musatov
(selection of the required test signal is carried out using two keys)

I checked both options on the breadboard and settled on the second one.
Thanks to the developments of Yu. Chirkov, V. Larionov, A. Musatov, the proposed
generator. Thank you very much for their work!
PCB file in Sprint Layout 3.0 format and circuit diagrams
in SPlan format.
Most the best program for small-scale "ham radio" production
printed circuit boards is Russified Sprint Layout 3.0. I like this
program for the possibility of wiring according to a drawing. Scanned drawings of boards from
magazines and other literature can be used to restore tracks
boards or re-routing of elements. To do this you need to scan the image
(or use any graphic file, converting it to a *.BMP file), it will
shown as background on the board.
The SPlan 5.0 program is a circuit diagram editor, it
supports macros, both built-in and user-defined. You can download programs
from the site--
And even if you have already worked with these programs, it is recommended to read
all sections of Russian help files to the end, it is possible that you will find
previously unknown program capabilities. From this site you can download Sprint Layout
4.0 (Russian version)

Using the Sprint Layout 3.0 program, you can change my layout option
printed circuit boards (for example, you have a different power transformer, diode bridge,
frame)
Scheme and printed circuit board for now, so to speak, for starters. (the cascade has been changed to
tr-ah V5 and V6).In the future, files (and revision) will be posted
1. Generator of a full color television signal on two chips
Article from "RET" No. 5 2003 author: M. Medvedev (DJVU format)
2.Video pattern generator -author: Marcelo Maggi
3.Foreign integrated video encoders
Article from "Radioamator" No. 1-3 2002 author: S.M. Ryumik (DJVU format)
4. Datasheets for m/s TDA8505, CXA1645M DJVU format(I converted from PDF -
take up space many times less).

Schematic diagram and a photo of a simple probe (test signal generator) designed for testing and tuning televisions.

The TV signal generator probe is assembled on the basis of a microcontroller of the pic12f629 series, and in terms of its dimensions, current consumption, cost of manufacturing the device and functionality for a TV technician, it is simply irreplaceable. Supply voltage 3 volts, i.e. two AA batteries. The current consumption in generation mode is 11 milliamps, in sleep mode - only 3 microamps.

Schematic diagram of a TV signal generator

PCB drawing


This probe can generate five pictures, which is quite enough to check and repair lowercase, personnel development TV, adjusting convergence and geometric distortion of the raster, color balance, monitoring the passage of signals through the TV circuits. When you briefly press the button, it wakes up and begins to generate the first picture; with subsequent clicks on it, the pictures switch in a circle. If you hold the button for a long time, the generator goes into sleep mode when released. It also goes into sleep mode automatically if it is turned on for more than 5 minutes.


An archive is attached to the article, which contains a diagram, a probe board, and two firmware. The video shows that the picture on my TV is slightly non-linear - this is because the TV is 12 years old, or maybe something is wrong with the video input.

To generate a video signal, just one microcontroller and two resistors are enough. That is, you can literally make a pocket-sized video signal generator the size of a keychain. Such a device will be useful to a TV technician. It can be used when mixing a kinescope, adjusting color purity and linearity.

Generator operation and its characteristics.
The generator is connected to the video input of the TV, usually this is a “tulip” or “SCART” connector.
The device generates six fields:
- text field of 17 lines;
- 8x6 mesh;
- mesh 12x9;
- small chess field 8x6;
- large chess field 2x2;
- white field.

Switching between fields is carried out by briefly (lasting less than 1 s.) pressing the S2 button. Holding this button pressed for a longer time (longer than 1 s) turns off the generator (the microcontroller goes into the “SLEEP” state). The generator is turned on by pressing the S1 button. The status of the device (on/off) is indicated by an LED.

Technical characteristics of the device:
- clock frequency- 12 MHz;
- supply voltage 3 - 5 V;
- current consumption in operating mode:
- at a supply voltage of 3V - about 5mA;
- at a supply voltage of 5V - about 12mA;
- frame rate - 50 Hz;
- number of lines in a frame - 625.

Scheme.
The scheme is very simple.
All work on the formation
video signal
executed by the program
sewn into microcon-
troller. Two resistors
along with resistance
TV video input
provide the necessary
possible voltage levels
video signal:
- 0 V - synchronization level;
- 0.3 V - black level;
- 0.7 V - gray level;
- 1 V - white level.

To generate a video signal, the zero bit of PORTA and the entire PORTB are used. (This port operates in shift mode. Even though the signal is taken from only its zero bit, the program uses all of it. Therefore, all PORTB bits are configured as outputs.) The first bit of PORTA is used to indicate the status of the oscillator. When the device is turned on, the LED lights up. When the device is turned off, the LED is off. The third PORTA bit is used to switch the generator operating modes and turn it off. Briefly pressing the S2 button allows you to move from one generator field to another. When you keep this button pressed for more than 1 second. the device turns off (the microcontroller goes into the "SLEEP" state). A reset must be performed to turn the generator on. This is done by pressing the S1 button. The supply voltage of the device can be selected within the range of 3 - 5 V. In this case, the resistor values ​​must be selected accordingly.
3V...– R5=456Ohm and R6=228Ohm
3.5V – R5=571Ohm and R6=285Ohm
4V...– R5=684Ohm and R6=342Ohm
4.5V – R5=802Ohm and R6=401Ohm
5V...- R5=900Ohm and R6=450Ohm
Estimated values ​​are shown here. In reality, you can install resistors from the standard range, for example for 5V - 910 Ohm and 470 Ohm, and for 3V - 470 Ohm and 240 Ohm.
The generator supply voltage may be less than 3V. For each specific PIC, the minimum should be determined experimentally. For example, my 20 MHz PIC from 2001 worked at 2.3 V.

Program.
The program generates 6 fields. Each field consists of 301 lines (300 information lines + one black line). In general, the calculated number is 305 (625 raster lines - 15 frame synchronization lines = 610. Information in the frame is displayed through a line (see more about this here), so 610 / 2 = 305). But with this number of lines, the vertical size of the raster is slightly larger than what forms the video signal transmitted by the television center.
The first line in each field is black. At this time, the state of button S2 is queried, the time it is held pressed is calculated, and the need to move from one field to another is determined.
There are slight distortions in the vertical lines in the graphic fields. This is due to the fact that the length of some lines is a couple of clock cycles longer than others due to the need to install loop counters. In general, the routines that generate graphic fields are very simple, so there is no need to comment on them.
Let's take a closer look at the part of the program that generates the text field. This is the most complex section of the program, occupies most of it, uses maximum microcontroller resources (all data memory and a significant part of RAM). The code used here is taken from the game Pong, written by Rickard Gunee.
The text field consists of 17 lines, each of which can consist of no more than eight characters. Characters are displayed across a line, that is, one line of text occupies 17 raster lines. (This mapping is due to limited PIC capabilities.) Information about the symbol graphics is stored in program memory in the table section. Information about the text of the lines is stored in the data memory (64 words = 8 lines of 8 characters). For example, in line 08h (addresses from 08h to 0Fh) the following is written:.20.60.48.50.90.58.20 20. Each value is the coordinate (offset from the beginning) of a character in the table. Value.20. matches space, .60. - letter "B", .48. - the letter "I", and so on. And everything together forms “_VIDEO__”.
Let's look at an example of how text is displayed. According to the program, in the 12th text line of the screen it is necessary to display the information referenced by data memory line 28h (A0 B8 68 C8 D8 70 E0 D0). Thus, the following 17 lines of the raster should display the text: " p i c 1 6 f 8 4 ". It goes like this. The first of 17 lines displays only the black level. During these 64 μs, while a black line is displayed on the screen, the “upper values” of the characters are written into the RAM registers: 00h from “p”, 08h from “i”, 00h from “c” 18h from “1” and so on. During the next line, this data is sequentially transferred to PORTB, that is, to the video output. The third line is black again. During its execution, the “second from top” symbol values ​​are rewritten into the buffer: 00h from “p”, 00h from “i”, 00h from “c” 1Ch from “1”... In the fourth line, this data is displayed on the screen. And so on until the entire line is displayed.
The frame synchronization routine is taken entirely from the game Pong, which was written by Rickard Gunee. This routine is short but quite intricate. If you explain how it works, it will turn out even longer and more confusing. It is best to put the text of the subroutine and a drawing of the oscillogram of the frame sync pulses next to each other, and take your time to parse each line of code. Let me just say that the subroutine starts executing not from the top line, but from the middle (:-)), from the “vertsync” label.

Overclocking PIC16F84.
As can be seen from the diagram in this project, the microcontroller operates at a frequency of 12 MHz. Today, three versions of PIC16F84 are available: 4 MHz, 10 MHz and 20 MHz. (as of January 1, 2002, the price ratio is approximately: $3.5, $5.3 and $6.3) In his Pong project, Rickard Gunee claims that he used a 4 MHz PIC16F84 and they worked for hours at 12 MHz without problems. I tried it, and indeed the 4 MHz PIC works normally at a frequency that is three times (!!!) higher than its permissible frequency (although I did not tempt fate and turned on the generator only for a few minutes). At the same time, the current consumption of the 4 MHz PIC was 10..20% higher than that of the 20 MHz one (hence, apparently, the frequency limitation). I think that a 10 MHz microcontroller can be overclocked to 12 MHz without risk, but in commercial projects this, of course, should not be done.

Manufacturing.

The generator is designed to evaluate the quality of operation and configure color and black-and-white TVs. Of course, on LCD TVs there is no need to adjust color purity and reduce beams, but sometimes you may just need to check the TV’s performance. The proposed TV signal generator produces a complete television signal of the SECAM system (and with an additional encoder - also PAL), in which the relative arrangement of synchronizing and blanking pulses of lines and fields, equalizing pulses, components of the color synchronization signal are as close as possible to the requirements of the standard.

Unlike most amateur TEST TV designs, the generator generates an interlaced raster with a number of lines of 625. The frame rate is exactly 50 Hz. The device provides color synchronization both across fields and lines, which allows you to configure color modules of any modification.

The principle of operation of the television signal generator is to sequentially enumerate the addresses of the ROM in which the information displayed on the screen is programmed. This makes it possible to obtain various test images using relatively simple means.

The diagram of the main board of the TV signal generator is shown in the figure. Each line of the television raster is divided into 64 familiar locations, in any of which the sync pulse level, black level, 8 gradations of white brightness or white dot. A 3900, 4250, 4406, or 4756 kHz color subcarrier can be superimposed on the luminance signal. To display one line, 64 bytes are required in DD5 ROM of type K573RF5, K573RF2 or 2716, which are selected by the six low-order bits of the address. DD6 K573RF4, 2764 or 27128 records information about which line is being formed in this moment. This is determined by digits 0...4. If digit 5 ​​is programmed, clarity lines are entered into the corresponding familiar place. Bit 7 is used to limit the conversion factor DD1...DD4 to 625. Each television frame occupies 1 kbyte.

In the original version, the television signal generator can generate the following test signals:
- Grid field 24x18 – consists of an image of vertical and horizontal white lines forming squares;
- Chess field – consists of white and black cells;
- Chess field with lines of clarity - vertical lines of clarity are introduced into the white cells;
- Gradations of brightness – eight vertical stripes with a stepwise decrease in brightness from white to black;
- Red field;
- Green field;
- Blue field;
- White field;
- White field with clear lines;
- Horizontal color stripes – red, green, blue, turquoise;
- A universal test table, which includes elements of all of the above images, allows you to comprehensively evaluate the quality of the TV setup.

Those interested can create their own image. Read how to do this in detailed description. The design and setup procedure for this TV signal generator are also described there.

The TV signal generator probe is assembled on the basis of a microcontroller of the pic12f629 series, and in terms of its dimensions, current consumption, cost of manufacturing the device and functionality for a TV technician, it is simply irreplaceable. Supply voltage 3 volts, i.e. two AA batteries. The current consumption in generation mode is 11 milliamps, in sleep mode - only 3 microamps.

Schematic diagram of a TV signal generator

PCB drawing


This probe can generate five pictures, which is quite enough for checking and repairing the horizontal and vertical scanning of a TV, adjusting the convergence and geometric distortion of the raster, color balance, and monitoring the passage of signals through the TV circuits. When you briefly press the button, it wakes up and begins to generate the first picture; with subsequent clicks on it, the pictures switch in a circle. If you hold the button for a long time, the generator goes into sleep mode when released. It also goes into sleep mode automatically if it is turned on for more than 5 minutes.


An archive is attached to the article, which contains a diagram, a probe board, and two firmware. The video shows that the picture on my TV is slightly non-linear - this is because the TV is 12 years old, or maybe something is wrong with the video input.

Top