Shop OBEX P1 Docs P2 Docs Learn Events
Synchronous Shift In with External Clock - Is there a SIMPLE example? — Parallax Forums

Synchronous Shift In with External Clock - Is there a SIMPLE example?

Hi,
to interface P2 with a HM01B0 camera with 1bit interface, I need to shift in from a serial line with an external clock frequency PCLKO of 24MHz. P2 is running at 200MHz. Data has to be written to a buffer in HUB.

https://www.uctronics.com/download/Datasheet/HM01B0-MWA-image-sensor-datasheet.pdf
The whole procedure to receive a picture can be seen here as a PIO program for Pico, starting from line 148:
https://github.com/ArmDeveloperEcosystem/hm01b0-library-for-pico/blob/main/src/hm01b0.c

I don't think, that I have a chance to do this shifting bit-banging??? Right? Or do I? That would be something like:

wait for HSYNC LO
wait for HSYNC HI
Repeat for all pixels/4:
  Repeat 32 times:
    wait for CLK HI
    wait for CLK LO
    read DATAPIN
    shift DATA
  wrfast DATA to HUB 

So my question is, if there is a really SIMPLE example for the %11101 = synchronous serial receive smart mode?

Thanks very much for some hints!
Christof

Comments

Sign In or Register to comment.