Video via RS232

hippy

Technical Support
Staff member
It occasionally crops up, and here may be an answer -
http://www.electronics123.com/s.nl/it.A/id.2581/.f ( <A href='http://www.electronics123.com/s.nl/it.A/id.2581/.f' Target=_Blank>External Web Link</a> )

A mini video camera module with 'RS232' output. A variety of capture options down to 80x60 two-bit grey scale and up to 640x480 with on-chip JPEG compression. Snapshot and streaming modes.

The data rate and quantity may still be too much for a raw PICAXE to deal with, but I'm sure it has some uses.
 

Brietech

Senior Member
I still have a gameboy camera i've been meaning to play around with. That does look interesting though.
 

moxhamj

New Member
That is really interesting. I see the baud rate can go down to 7200. I wonder if we are getting into overclocked picaxe territory here?

Edited by - Dr_Acula on 03/09/2007 03:11:05
 

Dippy

Moderator
That looks excellent. I can put my dsPIC back in the drawer now.

How is PICAXE going to be able to do anything with the data? (Space/speed etc.)
 

moxhamj

New Member
The Holy Grail is to be able to take a picture and then look up the value of a pixel at position x,y. This sounds so easy to do (and it is with a PC) but it seems very hard with an embedded controller. Even with 7200 baud working, one still needs to read in the data, store it somewhere then look up particular values. That means another ram chip is needed which is a pity since these devices also have memory but you can't get at it. So many commercial devices produce data streams rather than memory locations, and the data streams are either raw video (very fast analog) or USB (very fast serial) or fast serial like these ones or SD ram/MMC (very fast). Nothing seems to work at picaxe speeds.

Edited by - Dr_Acula on 03/09/2007 08:19:39
 

Dippy

Moderator
Perhaps I'll get my dsPIC back out of the drawer.

Mind you, this <A href='http://www.robot-electronics.co.uk/shop/Camerax39s2081.htm' Target=_Blank>External Web Link</a> is close perhaps to what you discuss maybe?
 

moxhamj

New Member
Yes, that would be perfect, Dippy. Only catch is the price of 99 pounds, which is considerably more than an old 500Mhz PC (free) a video capture card ($30) and a 3 megapixel camera ($20). For robotics, it still would be easier to have the brain 'off site' with the camera on the robot transmitting via 2.4Ghz, doing the video processing on a PC and then sending control data back to the robot.

I'm still trying to think of a way to hack a USB video camera or a USB still camera as these devices a so cheap. Maybe the device in the original post plus maybe a pic or a non picaxe board (arduino?, propellor?), or maybe some sort of cheap USB host if such devices exist.
 

Dippy

Moderator
You've got a serious project there Drac.

PIC as a USB host? I don't think so, unless you go the Vinculum route or also have a look at MAX3421E <A href='http://www.maxim-ic.com/appnotes.cfm/an_pk/3785' Target=_Blank>External Web Link</a> which will work with PIC.

Maybe &#163;90 isn't so bad after all....?
 

boriz

Senior Member
FPGAs are extremely fast and often used for video processing. You could prolly interface a PICAXE to one. Trouble is, the development kit is pricey and programming them is non-trivial.
 
With the Pic 18F4550 you can read in serial data and transmit it via USB at USB 1.0 fullspeed. I have used this chip to interface successfully to multiple picaxes via serial interface.
 

hippy

Technical Support
Staff member
Finding a video solution for a PICAXE is always going to be hard. If the manufacturer doesn't make the unit PICAXE friendly ( which comes at a cost, like CMUcam ) something has to be added to sit between the 'low performance' PICAXE and the higher performing video system.

The manufacturer in this case could perhaps be convinced to make it more PICAXE / Basic Stamp friendly, but otherwise the speed and memory requirements will likely overwhelm a PICAXE.

The best solution would perhaps be something like the RS232 camera but with an I2C interface so the processor can pull back the image as it wants it and get at individual pixels. An interface for these cameras to I2C could be fairly easily built with a PICmicro or other processor with enough on-chip memory.

Having chosen a PICAXE, it's all a bit like complaining that one cannot get a rally car conversion kit for a Smart car.
 
With the Pic 18F4550 you can read in serial data and transmit it via USB at USB 1.0 fullspeed. I have used this chip to interface successfully to multiple picaxes via serial interface. Okay youd have to program the USB bit in C, but Im sure it would do the job for you.
 

hippy

Technical Support
Staff member
c6jones720 : <i>With the Pic 18F4550 you can read in serial data and transmit it via USB at USB 1.0 fullspeed. </i>

Or you could buy a $2 webcam which sends via USB anyway.

Dippy : <i>Great products nonetheless. </i>

It would solve one problem I've been wrestling with; how to have multiple 'snapshot' webcams around a building. They would be too far apart for USB connection back to the central server without expensive cable/buffering, and ethernet webcams are ( perhaps were ) too expensive, and each would need configuring.

Using a PICAXE-based hub switch, a single PC serial port can select any one of the RS232 camera channels, ask for an image, get it, store it, publish it, ask for the next.

Far simpler than the next best alternative which had been a video capture card and a PICAXE selecting an appropriate video signal for it, which would still need a serial port / VSP to control it.

Using serial makes the server application virtually platform independent, works with USB-to-serial, and no issues with video capture card drivers. A simple four core connection even allows the cameras to be powered down when not being read.
 

moxhamj

