Controller board based on STM32F7 with video output

By the nature of their work, it is often necessary to design various types of control and measuring systems. Of course, based on microcontrollers. First they used AVR, then the next ATxMega family, eventually they settled on the STM32 family. Despite the different functionality of the designed devices, the mass of functions remains unchanged: the interface with the user and external devices, data storage, real-time clock, etc. Therefore, the idea came up to make a universal controller board containing the main nodes, and additional plug-in boards will expand the functionality to the necessary . First it was a controller on the STM32F103, then on 207, then on 429. And now on the 746 chip.

But the main novelty on this board is the video output. Before that, as a rule, a graphic display (monochrome, 320 x 240) was used. But this approach has its drawbacks:

1. When switching to a decent-sized color display> 5 "with an integrated controller, the price becomes quite large.
2. Only one type of display has to be used, as the interfaces are usually incompatible.

But the idea came to use standard car monitors, the price of which is quite affordable, there are a large number of manufacturers and there are different sizes

.





After searching the Internet, I discovered the S1D13746F01 graphic controller, which has 321 kB internal memory and composite video output. Of course there is S-Video, but it was not planned to be used. It was also discovered and datasheet on the Evaluation Board with a detailed connection diagram, though on a case that has 100 pins.

After reading the datasheet on the microcircuit, we found out some feature of the organization of access to the internal memory, namely the impossibility of recording at certain addresses. That is, the video buffer must be rewritten all. This feature makes it necessary to organize the storage of the video buffer in the memory of the microcontroller and to overwrite it with the necessary frequency.

To organize a video buffer, you need 320 * 240 = 76800 bytes. The number of colors will be equal to 256. This color coding format is indicated in the documentation for the video controller as RGB 3: 3: 2. That is, 3 bits to red, 3 bits to green and 2 bits to blue. Total 8 red flowers of various levels, 8 green and 4 blue.

Recording to the video chip is carried out programmatically through the port. Here is the C program.

void refresh_display(void)
{
  unsigned long   h, s;
  unsigned short  out_port; 
  for (s = 0; s < Height_window; s++) //строки
  {
    for (h= 0; h < Width_window; h++) //столбцы
    {
      out_port = gLCD_port->ODR;
      out_port &= 0xFF00;
      out_port |= video_buffer[h] [s];  //данные 
      gLCD_port->ODR = out_port;
      gLCD_color_WE_low; //запись
      gLCD_color_WE_high;
    }
  }
}

The recording time of the entire video buffer is approximately 20ms. If you wish, you can output video at 50 frames / sec, but the controller will only deal with output. :) In real tasks, it is necessary to rewrite the screen from 3 to 10 times per second.

And here is the picture on the connected car monitor, bought at the nearest store. The monitor size is 7 ".



This is the control of a high-voltage testing device. In addition to the video output on the controller board, there is still a connector for connecting the Winstar WG320240C0 monochrome display.

A brief description of the main nodes on the controller board:

  • 6 connectors with complementary PWM outputs for half-bridge control
  • USB Host is implemented on the VNC1L chip, mainly used to write information to flash drives.
  • USB Device - FT232RL chip, used to program the microcontroller from a computer via USB
  • isolated RS485 for communication with devices via MODBUS
  • Wi-Fi based on the ESP8266 module
  • RTC - DS1307 with lithium battery, I2C connected
  • 2 flash memory chips, one used to store device configuration, the other for archive data
  • ION based on REF192
  • 2 x 20-pin expansion slots each, one for analog signals, the other for digital.

Here is a controller turned out.

Also popular now: