background image

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

Summary of Contents for AN12868

Page 1: ...sferred This signal is often a way to indicate that one entire frame is transmitted Pixel Clock PCLK This pixel clock changes on every pixel The application note only focuses on Digital Video Port DVP...

Page 2: ...lay the 320 240 resolution LCD up to 30 fps 5 4 System clock The camera engine shares the system clock with Arm core To speed up the processing time the system clock must be configured to 150 MHz For...

Page 3: ...ution should be configured as QVGA 320 240 6 Pin description 6 1 Connection of interface Camera D0 D1 D2 D3 D4 D5 D6 D7 SIOC SIOD VSYNC HREF PCLK XCLK VCC GND P0 0 P0 1 P0 2 P0 3 P0 4 P0 5 P0 6 P0 7 P...

Page 4: ...presso IDE but not IAR 7 2 API routine The main purposes of the API routines include Enable the clock of engine Configure the IO as camera interface function Initial the I2C interface Enable the inter...

Page 5: ...put Camera engine function P0_6 15 Input Camera engine function P0_7 15 Input Camera engine function P0_18 15 Output Camera engine function p0_13 0 Input GPIO as VSYNC input P0_15 0 Input GPIO as Pixe...

Page 6: ...ed 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 handle...

Page 7: ...r to 5 V Power only USB port P5 6 The LCD displays the video frame from camera as shown in Figure 4 If the code cannot execute after downloaded one of the reasons is that the MCU goes to ISP mode The...

Page 8: ...lease A Purchasing LCD module and camera module used in this demo You can purchase the LCD board and camera module from the below links 1 https www waveshare com 2 8inch tft touch shield htm 2 http ww...

Page 9: ...cts with security features that best meet rules regulations and standards of the intended application and make the ultimate design decisions regarding its products and is solely responsible for compli...

Reviews: