LCD display CCD data in waveform

1.Experimental Purpose

Through the first experiment, it was found that the operation of the linear CCD module was severely affected by the working environment. Then, through the last experiment, we found that the algorithm introducing dynamic threshold can eliminate the impact of environmental light on the CCD camera. The purpose of this experiment is to draw waveforms on the LCD screen using 128 data from a CCD camera and verify whether the data processed by the algorithm is correct.

2.Experimental wiring

1.Wiring of STM32 and CCD module

STM32/GD32CCD
PA4SI
PA3CLK
PA5AO

2.STM32/GD32 and screen wiring (choose one of the following two options) Using STM32/GD32 and LCD screen wiring (LCD screen needs to be purchased separately)

STM32C8T6/GD32C8T6LCD
PB10SCLK
PB11MOSI
PA7RES
PB0DC
PB1CS
PA6BLK
STM32RCT6LCD
PB8SCLK
PB9MOSI
PC11RES
PC12DC
PD2CS
PC10BLK

If you directly purchase our black STM32/GD32, you can directly connect the LCD screen to the LCD screen interface on the board without using DuPont cables

3.Main program analysis

The resolution of the LCD screen is 128 * 64, and the linear CCD also has exactly 128 data, so it is just enough to display the CCD data.

CCD_Get_ADC_128X64: This function is to return the ADV acquisition voltage values of 128 pixels and compress the amplitude into 128 * 64.

4.experimental result

After burning the normal code, it can be observed that the OLED screen/LCD screen has the following display, and the following figure shows the display effect of the OLED screen image-2023021500005 image-2023021500006 Yuzhi:Dynamic threshold Zhongzhi:mid-value

By offsetting the lens, it can be seen that the median is changing and the waveform is also changing, indicating that the dynamic threshold algorithm is the correct choice. It is best to experiment in an environment with only black and white lines for the best results.