We've found the ParallelImageCapture function to be very unstable under CircuitPython. It works sometimes with OV7670 and never or almost never with OV2640. If you need to use the SAM D5x/E5x microcontroller, consider using the Arduino version instead of CircuitPython.

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.
  • d0d7: Only the specific PCC pins may be used.
Top down shot of a Adafruit Grand Central M4 Express featuring the SAMD51.
Are you ready? Really ready? Cause here comes the Adafruit Grand Central featuring the Microchip ATSAMD51. This dev board is so big, it's not...
In Stock
Hand pressing buttons and moving joystick on TFT shield, display shows actions and then displays robot
This lovely little shield is the best way to add a small, colorful and bright display to any project. We took our popular 1.8" TFT breakout board and remixed it into an Arduino...
Out of Stock
Angled shot of 25 Through-Hole Resistors - 2.2K ohm 5% 1/4W.
ΩMG! You're not going to be able to resist these handy resistor packs! Well, axially, they do all of the resisting for you!This is a 25 Pack of 2.2K...
In Stock
Hook-up Wire Spool Set in box with 6 colorful wires coming out
Perfect for bread-boarding, free wiring, etc. This box contains 6 spools of solid-core wire. The wire is easy to solder to and when bent it keeps its shape pretty well. We like to have...
In Stock

This guide was first published on Jun 29, 2021. It was last updated on May 26, 2024.

This page (Grand Central M4 Wiring) was last updated on Mar 08, 2024.

Text editor powered by tinymce.