When I first made the board, I had already reserved the camera part, because our expansion board has rich interfaces and can add these, so we tested it through cases. For this kind of board, we can first refer to the EK-RA8D1 board.
On this development board, it is connected to the OV3640 camera, and we need to replace it with the reserved OV5640.
Also note that some cameras do not have their own crystal oscillator and need to be supplied with a clock signal through a pin, so you can see that the official routine has an IO port that outputs the clock frequency.
Looking at my configuration, I need to configure two IO ports for control, and then the CEU configuration and SDRAM configuration.
The most nervous thing was that I read the pin diagram wrong and mistook the serial port for IIC. Fortunately, it turned out to be a usable serial port.
It is not native IIC, but is expanded through SCI. However, you can modify the sending function of the example, and the communication test will be fine.
I just developed two functions, one is SCI_IIC and the other is CEU display. The official provides two display modes, one is VGA and the other is sxga.
There are two picture specifications, but the OV5640 routine we use is RGB565, so you only need to initialize one. If you want this format, you should configure it, see the manual or something.
Other projects are just copying. We don’t use the RTT printing function, so we need to block many printing functions.
The initialization given in our case routine uses IIC here because the camera protocol is SCCB bus and IIC protocol is very similar. It actually configures the camera output data parameters, as well as some control, exposure, focus, etc. The ecu is equivalent to reading data, so the configuration is much simpler. Let's look at the output effect directly.
Each OV camera module should be able to configure a color bar output test. We tested one with the color bar output turned off and one with the color bar output turned on.
This is the first effect. There are some black stripes in the output simulation. I don't know if it is caused by the interference of the drawing board or it is not configured properly. There are also some black stripes when the camera is collecting data.
Take a look at the real-time output effect.
Check that the ID read is correct.
It is also correct to look at the real-time image. The black stripe should be caused by refreshing too quickly. It will return to normal after a while after pausing.
Please note that our format is RGB, which is different from the official one.