Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Photon Counter

  1. #1
    Junior Member
    Join Date
    May 2019
    Posts
    7

    Photon Counter

    Dear all,

    I am considering the Teensy3.6 (the fastest Arduino like board that I know of) to develop a photon counter (I am physicist).

    I am looking to reproduce the "Buffered Edge Counting" mode found in many National Instruments boards. I attached a figure from the National Instruments manual.

    Click image for larger version. 

Name:	Buffered_Edge_Counting.png 
Views:	7 
Size:	25.0 KB 
ID:	16670

    The idea is to fill a buffer with the number of clock ticks since a trigger signal happens (SOURCE in the figure) each time that a rising edge occurs ("Sample Clock" in the figure, this is coming from the photon multiplier). Because a clock tick is associated to a time, it is possible to convert to time if needed.

    The closest I found to my problem is the code found here: https://github.com/tni/teensy-sample...apture_dma.ino

    But the code is a bit above my current level: I have to admit I am not in position to modify that code to do what I need. I can put time and effort if it is worthy...

    I am not asking to do the work for me, but I was hoping that some of the experts around here could answer the questions: Can the above be done? If yes, which performance can be realistically be achieved? By performance, I mean, what will be the time resolution that can be achieved, including sending the data to a PC (python serial?). I need to achieve, at least, 20ns resolution. (the National Instruments X-Series boards provides 10ns, but cost 40 times what a teensy3.6 board cost!)

    If you read until here: thanks a lot!

    PS: I know that FPGA are probably better for this, but I have some experience with Arduino boards and zero with FPGAs technologies...

  2. #2
    Senior Member
    Join Date
    Feb 2017
    Posts
    287
    Don't know if will work, but I'd look into using the input capture capability of a T3.6 Flexible Timer Module (FTM).

    First though, your "Requirements Document" needs to be fleshed out quite a bit:

    * Does it need to detect photons and transmit data to the PC continuously and simultaneously? Or, can you have an acquire mode to gather samples followed by a data transmission mode to send the data?

    * If you can have two modes as described above, how much data do you need to acquire before switching over and sending it to the PC? Is it based on time or number of "hits" detected?

    * How deep do the buffers need to be?

    * Is there a lower bound on the time between rising edges of your "Sample Clock"?

    * What is the minimum "High" time of your "Sample Clock"? Minimum "Low" time?


    Those are the questions I can think of right now.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,562
    BTW: This is a semi duplicate post from another thread - https://forum.pjrc.com/threads/48101-PMT-pulse-counting-using-Teensy-3-2

  4. #4
    Junior Member
    Join Date
    May 2019
    Posts
    7
    I was going to say it... (I was not sure that somebody was going to answer a 2 years old thread...)
    Should I delete this thread?

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,562
    Closing this thread - the ongoing discussion is here


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •