Hardware timer based coincidence trigger
Intro
I'm making a cosmic ray detector based around the mbed. The detector is built using plastic scintillator, wavelength shifting fibre and silicon photomultipliers. When a charged particle (usually muons at ground level) goes through the scintillator some of its energy is absorbed and emitted as visible light. Some of the light will hit the wavelength shifting fibre, which absorbes the light, and remits more light at a lower wavelength, some of which is captured in the fibre. The light that couples into the fibre hits the a silicon photomultiplier. This is a solid state devices that is constructed from an array of pixels. Each pixel, if it absorbs a photon, will allow a small current though the device. The pixels have a large gain, so each absorbed photon leads to a current of many electrons (10^6). All the pixels are connected in parallel, and so the total current passing through the sensor is proportional to the number of pixels which absorbed photons.
The detector has a silicon photomultiplier at either end of the optical fibre. Each sensor fires a trigger when the current passing through the sensor exceeds a set threshold. However, the sensors have a high rate of fake signals compared to the rate of signals from cosmic rays. The fake rate can be reduced by raising the trigger threshold and also by implementing a coincidence trigger. When a cosmic ray passes through the detector both sensors (at either end of the fibre) should receive a signal at essentially the same time. The fake signals occur randomly, however, and so the probability that they both receive a fake signal in a short time window scales with the length of the time window.
A coincidence timer can be implemented using the mbed SDK's Timer class, however this requires waiting for software in interrupts to play with the timer, at at best can give microsecond resolution. The LPC1768 has a number of hardware timers that could be used to implement a coincidence trigger that should have better performance than one based on the Timer class.
TIMER2
The LPC1768 has 4 timers (TIMER0/1/2/3). Each timer has two capture input pins. These can be set up to store the current value of the timer when the input changes (or rises/falls), and optionally cause an interrupt. There are also at least two match output pins, which can change their output when the timer's value matches stored values. The timers also have some internal matches, that can reset the timer, interrupt, etc when the timer's value matches other stored values.
TIMER2 and TIMER3 both have their capture pins routed to the mbed's pins. TIMER3 is used for the SDK's timing classes, so playing with this should be avoided. TIMER2 will therefore be used for the coincidence trigger. The mbed pins corresponding to the TIMER2 pins are shown below
TIMER 2 function | mbed pin |
---|---|
CAPTURE0 | p30 |
CAPTURE1 | p29 |
MATCH0 | p8 |
MATCH1 | p7 |
MATCH2 | p6 |
MATCH3 | p5 |
Coincidence trigger
How the hardware timer based coincidence trigger works, the library to use it, etc..
1 comment on Hardware timer based coincidence trigger:
Please log in to post comments.
Exposed pin mappings for Timer 3: