Shop OBEX P1 Docs P2 Docs Learn Events
Need help deciding if BASIC STAMP will work for my project. — Parallax Forums

Need help deciding if BASIC STAMP will work for my project.

DavidMDavidM Posts: 626
edited 2006-03-03 09:01 in BASIC Stamp
Hi,

My first post here, I have been doing research into micro-controllers.
I am deciding what kind of micro controller I need for my current project.

I am a 4D Database Programmer and have no problems with learning a new "basic" or "pascal style" programming that's required.
I have some electronic knowledge and have access to an electronics engineer for PCB Work.
I wish to undertake the design and programming of the hardware myself for this project.

I have looked at PICAXE, VESTA, ATMEL and also the new PROPELLOR Chip coming soon.
I have read some articles comparing BASIC STAMP to other MICRO-CONTROLLERS.
They all seem to claim that basic stamp is overpriced and under-featured and slower. but some of the reasons I am wanting to use basic stamp are as follows.

1) Australian supplier and support is available.
2) I have a MAC OSX programmer software available to use ( It must work with a mac!!) so far "MacBS2.app" is the go.
3) A very active forum ( this one ) for ongoing technical support.
4) Widely used.
5) The actual programming language. I don't want to learn C or Assembly)
6) The cost of the micro-controller doesn't worry me.

So heres some of the things I need a micro-controller to do for my project.

1) Network multiple micro-controllers together, all from a main controller module in series , The first controller may have up to 200-300 meters of cable, followed by the other controllers with say up to 50 meters of cable between them. So..

1a) What is Maximum baud speeds?
1b) How is addressing done?
1c) Maximum Distance for wiring in total and between units?
1d) Type of cable required for 2 way communication?
1e) Maximum no of micro-controllers that can be on the one cable run?
1f) Protocol RS232 or RS422??


2) Some form of TIMER Control. I need hours/minutes/seconds/ & (frames or milliseconds) similar to SMPTE.
2a) I need the program to be able to keep time in this format Can this be done on board or do I need a separate timer chip?

3) Must work with MAC OSX ( via USB to RS232 adaptor ) for programming and development. and also ongoing in situ communication.

4) Needs up to 10k of RAM for data storage ( apart from program /eprom storage) on some of the modules.

5) One Module Needs to interface with up to 50 keys ( push buttons etc) and up to 100 individual LED's on one board.

5a) I have looked at the MAXIM CHIP - MAX7219 for LED Control ( i think I need two of these)
5b) I wish to use E-LAB's EDE1188 Keypad encoder chip for keyboard scanning

6) LCD Display ( 4 x 20 ) control capability.

7) WIRELESS capability - some modules will need to communicate wirelessly up to 500-900 meters away from the main module.


Any help is greatly appreciated. smile.gif
I have many other questions but thats plenty for now.

regards

Dave M

Sydney
Australia

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-03-02 11:32
    Well, you can use RS232. But the longer the distance, the slower the speed to maintain data. That is not the biggest factor with RS-232. The real distraction is the +12/-12 volts.

    You can do the same thing with RS-422 or RS-485 drivers and not have to provide those extra voltages from somewhere.

    Also, you actually get a better system that is more tolerant of noise and failure. RS-485 will be less limiting on the speeds too. But it gets a bit silly to send a message at lightning speed and then wait forever for another. You don't really need to go that fast unless you are trying to control machinery in real time. There are even driver chips that are protected against lightning and other abuses.

    Addressing? I guess you would have to broadcast a message to everyone and then have the receiver deside if it applies. Usually this is done through a first byte or two that is coded as an address.

    Problems come into play when you want more or less 'equal relationships', one master is better with a lot of slaves [noparse][[/noparse]try telling that to your girl friend]. Equality causes simultaneous transmissions that collide and destroy each other. You have to sense the conflicts, aribitrate and resolve damaged messages. Thus you enter a big world of protocol pros and cons.

    CANbus seems to be a good choice, but expensive to apply in this fashion. Parallax had a CANbus transciever that was price at $99USD each. Of course you need at least two and probably many more. But, they really have resolved all the protocol issues and put them in the background.

    Two-way communication is either 'half-duplex' or 'full-duplex'. Half-duplex is easier to provide and probably is all you will ever need.

    Maximum distance of RS422/485 is kilometers and with repeaters you can go far and wide. They also have hubs for increasing the number of units on one net.

    MAC OSX - take a look at the downloadable software. After all, it is free and so is the main programing reference, and so is the book entitled What's a Microprocessor.

    10k of RAM could be in the form of a uALFAT-SD card reader. Actually, 16k EEPROMs are quite adequate and probably simpler.

    50keys -- Take a look at Al Williams AT-Keyboard to RS-232 adapter. You can use a conventional keyboard and re-assign keys to any function you want.

    100 LED's - you speicfication is quite unclear. I imagine that once you know what you want you will find it available.

    LDC Display - easily supported

    Wireless capability - can do in several formats [noparse][[/noparse]you might even be able to use Bluetooth in some cases].

    I can't really get to every question here, but you begin to see that the answers are positive.

    If you buy a BasicStamp and What's a Microcontroller, you will move a long way ahead. Just consider it a means of learning. What you envision requires acquiring a lot of diverse knowledge and skill sets.

    An active forum is likely your best asset for being able to sustain interest. And this is why I am here. Other places I find that I can wait days for an answer or just never get one.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • DavidMDavidM Posts: 626
    edited 2006-03-02 12:05
    Thnaks for your informative and timley reply,

    I get the basic idea that what I require is doable and that BASIC STAMP should work as needed.

    One of my concerns is the networking but from your answer I think this part is OK.

    I need to see how timers work in BASIC STAMP, thats now my only concern.


    thanks

    Dave M
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-03-02 13:02
    The Basic Stamps doesn't have any available Timers, but there are APPmods and single-chip solutions to be bought, though.
    I believe there was also mention of a chip with 32KB RAM, 2 timers, battery-backup support and such in one of the threads in the Propeller forum. This may help you a bit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-03-02 14:11
    David -
     
    As you have time to peruse the Parallax web site, you will come to learn of all the excellent educational, and applications based information which is available free for the download. One of the more robust and varied sources of applications information and examples can be found in the numerous Basic Stamp applications articles that have been written in "Nuts and Volts", a magazine published here in the US. The primary author of late has been Jon Williams, a Parallax employee, whom you will find assisting Stamp users right here on the Parallax Forums.
     
    All of the "Nuts and Volts" Basic Stamp articles, are available on the Parallax web site, at the link listed below:
    [url=http://www.parallax.com/html_pages/downloads/nvcolumns/Nuts_Volts_Downloads.asp]http://www.parallax.com/html_pages/downloads/nvcolumns/Nuts_Volts_Downloads.asp[/url]
     
    Along with the PDF articles themselves, you will also find that separate ZIP files are provided for the sample programs used in each of these articles. This basically eliminates the typos which can occur during manual entry.
     
    There have been a number of excellent "Nuts and Volts" articles written by Jon Williams on Stamp Networking, and you may want to take a look at them, to see how easily it can be done. The specific articles of interest are:
     
     Nuts and Volts                                   Name 
      Volume and                                       of
     Column Number                                  Article
    -------------------  ---------------------------------------------------------
     Vol 1 Col 28        "RS-485 Transceiver for Reliable Network Communications"
     
     Vol 2 Col 55        "Stamp Net Part 1 - A Multidrop Stamp-based Network"
     Vol 2 Col 56        "Stamp Net Part 2 - A Multidrop Stamp-based Network"
     
     Vol 3 Col 81        "A Tale of Two Stamps"
     
    I'm sure you will find other articles of interest in that compendium of Basic Stamp articles as well. Thanks go to Parallax for maintaining that "Nuts and Volts" archive, and to "Nuts and Volts" magazine for permitting the redistribution.
     
    Regards,
     
    Bruce Bates
    


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • DavidMDavidM Posts: 626
    edited 2006-03-03 00:13
    Thanks,

    I have had a look around and have found some info, There's lots to read.

    I will have a good look at those specific articles.


    My other concern is that the new PROPELLER chip is soon to be released, This seems to have more capability so do I wait for this and in the meantime do heaps more research, or just the current BSP240 say, and start learning the basics.

    If I go for the PROPELLER chip, I need to make sure that there is a MAC version of the software for programming.


    regards

    Dave M
  • sanguishsanguish Posts: 21
    edited 2006-03-03 05:52
    Hi David

    I believe at least one problem (and someone can correct me if I'm wrong) is that the BSP240 currently doesn't work with the MacBS2 application that is available (Parallax doesn't have a Mac version of the editor, it is a third party free app. Parallax does offer a lib (maybe CFM format, not sure) containing the parser - I believe that lib doesn't support that chip just yet). I'm really hoping the updated version is distributed as a Framework rather than a lib.

    I'd love to see a command-line parser/compiler for Mac OS X and a separate program to actually download the compiled app to the STAMP. Then the workflow could be incorporated directly into Xcode, and make great reuse of the already free development environment available to OS X users.

    Scott Anguish
    (Apple employee, but not speaking for Apple)
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2006-03-03 06:47
    Scott,
    Concerning OS X and MacBS2 -- It does work fine with the BS2P40. I use it a lot, and it is very well done. (The chip it does _not_ support yet is the BS2px). Murat Konar, the author of MacBS2, makes frequent maintenance upgrades, and the latest version available is always available from his web site www.muratnkonar.com/otherstuff/macbs2/. It does not have all the bells and whistles of STAMPW.EXE for the PC, but it gets the job done. There are additional features that would make it better. Maybe Apple can give him a grant?!

    Dave,
    There is not a Mac version of the Propeller IDE. As a beta tester I've been meaning to try it under Virtual PC, but haven't worked up to that.

    You have a very ambitious project in mind, no matter what processor you use. My guess from the way you came at this is that you have not worked at this machine level before. It will be necessary to break it into small bites and get them working individually before tackling the integration into whatever it is. Some of the requirements will be stretching the capabilities of the Stamp, but you will be able to fall back on external modules or circuits to take the load off the Stamp and to make your programming chore easier. The one that has me most concerned is #2, the SMPTE timing down to milliseconds. I don't know what that entails, especially in your system how it would need to be coordinated with all the other functions you propose to manage with the Stamp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • sanguishsanguish Posts: 21
    edited 2006-03-03 06:52
    Tracy...

    ah, thanks for the clarification.. I knew it was one of them. looks like I don't have to put off that purchase any longer. smile.gif

    I'd love to personally work on MacBS2 features.. I wish it was open source. Murat is a good guy for having released it at all.
  • DavidMDavidM Posts: 626
    edited 2006-03-03 09:01
    Thanks Tracy, ( And others )

    Im glad that the MAC Editor ( MACBS2) does work with the BS2p40.
    I hope Propellor has a MAC Version of an editor as well.

    In regards to my project.

    I will be planning to make tests on smaller specific tasks and keep it generic , I have no problem in writing a large complex program as I currently do this now with 4D, In fact My 4D application is what I plan to use with this BS2 project.

    I have done a little work with MIDI controlled relay boards and some IP ( UDP ) controlled relay boards. these were all readily available boards but lacked in the overall integration that I need. I plan to create flow charts for my project to scope out the functionality, I haven't fully decided on the features of my hardware yet because I don't know what's achievable.

    In regards to the SMPTE timing, I basically need to control relays remotely on a networked system , these relays will switch on and off according to a cue list, ( Think Show Control ). I already have MIDI Capabilities with millisecond accuracy doing just this, but the midi timing is handle by MAC's built in CORE AUDIO Features and midi does not like traveling over long distances,

    My projects main module is designed to control these relays in case of a computer malfunction or as a stand-alone unit.

    I wish to store a sequence of timings ( cues) in a RAM Chip on the module, This will need to be uploaded via the MAC.
    My sequence structure/format should be something like this..

    CUE TIME MODULE RELAY MESSAGE DURATION
    001 00:00:00:000 M01 R12 ON 00:00:05:000
    002 00:00:00:050 M01 R15 ON 00:00:05:000
    003 00:00:00:100 M02 R18 ON 00:00:05:000
    004 00:00:01:000 M07 R06 ON 00:00:05:000
    005 00:01:01:050 M03 R01 ON 00:00:05:000
    etc..

    I may have hundreds of cues. Some of then may occur at the same time .
    If you look at my time format I have Hours Mins & Seconds and the last three zeros being milliseconds.
    So basically I need the BS2 to start a sequence which will start a MILLISECOND Counter, I may store my cue times in millisecond format say long integer ( 2 bytes) , so as to avoid conversion during timer execution.
    I will then have a loop that will call up each cue and compare it to the current timer , if that timer is greater than or equal to the current timer value, I will send the cue to the appropriate module. this will allow for any MISSED cues to be released as well, I need about 100ms accuracy. So if the BS2 doesn't have a timer then I will need to use an external one.

    The duration for the Relay Off command will be handled by the receiving module.

    Regards

    Dave M
Sign In or Register to comment.