New Member
Hippy, multiple distant webcams is one of the problems I want to solve as well. I looked at USB but switched USB means the cameras are constantly logging in and out. I went for the cheap video capture card with a single yellow RCA video input. Then a switch box driven by picaxes talking to the serial port via a picaxe router system (along with lots of other data). Some cameras are directly wired in. Some are via 50 metres of RF link and directional yagis. And certainly there are solutions using baluns to cat5 that can send video signals quite a lot further than that.

But it all depends on the PC and the distances are limited and also, whenever the PC crashes one has to restart the capture program manually. Plus I'd to get the video into a picaxe friendly format so it can go further. I'm sure there are robot applications that could benefit from video.

I don't know much about i2c nor whether this could help.

If only picaxe could act as a USB host (sigh). It could do so much more - read a mouse, a camera, a keyboard as so many things are now USB.

Edited by - Dr_Acula on 03/09/2007 14:59:57
 

picaxester

Senior Member
Hey, just a thought (probable a stupid one) but couldn't you just connect the PICAXE directly to the ccd? For a test you could start with one out of a optical mouse.
This might help:
http://spritesmods.com/?art=mouseeye
 

moxhamj

New Member
The cheapie mouse cam might be a bit low res for many functions but it may well have some applications. One thing that is interesting is that it contains a chip to convert rs232 to usb. And this is in an object that is almost considered to be a throwaway item. It is a pity that the reverse, ie usb to rs232 is so hard and expensive.

Perhaps the problem will solve itself in a few years when palm computers are available secondhand.
 

womai

Senior Member
As for

&gt;FPGAs are extremely fast and often used for
&gt; video processing. You could prolly
&gt;interface a PICAXE to one. Trouble is,
&gt;the development kit is pricey and
&gt;programming them is non-trivial.

Not quite true. E.g. Xilinx sells development boards for their Coolrunner CPLD (somewhat simpler to use than an FPGA, but runs up to 200 - 300 MHz) and the Spartan FPGA for a measly US$50, and that includes the board, the download cable, a time-unlimited version of their development software, and printed (!) manuals for all that. Quite a steal. I just ordered the Coolrunner board. Looks like a great addition to the Picaxe - use the Picaxe for control work (quick and easy to do), and the CPLD for the fast stuff.

To avoid bias, other FPGA vendors (e.g. Altera) have similarly priced offerings but it looks like none of them is giving away time-unlimited versions of their software, which is a put-off for me, and I found their documentation much less user-friendly for a beginner in digital design.

just my 2 cents

Wolfgang
 

hippy

Technical Support
Staff member
I'm still keeping an eye on FPGA kit, and the cheapest, half-decent Spartan system, seems to be the $59 <A href='http://www.digilentinc.com/Products/Detail.cfm?Prod=BASYS&amp;Nav1=Products&amp;Nav2=Programmable' Target=_Blank>External Web Link</a>, but then add on an extra $40+ shipping plus $15(?) import duty, and near $120 isn't that cheap :-(

On the plus side, if one's prepared to pay that much, one can buy a better board for effectively the same price locally.
 

womai

Senior Member
Maybe you want to have a look at the CPLD board instead - since it comes from Xilinx itself, you may be able to procure it locally? The current pound-to-$ exchange rate should help as well :)

<A href='http://www.xilinx.com/xlnx/xebiz/designResources/ip_product_details.jsp?key=HW-CRII-SK-G&amp;sGlobalNavPick=PRODUCTS&amp;sSecondaryNavPick=BOARDS' Target=_Blank>External Web Link</a>

Of course less complex than an FPGA, but one has to learn to walk before attempting to run ... also, how many of a Picaxe user's designs are going to require more than about 10000 logic gates (which the 256 logic blocks approximately equate to)?

It also helps when your company is paying for it because you can label it an educational/training expense, which indeed it is for me :)

Wolfgang

 

Brietech

Senior Member
FYI - Both altera and Xilinx have free versions of their tools. Xilinx has the ISE Webpack (which is time-unlimited) and Altera has QuartusII web edition, which has a 150-day timeout, but renewing the license is free (you just have to request a new license on their website and they e-mail it to you). I actually found Quartus to be a little nicer to use than ISE, as ISE's interface seems to have gotten really clunky with their last few releases.

In terms of best &quot;value,&quot; the boards from www.xess.com have to be far and away the best (and can be programmed with a parallel cable, no JTAG needed!). They also include onboard SDRAM, flash (for loading the bit file) and diagnostic LED's, along with .1&quot; pins.

(off-topic: If anyone needs to make their own Parallel-&gt;JTAG programmer for setting up xilinx FPGA's, however, I have software to control it if you are interested - could also be done from a picaxe, but it would take about ~12 hours!).
 

Dippy

Moderator
Brilliant. Give it a go Picaxeter and let us know how you get on. It cetainly could be a goer for a scanner/bar code reader / edge detector - though a play around with the optics may be required as I've never taken one apart.

Connection to a cheap TV camera CCD, however, may be a bit tricky for we mere mortals. So, maybe connect to the composite O/P? Suggest people do a few calcs on the subject of A/D speed and data block size before connecting an 08M.
 

BeanieBots

Moderator
I agree Dippy. Ideal resolution for PICAXE &quot;vision&quot; in a robot.
Give it a go picaxester and let us know how it worked out.
 
hippy &quot;Or you could buy a $2 webcam which sends via USB anyway&quot;

Sure thats true but have you ever tried programming a computer for stereo using webcams? In many cases the OS will only let you access one camera at a time.

Using those little RS232 cameras you could multiplex the feeds and process more than one video stream at once..
 
Top