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

Updated /raspberry_video/LeptonThread to work for Lepton 3. #31

Closed
wants to merge 1 commit into from

Conversation

amyers-novacoast
Copy link

Edited LeptonThread to correctly assemble the four segments given by Lepton 3 into a single image. Increased SPI speed to 32 MHz. Works on Rasberry Pi 3, but SPI speed is too fast for Raspberry Pi 2 (a SPI speed of 24 MHz is best for RBPi 2, but is still jumpy). Skips entire frames when not synced, rather than rendering half the image and creating tears.

-Andrew Myers
Novacoast, Inc.

… SPI speed and video now correctly assembles 4 segment image from Lepton 3.
@kekiefer
Copy link
Member

kekiefer commented Jul 13, 2016

Thanks for the PR. Great to see code contributed for L3.

The clock change seems a bit dangerous to me, and I think unnecessary. The Lepton 3 datasheet (preliminary one that I have at least) calls out 20 MHz as the maximum SPI clock rate; has this changed? I think we should adhere to the published limit, or if it's higher now, at least make sure that the faster clock does not break Lepton 2 by providing a means for backward compatibility in this application.

That being said, I was able to correctly download frames in Python from the L3 (and stay in sync) with an 18 MHz clock. Rather than increasing the clock speed, I was able to lower overhead by batching a bunch of VOSPI transfers in a single read ioctl after initial sync was established. The default spidev bufsiz is 4096 bytes so that's 24 VOSPI frames (4096 / VOSPI_FRAME_SIZE_BYTES = 24.97... ) that can be downloaded in a single ioctl. This technique would be worth trying for this application.

Also, in this PR, you've broken the spi_device switch for people who have the Lepton on a different SPI CS (see: software/raspberrypi_video/SPI.cpp:40)

@kekiefer
Copy link
Member

Closing to track in #33

@kekiefer kekiefer closed this Jul 21, 2016
@czsimon czsimon mentioned this pull request Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants