Cloning Windows desktop image to external display using stm32 microcontroller USBFS

Поділитися
Вставка
  • Опубліковано 28 лип 2024
  • We display the Windows desktop image on an external display using a microcontroller. USB CDC Virtual COM Port, jpeg encoder and decoder. Cloning a Windows desktop image on a display connected to a microcontroller. Virtual COM port. JPEG encoding and decoding. The project demonstrates working with a virtual COM port. Play streaming video (motion jpeg). The server (computer) constantly takes screenshots of the desktop, encodes them in jpeg and transmits them to the client (microcontroller) via USB (virtual COM port). The microcontroller decodes the image and displays it on the display.
    What you will need:
    Development board based on stm32 - blackpill stm32f401ccu6
    Display - st7789 or ili9341 (and compatible with them. The project is built for the st7789 display!).
    How to use:
    1. Connect the display to the development board according to the connection table:
    LCD_DC PA2
    LCD_RES PA3
    LCD_CS PA4
    LCD_SCL PA5
    LCD_BLK PA6
    LCD_SDA PA7
    2. Connect the firmware microcontroller board to the USB connector of the computer (Release folder, firmware file stm32f401ccu6_usb_virtual_com_port.hex Attention: Firmware for the ST7789 display. When using the ILI9341 display, you must rebuild the project, specifying the required display parameters when calling the LCD_DisplayAdd function in main).
    3. Run the server program from the Terminal\Release\Terminal.exe folder (this is a computer project).
    4. Select the com port to which the microcontroller is connected. You can find out the required COM port from the device manager. It will be labeled as “USB serial device (COM number such and such)” in the “Ports (COM and LPT)” section.
    If everything is done correctly, then on the display connected to the microcontroller you will see a copy of the same image that you can see on the computer monitor.
    Author:
    dzen.ru/vadrov
    / @vadrov
    t.me/vadrov_channel
    github.com/vadrov
    Project source code:
    github.com/vadrov/stm32f401cc...
    jpeg encoder:
    jpeg-compressor
    Public Domain or Apache 2.0, Richard Geldreich richgel99@gmail.com
    github.com/richgel999/jpeg-co...
    #stm32
    #programming
    #jpeg
    00:00 Greetings and Merry Christmas.
    00:24 What will be used in the project.
    00:43 Hello to the “guys” from the comments about the hook (from the ECU review). 😉
    01:08 About the desire to surprise the audience. UA-cam viewers (and others) love the show.
    01:40 What will be implemented in this “weekend” project.
    02:30 STM32CubeIDE. About setting up the display connection (setting up spi and gpio control outputs).
    04:43 About the indication of data reception/transmission via USB.
    05:06 About setting up USB. CDC class (Virtual Port Com).
    06:44 About interrupt priorities.
    07:20 Setting up core and peripheral clocking. USB operating condition.
    09:12 Project setup. Libraries for configuring and working with peripherals. Limitations of the USB Device driver from STM.
    11:29 Interrupt handlers: systick, dma, usb.
    12:48 Declaration and initialization of global variables, including the buffer for receiving data. Libraries connected to the project.
    17:01 Organization of data reception via USB in double buffer mode. CDC_Receive_FS handler. Batch reception. Signs of the last data packet for the current transmission (message).
    24:23 About the possibilities of overclocking the core of the m/c stm32f401ccu6. Software implementation. Restrictions when using a USB Device.
    26:01 Generating a message from the client to the server about the resolution of the display connected to the device and the maximum file size.
    30:50 Reception, decoding and display of images received from the server. Double buffer switching. Permission to receive a new data packet.
    35:50 The microcontroller is “not controlled by wiring”... 😉
    38:06 Visual Studio 2022. Program for server (computer). Why do we encode the image into jpeg, and not transmit it as a simple stream “as is”.
    41:21 Screenshots using GDI, scaling and encoding images to jpeg.
    41:44 Interpretation by the server of a message received from a client with jpeg encoding settings. Regular expressions. "Internal standards" of the project: format, resolution and file size.
    45:56 jpeg encoder. Thanks to its author.
    48:29 "Endless loop" of the server. The server adjusts the quality of jpeg encoding in order not to exceed the maximum file size. Minimum encoding quality. Consequences for the client if the server exceeds the maximum file size.
    51:44 Connecting a microcontroller to a computer. Detection of a serial device by the operating system. View Device Manager. Launch the server program and select the port to which the microcontroller is connected.
    54:13 Displaying a small copy of the desktop. Demonstration of work.
  • Наука та технологія

КОМЕНТАРІ • 57