Fast processor to handle high speed pixels

I am trying to create a “dot detector” and I need a fast processor.

A short one-off pulse (say 30ms or so - can be anything required) of IR light appears as a dot on a wall (generated by an IR laser).

I want to locate where the dot is in a single frame within the field of view of an image sensor module plus lens. Catching it in a frame also tells me “when” the pulse appeared - to the nearest frame.

The sensor used will be black and white only (no Bayer filter to worry about) and an IR pass-through filter (made from unexposed but processed Ektachrome film) will be placed in front of it so it is ONLY sensitive to IR light.

I have all this working with the old OV7221 640x480 mono sensor at 30fps. The top bit of the parallel output of the sensor, D7, goes into an ATtiny2313 running at 20MHz using Timer1 input capture as soon as this bit is set within a frame - i.e. as soon as a pixel is illuminated. The code in the ATtiny keeps looking and eventually reports back the Xmin, Ymin, Xmax and Ymax corners of the spot. It may sound crude, but it works!

Note: this is NOT frame grabbing, I am not interesting in the image, only the location of the IR spot within the field of view. After the dot is reported my software determines the location of the centre of the dot.

I want to scale up to a higher resolution and I am open to using any (sensibly priced!) mono sensor such as the 2 megapixel OmniVision OV2311 - 1600x1300 pixels.

This has everything I need EXCEPT it only outputs 10 bit parallel data at 40fps with a pixel clock rate of 96MHz!

I am tearing my hair out trying to find a suitable MCU at a sensible price - i.e. one that can do what I am doing with the OV7221/ATtiny2313 combination, but at the much higher 96MHz pixel rate

Obviously the clock rate of a processor does not mean it can carry out one instruction per cycle so it is the “instruction rate” rather than the clock rate that is important.

I have considered the ATSAM4S2B running at 120MHz but this doesn’t leave much margin for error!

I am also aware of the high speed PICs like the PIC32MZ-EF (which claims 415 DMIPS) or the much pricier STM32H743AI (which claims 856 DMIPS) but I have no experience of using these.

Anyone got any suggestions? Could the PIC keep up?

Can’t you use the timer caputure feature to detect the spot more accurately than you could withinstructions?

westfw: Can’t you use the timer caputure feature to detect the spot more accurately than you could withinstructions?

My apologies - that's exactly what I do on the ATtiny2313 - I use Timer1 input capture.

The Teensy 3.6 (Cortex-M4F) is overclockable to 240 MHz. Unsure of the speed in DMIPS, I would expect this could be found in the processor manual which is the Freescale MK66FX1M0VMD18.

https://www.pjrc.com/store/teensy36.html

WattsThat: The Teensy 3.6 (Cortex-M4F) is overclockable to 240 MHz. Unsure of the speed in DMIPS, I would expect this could be found in the processor manual which is the Freescale MK66FX1M0VMD18.

https://www.pjrc.com/store/teensy36.html

Many thanks for that - and I think I have that Teensy on a shelf somewhere - there is so much stuff on shelves I lose track!

However, as a module it is a bit pricey (about 30.00 USD) and the processor isn't cheap (about 12.00 USD).

The ATSAM4S2B is about 2.50 USD and the go-fast PIC32MZ is about 6.50 USD.

Maybe I'll get a SAM4S Xplained Pro development kit and a PIC32MZ Curiosity development board and try them side by side. It's an excuse to buy more stuff to put on the shelf!

The new samd51 is also 120MHz, cheap, and available is arduino=like bootloader boards with ide, core, and library support. As are some TI Tiva boards.

Some chips can run some timers at a multiple of the cpu clock rate (ie tiny85, but I think that only gets you to 64MHz.)

westfw: The new samd51 is also 120MHz, cheap, and available is arduino=like bootloader boards with ide, core, and library support.

Agreed - I like the low cost of the SAMs - not that I am tight-fisted (much) - but a BOM is a BOM!

I am happy to work with AVR Studio (though I like the Arduino IDE for most stuff) and there are no significant libraries required for this simple task of "spot the dot" and "report back".

This is really an insult to an MCU - think of all the things it can do ("brain the size of a planet") and all I am asking it to do is spot a dot! That's why an FPGA would be the bee's knees - but development is way too expensive and I can't do it myself.

Anyone know any friendly FPGA engineers willing to do some overtime?

I've seen stm32f4 series some uCPU has DCIM - digital camera interface. There are nucleo evaluation boards for low price, and code examples to work with DCIM in the STM32Cube package. Arduino IDE does support a few stm32f4

All you need is faster timer hardware.

The 640x480 sensor is pushing out pixels around 10MHz, the new one around 85MHz

The timer you use is running at 16MHz. You want one at about 100MHz instead that can be gated by your signal and read at the microcontroller's leisure

Presumably the current logic is read the captured times repeatedly and compare to the line start time and line count?

If you can trigger a counter to run from the line start, and freeze when your signal comes in, you just need an ISR to read the counter when the signal comes in.

More complicated if you want the RHS of the dot to be detected - a second counter perhaps?

Finding a good high speed gatable counter chip is the difficult part. I've used the 74LV8154 before, but its 40MHz max.

Another possibility is analog sensing - use a ramp circuit that starts at the line start and runs till the signal, and a fast ADC to read the final voltage. All this requires is the line blanking signal to reset the ramp and the dot signal to stop the charge source.

Of course switching to something with enough oomph to run OpenCV will do the trick nicely too!

Many thanks for that.

I use the ICP pin (PD6 on the ATtiny2313) connected to the MSbit of the incoming pixel data. That's enough to tell if the pixel is illuminated or not. The whole thing is written in assembler to avoid any timing problems in the code.

The OpenCV stuff looks really interesting though it is mainly based on scanning captured frame data - I want to capture the state of a pixel in real time within a frame as it is arriving from the sensor. I know which frame I am in (since I started looking) and which pixel is the first one set in the spot I am looking for, so I know WHEN the spot appeared to a pretty good level of accuracy - as well as WHERE it is.

I just need to do it faster for a higher resolution sensor.

Since my original post I have acquired an Adafruit SI5351A Clock Generator Breakout Board (8KHz TO 160MHz). I am going to use this to simulate the pixel clock of higher resolution sensor plugged into various MCUs to see if we can keep up.