How to read a frame from hm01b0 image sensor?

I am attempting to connect the Arducam hm01b0 to the nRF52840-DK embedded board, utilizing bare metal programming. The sensor comes with the following pins for serial interface. To access 4-bit interface( D1,D2,D3 and D4), the user has to solder the pins. However I am trying to get the HM01B0 working over the 1-bit interface and try to capture an image.

I am able to read and write to the sensor registers over I2C. The datasheet presents the following timings characteristics to capture an image.

I have connected the logic analyzer and I am able to see the corresponding waveform that is the data is being streamed over D0 line.

For 1 bit interface,the image sensor has a frame rate of 30 FPS and the frequency of PCLK is 36 Mhz. I know that GPIO pins would not be able to read the input signals in this

frequency range but I don't know how else to read a serial line. One option is making the image sensor as SPIM master and nrf52840 as SPIM slave. The image sensor provides the clock over PCLK which can be configured as SPI clock and the line D0 can be configured as MOSI line. However to read valid data bits/bytes over the serial line, VSYNC and HSYNC should also be read and made sure that their value is according to the serial video interface timings diagram. So I tried to read the serial line D0 by configuring it as a GPIO pin and I read 0x00 always.

How can I configure the image sensor and capture an image? 

This is the code I have written,

You can find the datasheet of the image sensor here : www.uctronics.com/.../HM01B0-MWA-image-sensor-datasheet.pdf

Parents
  • Hi,

    For 1 bit interface,the image sensor has a frame rate of 30 FPS and the frequency of PCLK is 36 Mhz

    We don't support this frequency, not on SPI either.

  • I configured the image sensor to output a lower resolution image and got the frequency down to 10Mhz. Still, I am not able to read the values using the above program.

  • shakingwindow said:
    10Mhz

    10 MHz is unfortunately also way to fast for a GPIO interface like this. Try reducing the frequency further, if possible.

  • I am not able to reduce the frequency further.

    Is it possible to interface the hm01b0 camera, which has hsync, vsync, pclk, and d0 lines, with the nrf52 microcontroller which does not have a DCMI peripheral? Can the D0 line be read using SPI?

  • There is no reference to SPI in the hm01b0 datasheet. But, maybe it's possible to connect  hm01b0's pclk or MCLK  to a SPI clock signal, I don't know, maybe it's possible to ask the developers of this hm01b0 device somewhere. 

Reply
  • There is no reference to SPI in the hm01b0 datasheet. But, maybe it's possible to connect  hm01b0's pclk or MCLK  to a SPI clock signal, I don't know, maybe it's possible to ask the developers of this hm01b0 device somewhere. 

Children