more basic stamp IO

My winter project is a microcontroller to ventilate and water my greenhouse/high tunnel. Parallax has a sale on controllers with free
shipping through tomorrow. I plan on using Opto 22 boards and IO blocks for this project. Parallax makes a module just for this: http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/27945/List/0/SortField/4/ProductID/289/Default.aspx
(parallax part number 27945 if link above breaks)
I did a count this morning and this is no where near enough IO. Parallax makes a 40 pin stamp with 32 IO that would work. But they don't make the above module for it. I don't want to paint myself into a corner. Should I look at building a custom 27945 module for the 40 pin stamp? (I don't normally do this kind of work) Or is it no big deal to use two stamps and link them to communicate? Other ideas?
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Sun, 03 Jan 2010 09:29:58 -0500, Karl Townsend wrote:

List/0/SortField/4/ProductID/289/Default.aspx
If you've got some mileage under your belt with communications protocols, and if the language doesn't hold the capabilities of the chip too far away from you, it _should_ be no big deal to have them talk.
Now count the 'ifs', and tell me if you're comfortable.
Perhaps the best thing to do (if Steamer doesn't already know the answer better than I do) is to Google around a bit for someone who's done this.
From a systems engineering perspective, all else being equal, you're much better off with one processor doing one job. If this module was available for a 40-pin basic stamp it'd win hands down.
If you can get two modules talking, and if the I/O works out that you can have one in charge of ventilation and one in charge of irrigation, that should minimize the need for communication. Alternately you could have one doing all the thinking, and the other one (or two) that's just a dumb slave.
But I think the first thing I'd do, if I were in your shoes but with my shop and capabilities, would be to see if I could make an adapter cable (or cable adapter) between one 40-pin module and two of those clever I/O modules. _If_ they are 'dumb', and pretty much just provide a plain old interface between the basic stamp and the outside world, without any programming or fancy dances, then you should be able to do this fairly easily. I'd say "with parts from Radio Shack", but I'm not sure you can get all the bits any more. If this is as easy as it could be, it'd be the hands-down winner.
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/27945/List/0/SortField/4/ProductID/289/Default.aspx
How much I/O do you need? Motor up/down takes 2, limit switches take 2, and 2 for thermostat or serial temperature sensor. Then if you have an operator interface you can get a serial LCD and 4 inputs for select up/down, 1 for Enter, 1 for Back (or Esc). Parallax (among others) also sells a ULN2803A chip that can drive 8 external relays up to 50VDC 1/2A, complete with built in diodes for inductive loads.
I bought a PIC32 starter kit from Digi-Key (Microchip has them for same price), has a lot of I/O, 512K program memory, 32K ram, and a optimizing C compiler with a 64K limit, all for $49.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId &15&dDocName=en532453
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

No A/D on that chip?
SMbus or I2C are good for simple 2 pin communications between devices. http://www.maxim-ic.com/app-notes/index.mvp/id/476
The receiver can use clock \_ edges to latch data and doesn't need to sync very well to transmit timing.
jsw
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote in message

/ /No A/D on that chip? / /SMbus or I2C are good for simple 2 pin communications between /devices. /http://www.maxim-ic.com/app-notes/index.mvp/id/476 / /The receiver can use clock \_ edges to latch data and doesn't need to /sync very well to transmit timing. / /jsw
It has 16 channel of 10 bit A/D. It's listed to have 85 I/O but I know a few are used for programming, debugging, 3 LED's and 3 PushButtons. You could probably have 16 channels of analog and still have over 50 Digital I/O left.
I bought some chips to play with on my Basic Stamp board, I tried out the LTC1298 A/D converter and it works fine.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I also installed a 1/rev contact to detect/count motor movement on each motor. There are four of these motors total for a total of 20 IO here . I also sense outside temp in addition to two inside temps and want to leave room for a wind velocity sensor (future) - four more. Then there will be two soil moisuture sensors and a water pump - three more. I'll need a couple or four for an LCD read panel. I'd use any extras for a small operator interface to do things like open or close everything. From experience, I know to leave room for more IO, always seem to need it.
I'm not aware of this ULN2903A chip, I'll look into it

Basic stamp is easy to program and well documented. I'm not at all unconfortable with it. I feel just the opposite about working with C or assembler. Plus, I'd be on my own for driving an Opto 22 board.
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

With all those things to poll I'd be wary of motor sensors that required timing measurements.
jsw
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Sun, 03 Jan 2010 13:17:52 -0500, Karl Townsend wrote:

If you have the $$ to be extravagant with processors, use one per motor and have them all talk on an RS-485 bus (assuming you can easily get set up with RS-485 hardware).
Or don't -- it's how I'd design the system if I were going to sell it, but half-duplex networking can be a bitch to get working the first time.
If I were anywhere close I'd offer to drop by and help out, but IIRC you're in Wisconsin or Michigan or some other place influenced by large amounts of fresh water and generally flat land.
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Sun, 03 Jan 2010 20:04:54 -0600, Tim Wescott wrote:

Or or or -- if you have the serial ports available, have a master with an RS-232 out that constantly broadcasts target positions for all the motors & whatnot, then a slave on each motor or whatnot. Then it's just single- way and you won't be dashing yourself on the rocks of half-duplex protocol development after hearing the siren song of two-wire communication.
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I'd run the complete opposite direction, Tim.
What projects like this need is a Kim-1 with a BASIC interpreter in ROM, along with a P-coded application (also in ROM).
Or an 8 Mhz XT running DOS.
As an aside,
If the Operating System could be considered the Engine that runs the computer then by Microsoft's example everything from a weed eater to a 787 would have a gigawatt nuclear power plant running it.
Everything else would be run by Cox .049 model airplane motors.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

Man, I thought the same thing after his first post. Kim-1 or AIM-65. Programmable in BASIC, FORTH, PASCAL or assembler.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Don Foreman wrote:

I have hopes for the Micro Kim. If I can turn up a cross compiler that makes ROMable code, that would be one hot set up...
--

Richard Lamb
http://www.home.earthlink.net/~cavelamb /
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

...
I've built or maintained a lot of one-off test systems of similar complexity, which usually were assembled around an old desktop or laptop with I/O ranging from a small wirewrap board on the printer connector to a rack of GPIB instruments.
The PC brings a nice built-in development environment and the keyboard and display, all very useful when the application needs considerable monitoring and adjustment or data logging.
Their power consumption isn't too bad. I've measured around 30 - 40 Watts for PII desktops, half that for laptops running without their dead batteries on the AC adapter. The 400 MHz Armada laptop I use for datalogging draws 14W at idle.
If you decide to put your circuit on an internal wirewrap prototyping card the bus interface can be quite simple. One that I did for the VME bus consisted of a very wide gate combining the addresses and read/ write commands that clocked a single D flop to send the acknowledge. My ISA and Mac NuBus interfaces weren't much more complicated than that. I think you can find proto boards with a full bus interface installed, though you can get by with mapping the board into IO address space. ISA is easier than PCI. http://www.epanorama.net/documents/pc/isabus.html
Laptops are a little harder to talk to. Some PICs support USB or serial data. The printer port is really quite useful for both serial and parallel I/O if you run DOS, but Windows polls it and interferes with the control register. http://www.epanorama.net/circuits/parallel_output.html#circuithow http://www.doc.ic.ac.uk/~ih/doc/par / By decoding two control lines you can have 32 read/write bits in four registers, plus Read and Write strobes. You can sneak two more control bits out of a serial port. http://www.aggsoft.com/rs232-pinout-cable/pinout-and-signal.htm
jsw
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

    What used to be really nice for special controllers is the OS-9 operating system from Microware (not the Apple Mac version, which was totally different). The boot code can be in ROM -- or the entire OS and application. You can built the application in 6809 assembly language, or with a BASIC-09 incremental compiler, or with a C or Pascal compiler. Once you have it doing what you want, you can burn the entire thing into ROM, and only need RAM for the stack where all transient data lives. You can have it talk to serial or parallel I/O, or to floppy drives or to hard disk drives. I even wirewrapped an interface for and wrote the drivers for an old Calcomp drum plotter for my SWTP 6809 system.
    Of course, these days, OS-9 is tailored for the 68000 family of processors, and costs a *lot* more. It is no longer a hobby OS -- instead, it is used for embedded controllers.
    Enjoy,         DoN.
--
Email: < snipped-for-privacy@d-and-d.com> | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
cavelamb wrote:

Or a VIC-20 with the software in a game cartridge? :) Most of them only needed +5 VDC @ 1A and had a nice I/O port. As far as controlling four motors, that could be done sequentially, which would reduce the I/O requirements quite a bit.

--
Greed is the root of all eBay.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

It would probably be a good idea for you to develop your application with the Basic Stamps and after you get it like you want, you can work on getting it to run on a $7 PIC microcontroller and get some circuit boards made. A lot of the opto 22 modules are TTL compatible and I believe would work directly with the Basic Stamp. The ULN2803A chip I mentioned has 8 Darlington transistor drives for $1.50, that could drive your external loads up to 50V 1/2A.
I've seen a lot of bad examples of programming for the Basic Stamp. The programs are well written but they make the Stamp only do one thing at a time. I got a Boe Bot for Christmas and am rewriting one of the example programs to run more like a PLC program.
For more I/O, you can use something like buffer chips for inputs and latches for outputs and a multiplexer to enable what you want to address at that time. For example, perhaps an address of 1 would give you I/O for motor 1, address 2 for motor 2, etc. .. addresses 0,5,6,& 7 could all be used for temperature and/or operator interface. So, on a 16 I/O PIC you can have 64 I/O without much trouble.
I'm also pretty sure that it's easy to communicate stamp to stamp. Shift in on one and shift out on another, or serial in on one and serial out on the other.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Karl Townsend wrote:

http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/27945/List/0/SortField/4/ProductID/289/Default.aspx
Some alternatives to look at as well, Karl.
Eagle 50 - starting below $50 http://micromint.com/index.php/SBC/eagle-50.html
RTC180 Zylog Z180 with ROM monitor or BASIC180 - $288 http://micromint.com/index.php/RTC/rtc180.html
RTCv25 16 bit 8086 compatible - Under $500 http://micromint.com/index.php/RTC/rtcv25.html
Or, something considerably more retro? A brand new 1 megahertz (COUNT IT!) Kim One compatable SBC - $99 http://www.brielcomputers.com/micro-KIM.html
THIS is the kind of thing I was talking about earlier.
--

Richard Lamb
http://www.home.earthlink.net/~cavelamb /
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/27945/List/0/SortField/4/ProductID/289/Default.aspx
    Well ... the Opto 22 boards which I have have a maximum of 24 I/O channels -- in part because it is fed through a 50-pin cable (power ground, +5V, and a signal-ground pair with each channel, so a long cable will have a ground between any two signal lines to reduce the chance of noise coupling from one line to another.
    You would need two 50-pin ribbon cables to handle the 32 I/Os which you want, and that would typically go to two Opto 22 boards so you have easy access to the screw terminals for each I/O channel.

    I would go for the latter approach. This has the advantage of reducing the load on any one stamp. You simply have to define some kind of I/O protocol for the communication between two stamps and make one the master and the other the slave. Or -- perhaps -- make one handle all outputs and one handle all inputs for monitoring results.
    Good Luck,         DoN.
--
Email: < snipped-for-privacy@d-and-d.com> | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Sun, 3 Jan 2010 09:29:58 -0500, "Karl Townsend"

If you're comfortable that the 40-pin stamp would meet all other criteria, namely has enough I/O and you feel able to program it in BASIC, I wouldn't worry about the module. We can cook up an interface between stamp I/O and opto-22.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Don Foreman wrote:

Nothing to that...
http://www.opto22.com/site/solidstaterelays.aspx
120 volt 10 amp - $14 http://www.opto22.com/site/pr_details.aspx?cid=4&item 0A10
--

Richard Lamb
http://www.home.earthlink.net/~cavelamb /
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.