Before you can use an OV7670 camera with the Grand Central M4, you have to perform some hardware modifications which are detailed on their own page. These modifications are not easily reversible and will make it difficult to use the camera modules on other boards.
Then, position the camera so that it sticks off the right side of the Grand Central PCB and the SDA/SCL pins insert into the third row of the header and insert it carefully.
Align the pins of the TFT Shield and insert it into the Grand Central too.
Connect GND and 3V3 from the TFT Shield to the modified pins of the OV7670.
Now, make sure you can see the Grand Central's CIRCUITPY drive and connect to the REPL. Open the REPL and double check that import imagecapture
works without showing an error. Then, copy the correct bundle to your device. It will automatically reload and start displaying the image from the camera on the built-in LCD.
Click the Download Project Bundle button below to download the necessary libraries and the code.py file in a zip file. Extract the contents of the zip file, and copy the entire lib folder and the code.py file to your CIRCUITPY drive.
Your CIRCUITPY drive should resemble the image.
You should have in / of the CIRCUITPY drive:
- code.py
And in the lib folder on your CIRCUITPY drive:
- adafruit_bus_device
- adafruit_ov7670.mpy
- adafruit_st7789.mpy
CircuitPython will automatically reload and begin showing the image on the camera on the LCD. If it doesn't, you can open up the REPL to diagnose what went wrong. Double check that you copied all the files from the bundle, and that you have a compatible build of CircuitPython installed, 7.0.0-beta.0 or newer.
Adapting to other SAM D5x/E5x boards
By selecting appropriate pins, you can adapt the example to work on other SAM D5x/E5x boards supported by CircuitPython which expose enough pins for the connections below:
- mclk: Free choice of any PWM pin
- pclk, vsync, href: Only the specific PCC pins may be used.
- reset, shutdown: Free choice of any pin. Can omit one or both, but the initialization sequence is less reliable.
- d0…d7: Only the specific PCC pins may be used.
Text editor powered by tinymce.