TSL1401-DB
rss
Posts: 8
in BASIC Stamp
Hello!
I have a TSL1401-DB mounted to BS2pe_MOBO board. I'm using the monitor program to see the output of the sensor. Basic operation is working. I attempted to make use of the Triggered acquisition without success.
I'm driving the ST pin on the 6 pin header of the daughter board. A high here causes a low on jumper J2 (jumper is installed). J2 connects to the MoBo board through the 12 pin header to P3 of the BS2pe processor. According to the documentation a high to low transition should initiate an acquisition. I don’t see evidence of the acquisition as the scope window on the monitor program doesn’t update. Interesting to note is that I can get Gated acquisitions to work: scope window updates continue while P3 is low.
Any ideas?
Thx,
Rob
I have a TSL1401-DB mounted to BS2pe_MOBO board. I'm using the monitor program to see the output of the sensor. Basic operation is working. I attempted to make use of the Triggered acquisition without success.
I'm driving the ST pin on the 6 pin header of the daughter board. A high here causes a low on jumper J2 (jumper is installed). J2 connects to the MoBo board through the 12 pin header to P3 of the BS2pe processor. According to the documentation a high to low transition should initiate an acquisition. I don’t see evidence of the acquisition as the scope window on the monitor program doesn’t update. Interesting to note is that I can get Gated acquisitions to work: scope window updates continue while P3 is low.
Any ideas?
Thx,
Rob
Comments
I'm the designer of the BS2pe_MOBO and the TSL1401-DB, and I'm the author of the monitor software. 'Sorry you're having trouble with the triggered mode. In ten years, you're probably the first person to try it! So ... I'll have to take a look at the AVR firmware to see what's going on.
BTW, do you have another daughterboard plugged into the other socket? The reason I ask is that P2 and P3 are shared between both sockets.
-Phil
No, socket A is unused. The daughter board uses socket B.
Rob
-Phil
By the way, is there any way to get the raw sensor data out to a file? Do you use the ATTiny's ADC to convert the sensor's output?
Thx,
Rob
Here's a program that will dump pixel values to the debug screen in CSV form. From there you can copy and paste into a file, if you like:
-Phil
-Phil
From the documentation: seems to say triggering and gating use the same pin
Trigger/Sync Control: Scans can be free-running, triggered, or gated. Triggering and gating
are controlled by Pin 3, which is a BS2pe port common to both daughterboards. When triggering
is set, a high-to-low edge on Pin 3 will cause a single scan to be acquired. When gating is set,
scans will be obtained continuously while Pin 3 is low
In another place the documentation states:indicating P3 of the STAMP processor is used for triggering
Although the acquire commands do not take an argument, there is one optional modifier that can be
ORed to it. This is the external trigger constant, XTRIG, which has a value of $08. When XTRIG is
ORed to any acquire command, the command, when executed, will wait for a falling edge on BASIC
Stamp pin P3, then begin its exposure. Since P3 is common to both daughterboard sockets, this same
pin triggers the TSL1401-DB in either one. This enables exposures to be synchronized precisely with an
external event, such as an encoder pulse or optosensor output.
Based on the daughter board schematic that appears to connect to the sensors clock net. I'm confused.
I've attached the schematics I'm using.
Rob
1. Use P3 (or any other non-committed pin) and let the BASIC Stamp program wait for the edge there before issuing an Acquire command.
2. Issue an Acquire command to the AVR firmware with the trigger modifier to wait for an edge on P2.
In case #2, the AVR firmware accepts the command, tristates the TSL1401 CLK line, waits for an edge via the TSL1401-DB's Schmitt-trigger inverter, then reasserts CLK and proceeds to acquire a scan.
Obviously, #2 obtains the scan in closer proximity to the edge than does #1. For this reason, it's the method used by the monitor program except when Sync is enabled. In the case of Sync, it waits for an edge on P3 (the trigger, in this case), then it waits for a pulse on P0, which is connected to the 6-pin block on the TSL1401-DB. If it times out waiting for the pulse, it just goes ahead and issues the Acquire command anyway. The disadvantage of doing it this way without a synchronizer attached, is that there will be a delay of 123.6 ms after the trigger before the Acquire is issued.
The synchronizer was meant to be a small board with an optical sensor used to detect 50 or 60 Hz flicker and send pulses in synchrony with that flicker. I made one prototype, and it worked, but it never went into production due to lack of demand.
Any discrepancies in the docs from my description above are my fault, and I apologize for whatever confusion they might have caused.
_____________
Regarding the data capture: unfortunately, the monitor program has no way at present to save captured data to a file. This would definitely be a nice feature and is something I'm considering for a future version.
You can use the code snippet I posted to do what you want, as I indicated. But you will have to include code for setting the exposure time and either wait for the trigger edge in that program or set the Trig bit in the Acquire command to wait for an edge on P2. My snippet and the monitor program cannot both be used at the same time.
-Phil
Welcome to the Parallax forum!
You might think that an illuminated shiny surface will always show up as "white", but that is not necessarily the case. What the camera sees is whatever the shiny surface is reflecting. The best way to examine such a surface for dark-colored marks, scratches, etc., is to position a matte-white card so that the camera sees it reflected in the shiny subject. Then illuminate the card, not the subject.
-Phil
-Phil