Spinneret + PropCAM == WebCam (User Pannable)
Phil Pilgrim (PhiPi)
Posts: 23,514
Remember the PropCAM, that forever-in-gestation, never-produced thing I came up nearly five years ago? Well, it's got a new use. Through consultation with and cooperation from David Carrier in the Spinneret's design, plus some extraordinary good luck, it turns out that the PropCAM will plug into the Spinneret's daughterboard connector almost without modification. Here are the details:
1. Consultation and cooperation: On the Propeller Backpack, the daughterboard pins connect to dedicated ports. There were not enough unused ports left over on the Spinneret to do this, though. Through consultation with David at Parallax, it was decided to bring A24 through A31 out to the daughterboard connector on the Spinneret, in that order. A28 and A29 are shared with the EEPROM's SCL and SDA pins, and A30 and A31 are shared with the PropPlug when it's plugged in. At my suggestion, all four of these are pulled up to Vdd, to correspond to similar pull-ups on the Propeller Backpack (and MoBoStamp-pe).
2. Good luck: The PropCAM is controlled via I2C; and, when plugged into the Spinneret, its SCL and SDA pins just happen to coincide with those of the EEPROM. Since the sensor chip uses a different address from that of the EEPROM, there's no conflict. This pinout is actually derived from that of the MoBoStamp-pe, whose P0/P1 and P8/P9 I2C pins are in the same position. The pin order on the Prop -- completely by accident AFAIK -- is a perfect match. I love it when things work out this way!
3. Almost without modification: The PropCAM was originally designed to operate in parallel mode only, using the four MSBs of the sensor's D7..D0 outputs, resulting in 16 gray levels. Because of its required 10 MHz dot clock, that entailed connecting D7..D4 to A3..A0 on the Prop, so the data could be read in and shifted in two instructions. For this reason, the Propeller Backpack's daughterboard connector epxresses A0 through A7. After trying in vain to read and shift A27..A24 in two instructions, I almost gave up. But then I remembered that the sensor also has a serial mode, wherein one bit of data is output on D0, while D7..D2 are tri-stated. So I connected a 680R resistor between D0 and D4 to be able to read the bit on A24. That's all it took, plus some program mods to read the serial data stream. Here's the inner read loop that packs eight four-bit nybbles into each of the 16 longs that make up a scan line:
Here's a photo of the "SpinneretCAM" at work:
You can see what it's looking at by going to:
I'll leave it running overnight and possibly into tomorrow. (Hopefully Browser won't mess with it while I'm asleep.) Please let me know of any glitches you encounter. BTW, the native image size is 128 x 96 pixels. The webpage displays it at 200%.
I'm glad that I had not gone into production with the PropCAM, since I can now add the needed resistor to the board layout! Maybe I'll even have a batch made!
-Phil
1. Consultation and cooperation: On the Propeller Backpack, the daughterboard pins connect to dedicated ports. There were not enough unused ports left over on the Spinneret to do this, though. Through consultation with David at Parallax, it was decided to bring A24 through A31 out to the daughterboard connector on the Spinneret, in that order. A28 and A29 are shared with the EEPROM's SCL and SDA pins, and A30 and A31 are shared with the PropPlug when it's plugged in. At my suggestion, all four of these are pulled up to Vdd, to correspond to similar pull-ups on the Propeller Backpack (and MoBoStamp-pe).
2. Good luck: The PropCAM is controlled via I2C; and, when plugged into the Spinneret, its SCL and SDA pins just happen to coincide with those of the EEPROM. Since the sensor chip uses a different address from that of the EEPROM, there's no conflict. This pinout is actually derived from that of the MoBoStamp-pe, whose P0/P1 and P8/P9 I2C pins are in the same position. The pin order on the Prop -- completely by accident AFAIK -- is a perfect match. I love it when things work out this way!
3. Almost without modification: The PropCAM was originally designed to operate in parallel mode only, using the four MSBs of the sensor's D7..D0 outputs, resulting in 16 gray levels. Because of its required 10 MHz dot clock, that entailed connecting D7..D4 to A3..A0 on the Prop, so the data could be read in and shifted in two instructions. For this reason, the Propeller Backpack's daughterboard connector epxresses A0 through A7. After trying in vain to read and shift A27..A24 in two instructions, I almost gave up. But then I remembered that the sensor also has a serial mode, wherein one bit of data is output on D0, while D7..D2 are tri-stated. So I connected a 680R resistor between D0 and D4 to be able to read the bit on A24. That's all it took, plus some program mods to read the serial data stream. Here's the inner read loop that packs eight four-bit nybbles into each of the 16 longs that make up a scan line:
:line waitcnt time,interline movd :save_acc,#line_buf mov long_ctr,#16 jmp #:long_lp :pre_nyb nop 'b2 nop nop 'b1 nop nop 'b0 jmp #:nyb_lp :long_lp mov nyb_ctr,#8 :nyb_lp test inpmask,ina wc 'b7 rcl acc,#1 test inpmask,ina wc 'b6 rcl acc,#1 test inpmask,ina wc 'b5 rcl acc,#1 test inpmask,ina wc 'b4 rcl acc,#1 rol acc,#24 'b3 djnz nyb_ctr,#:pre_nyb 'b2 rol acc,#4 :save_acc mov 0-0,acc 'b1 add :save_acc,_0x200 djnz long_ctr,#:long_lp 'b0
Here's a photo of the "SpinneretCAM" at work:
You can see what it's looking at by going to:
I'll leave it running overnight and possibly into tomorrow. (Hopefully Browser won't mess with it while I'm asleep.) Please let me know of any glitches you encounter. BTW, the native image size is 128 x 96 pixels. The webpage displays it at 200%.
I'm glad that I had not gone into production with the PropCAM, since I can now add the needed resistor to the board layout! Maybe I'll even have a batch made!
-Phil
Comments
-Phil
-P.
It worked fine for me.
Very cool. What's become of the PropCam ?
Bean
1. The sensor chip has been discontinued. I have 1500 of them, and could do a limited edition, though. I'm also discussing with another sensor company the possibility that they could obtain an IP license from Kodak to produce it again. (Kodak bought it from National Semiconductor.)
2. The sensor chip package is a ceramic LCC -- not the easiest thing in the world to solder and get centered properly. And they need to be baked for awhile prior to soldering. Finding an assembly house to try it, without committing the whole inventory and then finding out they can't, seems a bit daunting.
3. There's a lot of software that still needs documenting, which means trying to figure what I wrote nearly five years ago. Ugh!
4. I'm in a virtual orchard of much lower-hanging fruit right now. I'm also lazy.
Those are really lame excuses, aren't they?
-Phil
-Phil
To access it, go to: http://phipi.homelinux.org:3456
-Phil
-Phil
Cache-Control: no-store
This prevents the browser from being lazy and serving up images that it had retrieved previously.
-Phil
-Phil
-Phil
This is really cool.
'
How do we get a PropCam?
I second the above question.
-Ron
-Phil
Mr Pilgrim:
'
I find your inventions to be Brillant to say the least.
-Phil
BTW I just logged onto your site and saw you looking at me. It was like a bizarre version of skype without being able to at least say hello.
-Phil
The image from the PropCAM is packed in memory as five six-bit pixels per long. The entire 128x96-pixel image requires 9984 bytes of hub RAM. It's displayed on the webpage at 3X scale.
With the new website, you can also adjust the gamma of the display to 0.5 (brightens dark stuff), 1.0 (normal linear scale), or 2.0 (darkens dark stuff). The camera can be accessed here:
Please let me know if it gives you any trouble.
Thanks,
-Phil
Thanks,
-Phil
P.S. BTW, are you this Mike G?
Yes and no on the multi-socket. The request piece is published and working. I hit the request logic hard with Apache Bench. Well, over 40,000 requests with 2, 3 and 4 concurrent users. 5 concurrent users would cause a timeout somewhere after 8,000 requests but the server stayed up.
There are two other pieces in development; processing (kinda' done just not wired up) and the response logic. The idea is to move the request logic and the response logic out of the main web server object. That way end users can place custom processing code in top web server object but have access to a request and response objects (header stuff).
BUT, you still only have 4 sockets. Right now the web server is online serving up request using 3 sockets. I know that you were able to consistently reproduce issues downloading images. Please, give it a shot.
http://spinneret.servebeer.com:5000/index.htm
Did I muddy that up enough?
I have a machine vision project and would like to consider something Prop-based. Are there any other similar developments?
Regards,
Mickster
http://www.cmucam.org/projects/cmucam4
It's now available at Robotshop.
Thank you.
Regards,
Mickster