Giter Club home page Giter Club logo

Comments (6)

kekiefer avatar kekiefer commented on August 18, 2024

Thanks Itay, this is very interesting and odd. I presume that this something that happens during continuous capture? If you power off the module and do a single frame capture, does it return data as expected?

There's a line counter in there which returns values from 0-59 (in the LS first 12 of 16 bits of a line), and there's also a CRC that is computed against that counter (second 16 bits), and I wonder if that's what we're seeing here.

If not keeping up with real time demands of the module (which we are just barely now in Python), we can pretty easily get out of sync with the driver and start getting crazy data. For example I've had issues re-allocating the capture buffer every time.

Another thing I noticed the other day is that the SPI Mode is set wrong (0, which was not set in the original C program), where according to the docs, it is supposed to be 3 (CPOL=1, CPHA=1), so we could be clocking out data with the wrong polarity on the wrong edge, arg! Strangely an fortuitously, this setting must be ignored by the driver. It might be worth changing that though.

Please let me know if you learn any more. When I've got a chance soon I'll do some investigation too.

from pylepton.

ItayKishon avatar ItayKishon commented on August 18, 2024

Got it!

You're right, it was the SPI mode.
I tried setting it at 3, but got garbage.
The magic number is mode 1, i.e. the trailing edge.

I'll do some thorough testing tomorrow, but right now it seems to have solved this sync problem.

Thanks so much!

from pylepton.

kekiefer avatar kekiefer commented on August 18, 2024

Are you on a Raspberry Pi or some other platform with spidev?

from pylepton.

ItayKishon avatar ItayKishon commented on August 18, 2024

I'm using RPi 2, running Raspbian 8 (Jessie).
What would you like me to check?

from pylepton.

kekiefer avatar kekiefer commented on August 18, 2024

Just checking. Please let me know if this continues working for you. Mode 2 is CPOL=1, CPHA=0, which isn't quite what the datasheet calls out. Considering that this was basically working with CPOL=0 before, I'm still a little confused by this.

from pylepton.

kekiefer avatar kekiefer commented on August 18, 2024

Hey Itay, I pushed a couple fixes to improve throughput and reliability (just to avoid potential issues there) and set SPI mode 3. This is working well for me and I have values in the correct range. Please let me know if you are still having problems.

from pylepton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.