Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI Interface for DepthAI API #140

Closed
Luxonis-Brandon opened this issue Jun 30, 2020 · 4 comments
Closed

SPI Interface for DepthAI API #140

Luxonis-Brandon opened this issue Jun 30, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Luxonis-Brandon
Copy link
Contributor

Luxonis-Brandon commented Jun 30, 2020

Start with the why:

In many cases using a micro-controller can be advantages compared to a full-out Linux system:

  • fast boot time (measured in milliseconds instead of seconds)
  • capability to completely power off (i.e. no battery drain at all) for long periods of time
  • cost (eliminating the linux tax in terms of additional onboard storage needed for Linux)
  • verifiable controls (i.e. strict real-time application/drive of mechatronics/etc. w/ determinism)
  • power (running Linux may be completely overkill in general)
  • a micro controller already is driving a given design/application (and working well)

So one advantage of DepthAI is it is such a system... booting over eMMC it can be fully up/running in under 100 milliseconds, and ~400 milliseconds from NOR flash.

So using DepthAI with such micro-controller applications is valuable. And a popular/easy way to interface between microcontrollers is SPI (COPI/CIPO).

Move to the how:

We have initially implemented a SPI protocol w/ CRC capability for DepthAI to act as a SPI peripheral. So then a microcontroller is the SPI controller and can pull data off of DepthAI when it sees fit.

At the physical layer (see luxonis/depthai-hardware#10), there will be a GPIO output so that DepthAI can interrupt the microcontroller when new/pertinent data is available. (This pin can also be ignored/not-connected if desired and the microcontroller can simply poll or request data when it wants to.)

Initially we will implement support tensor outputs from the salient neural networks (upon request from the SPI controller), but will expand to allow all the pertinent functionality from #136 to be included, both as input and output.

Move to the what:

SPI communication support for DepthAI.

  • Will function in parallel to USB interface (for easier system integration debugging).
  • Will function off of NOR-flash boot and eMMC-boot (and likely uSD-Card boot) for hostless operation.
@Luxonis-Brandon
Copy link
Contributor Author

We have an initial version running here: https://discuss.luxonis.com/d/56-initial-bw1092-esp32-proof-of-concept-code

@Luxonis-Brandon
Copy link
Contributor Author

@Luxonis-Brandon
Copy link
Contributor Author

Luxonis-Brandon commented Nov 26, 2020

And our pull request for joining this into the Gen2 pipeline builder is here:
luxonis/depthai-core#26

@Luxonis-Brandon
Copy link
Contributor Author

The Gen2 implementation of SPI is here: https://github.com/luxonis/esp32-spi-message-demo. As of this writing it includes MobileNetv2-SSD, tiny-YOLOv3, and thumbnail output examples. But a whole slew of other permutations are possible as it is based on the node/graph system of the Gen2 pipeline builder.

jdavidberger pushed a commit to constructiverealities/depthai that referenced this issue May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants