external clock pulse

176 views
Skip to first unread message

jdf...@gmail.com

unread,
Mar 11, 2021, 6:14:55 AM3/11/21
to Miniscope
Hi everyone,

Is it possible to control video acquisition with an externa clock pulse. I'm not talking about an external trigger that arrives one time and tells the system to start taking video at 20 Hz. I'm talking about a clock pulse that arrives to the miniscope 20 times a second and makes it acquire a single video frame each time so I get 20 Hz video that's synced up with other hardware in the system.

I had originally intended to use the external trigger input on the DAQ for this but now I realize that is a video trigger not a frame trigger. It's starting to look like I need to get deep under the hood of both the hardware and the software to integrate an external clock pulse. Am I missing something?

Regards,

John

Daniel Aharoni

unread,
Mar 15, 2021, 3:59:51 PM3/15/21
to Miniscope
Hi John,
Currently triggering individual frame acquisition is not supported but it is theoretically possible to implement. Right now we don't have plans to implement this ourselves but would be happy to  give you some guidance on how to implement this. Roughly speaking you will need to do the following:
  • Update the MCU firmware on the V4 Miniscope to configure the PYTHON480 CMOS sensor in trigger mode
  • Update the DAQ firmware so that an interrupt gets called every external clock pulse
  • Have the DAQ send a command to the V4 Miniscope on each interrupt and have the MCU on the Miniscope receive this command and then send an acquisition trigger to the CMOS sensor.
A slightly simpler option would be to have the Miniscope continuously stream frames to the DAQ and then have only the most recent frame sent over USB to the computer on external clock pulse. This would only require a minor change to the DAQ firmware and would still result in an external trigger always generating a Miniscope frame within the timing of 1 single frame variablility. 

Ian Jones

unread,
May 14, 2021, 1:07:27 PM5/14/21
to Miniscope
Hello,

Thanks for the advice! I'm currently trying to implement the slightly easier firmware change, as I am new to USB and firmware programming. To implement this change, would I just need to modify the GPIF II state machine so that it only transfers thread data from the two transfer threads after receiving the RecordTrig signal, instead of using the signal to begin video streaming? I guess I'd then need a different way to initialize video streaming then? I may be way off in my understanding of the firmware here but this is my best guess...

Thanks,
Ian

Daniel Aharoni

unread,
May 25, 2021, 2:32:25 PM5/25/21
to Miniscope
Hi,
I guess this depends on exactly what you are trying to achieve. Only modifying the DAQ firmware and/or Miniscope Software will, at best, only let you throw out unwanted frames. The Miniscope itself will still constantly be acquiring frames at whatever FPS you set it to and then your trigger would just allow the last, or next, frame to be sent from the DAQ to the software. If you want to actually trigger the acquisition of individual frames in the CMOS image sensor on the V4 Miniscope you will also have to modify the MCU firmware running onboard the Miniscope. This MCU is able to put the image sensor in a triggerable state and then trigger the initiation of acquiring a frame. This is quite a bit more work but would result in individually triggered Miniscope frames.

Ian Jones

unread,
Jun 14, 2021, 2:28:20 PM6/14/21
to Miniscope
Hello,
Our goal is to actually trigger the scope to acquire frames when we send a clock pulse. I was initially planning to try implementing the easy/less effective solution, but I would rather just go all in and reprogram the MCU.
Best,
Ian

Ian Jones

unread,
Jun 23, 2021, 4:35:34 PM6/23/21
to Miniscope
Hi Daniel,

I've been working on getting the solution above to work and I've made some progress. I changed the PYTHON480 code to set it up in global trigger mode and set the mcu to trigger the sensor after receiving a trigger from one of its external trigger pins.  While the mcu and the sensor programming were relatively straightforward, I'm stumped as to how to get the DAQ working as it should. I am confused as to how exactly the DAQ communicates with the mcu and how frame data is transferred. I would like to be able to write to a register on the mcu to trigger frame aquisition, but I'm not really sure if that's even a possible way to go about accomplishing this with the uvc interface. Do you have any pointers on how I should move forward?

Thanks,
Ian

On Monday, March 15, 2021 at 2:59:51 PM UTC-5 dbah...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages