TSL1401-DB object for the Propeller Backpack
Phil Pilgrim (PhiPi)
Posts: 23,514
I've completed a rudimentary object for driving the TSL1401-DB from the Propeller Backpack. It performs these basic tasks:
To verify that it works, I've also written a down and dirty dirt simple PC monitor program (attached) that displays the pixel values as a real-time scope trace:
Note that there's no way yet to change the exposure time from the PC. You have to do this manually in the attached Spin program. The reason this has not been included in the monitor program yet is that there are two ways to connect to the Backpack: via the Prop Plug and via an intervening BASIC Stamp, Propeller, etc. How to communicate the change info depends on how the Backpack is connected. If it's via a BASIC Stamp, you have to reset the Stamp (to get its attention) then send the data. But the Propeller requires much longer to come out of reset than the Stamp does, so the effect would not be instantaneous. Anyway, I didn't want to delay posting at least something while I dither on the best approach.
Thanks to all for your patience. I know this was a long time coming.
-Phil
_
- Set the exposure time.
- Acquire a 128-pixel 8-bit grayscale image.
- Transfer the image array to the hub.
- Transfer image stats (min/max pixel values and locations) to the hub.
To verify that it works, I've also written a down and dirty dirt simple PC monitor program (attached) that displays the pixel values as a real-time scope trace:
Note that there's no way yet to change the exposure time from the PC. You have to do this manually in the attached Spin program. The reason this has not been included in the monitor program yet is that there are two ways to connect to the Backpack: via the Prop Plug and via an intervening BASIC Stamp, Propeller, etc. How to communicate the change info depends on how the Backpack is connected. If it's via a BASIC Stamp, you have to reset the Stamp (to get its attention) then send the data. But the Propeller requires much longer to come out of reset than the Stamp does, so the effect would not be instantaneous. Anyway, I didn't want to delay posting at least something while I dither on the best approach.
Thanks to all for your patience. I know this was a long time coming.
-Phil
_
Comments
-Phil
Thanks for your efforts once again.
I have a backpack en route to me, but in the mean time can you please clarify whether this will work with a standard Prop setup (proto/demo board), or is an adc required somewhere?
My first application is to try reading the stave and notes on piano sheet music... hopefully 128 px is enough for one stave if not two. My wife has recommended starting with ragtime (cos the durations don't matter as much), but I'm thinking something much more basic myself... and if that fails Pianola spools!
cheers
tubular
The software I've posted is designed for the Backpack and uses its sigma-delta ADC capabilities to read the pixel values. That's not to say that you couldn't use, say, the Propeller Demo board with an external ADC chip. It would require a change to the PASM adc routine to read the chip, and you could dispense with the calibration section. Also, for strictly black-and-white applications, you could simply run the analog output to a logic input, where it would be thresholded at Vdd/2. But you have to be careful that your subject is illuminated very evenly and has high contrast for this to work reliably.
I really like your application idea! My recommendation is to start simple and work your way up from there. Pianola spools, or even marks on paper with a Sharpie, should provide a good foundation for more complex score reading.
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 3/3/2010 7:03:26 PM GMT