P0_13
and
P0_15
are input function pins which can receive the VSYNC and pixel signals. The Pixel clock is 1/4 of clock source,
it is 12.5 MHz.
As clock output pin,
P0_16
provides 50 MHz clock to camera as its clock source.
The
LSPI_HS
is high-speed SPI interface which is used to drive the LCD TFT screen.
7.4.4 LCD function
LCD is used to display the video of camera in real time. High-speed SPI is used to drive the LCD. The routine named by
LCD_Refresh()
is a very high-efficiency routine, it can refresh a 320 × 240 picture in about 24 ms, up to 40 fps. The bus clock of
high-speed SPI can reach up to 50 MHz. The DMA is not used to drive the LCD. Instead, only software is used to drive LCD where
the Arm core writes the SPI FIFO data write register once it is empty.
Figure 3. LCD function
7.4.5 OV7670 camera module
The camera module is set as QVGA RGB565 mode. The 16-bit data is received with two pixel edges (high-byte first and
low-byte follows).
At the beginning, the MCU initializes the camera through I
2
C interface. Then, the video stream data is stored in the RAM by
camera engine.
7.4.6 Reserved 46_IRQHandler
Same with other peripheral handler, camera engine handler is implemented by Arm core once engine finishes the
storage operation.
In the handler, a flag is set as one. In the
while(1)
routine, the refreshing operation can be allowed when flag turns to logic one.
7.4.7 Data buffer
There needs 150 kB space for one frame of video and LPC55S59 has about 300 kB RAM space. Double buffer is not possible.
Only one buffer is used. Because the LCD refresh time (24 ms) is shorted than data storage time (33 ms), so Arm always reads
the data for LCD refresh is earlier than storage operation by the engine. Therefore, the media data cannot be lost.
7.4.8 Timing
The LCD always displays the previous frame data from the camera. Before displaying, the data stored must be optimized by
dedicated processor for exchanging the high and low bytes of every pixel. Because the speed of LCD module displaying is higher
than the speed of camera interface reading data, the single data buffer is used in this application. While the current frame data is
stored, the LCD displays the previous frame data.
NXP Semiconductors
Library and API routine
Camera Interface in LPC55(S)xx, Rev. 3, 07 September 2021
Application Note
6 / 9