Shop OBEX P1 Docs P2 Docs Learn Events
general question about microcontrollers — Parallax Forums

general question about microcontrollers

grindelgrindel Posts: 68
edited 2007-06-16 06:41 in General Discussion
There are a dizzying array·of microcontrollers out there and I am just barely getting an understanding of their conceptual use.··Mostly I see myself using it for interfacing with various sensors and outputting the results to a computer through a USB port, while still leaving most of the programming on the onboard laptop (I.E. use the functionality of roborealms webcam·image processing functionality and have sensors assist with or double check·object avoidance)· Would there be an advantage to starting with one controller over another if one·is starting from scratch?· Propeller seems to be the most fully featured of the parallax line.··Does it make sense to start there·and not to worry about being hardware limited in the future, or·are controllers with a simpler architecture easier to·deal with?··

Thanks for the help.

Comments

  • JonathanJonathan Posts: 1,023
    edited 2007-05-24 21:29
    There sure are a lot of uC's out there. Since this is the Parallax website, let's stick to the ones they make. You can find out more about·others elsewhere.

    A quick run down of my take on the Parallax line:

    Basic Stamp 2 (p,pe,sx). The easiest to use and learn on uC of all time. Rock solid, IDE comes with (asit does with all Parallax products) great deal of sample code floating around. Slower than many uCs.

    SX chips. Fast. Cheap. Has a decent version of Basic and can be programmed in ASM. Needs a programming "key". Not as much sample code.

    Propeller. Wow. 8 uCs in one package. Mind blower of a chip. Not as easy to use as the other two, but really worth it if you need the power. Has a unique language called "Spin" and can be programmed in ASM. Sample code growing quickly.

    I teach, and I use nothing but Parallax stuff in the classroom. Their support is by far the best in the business. Their documentation and teaching materials are outstanding. I use all three of the product lines for differnet things. If you want to learn uCs, my reccomendation would be to start with the Basic Stamp and once you finish all the tutorial material Parallax has to offer, you will be in a position to decide what uC suits your needs.

    HTH

    Jonathan




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • grindelgrindel Posts: 68
    edited 2007-05-24 23:41
    The problem is that the basic stamp is in the same price bracket as the propeller, but with my current knowledge I don't have the ability to quantify what I am trading. Will any of these controllers handle outputting data from multiple sensors to a computer? I like the TV out and keyboard input on the prop demo board, but I'm not sure how well I would be able to use it at my skill level.

    anyway, thanks for the advice...I just need to read a lot more. I think the main problem is that there seems to be a lot of excitement around the propeller board I don't want to get in over my head. (probably already too late)
  • floodhoundfloodhound Posts: 45
    edited 2007-05-24 23:42
    I agree with Jonathan; the support is unmatched and there is tremendous amount of code to scrutinize if you pick a Basic stamp. No matter what micro you pick you have to learn its language and the way it operates, i.e. registers, flags and the like. I learned C programming, so I like using chips that allow a C type of programming structure. Also 20 years ago I picked up a language called BASIC, so the Basic Stamp was a nice and easy transition to move into using its PBASIC compiler.

    As far as communicating to a PC and acquiring data; it will take a bit of time. It is insolently fun as well as rewarding at first. Then it becomes an obsession.
  • JonathanJonathan Posts: 1,023
    edited 2007-05-24 23:57
    Part of the decision is whether ot not you have hardware and software experience. playing with uC's generally take·a little of both. If you have none in either catagorey, I would reccomend the Basic Stamp. It's a very cheap way to get your feet wet, and even if you move on to the Propeller or SX chips, the Stamp you bought will find a use. While it is slower, you can create many great projects and products with them. So starting with one is by no means a waste. The WAM kit would be one good choice to learn with.

    It also depends on what you plan to do. The Propeller will have a steeper learning curve, but can do amazing things. If you have any previous programming and/or hardware skills, it's totally doable. Many of us, including myself, taught themselves using the available materials and examples. The SX chips fall somewhere inbetween the Prop and the Stamp in terms of learning curve. They are quite fast and flexible.

    HTH

    Jonathan





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • agfaagfa Posts: 295
    edited 2007-05-25 00:37
    The support at parallax is amazing.· You have done the research.· sometimes you have to take the plunge.· You will definetly be supported.· If your first choice dosn't work the costs are minimal.· I personally found pbasic easy to adapt to, but I have basic experience.· I may be wrong but the propeller is one of the most powerfull controllers offered from Parallax. I have delt with other vendors, Parallax leaves em all in the dirt.

    ·
  • FranklinFranklin Posts: 4,747
    edited 2007-05-25 00:57
    If you're just starting out I'd go with the propeller since you have nothing to unlearn and all of the chips will have some learning curve.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • metron9metron9 Posts: 1,100
    edited 2007-05-25 05:05
    I make use of my original Basic stamp2 at least once a week. Its great for all of my initial ideas and testing almost anything you can think of.

    It was my first microcontroller (Bought at Radio shack) unless you count the Vic 20 and Commodore64 because I programmed in assembler for those 20 years ago.

    I have to say it sat on my desk for almost a year, then I started using it, now I have the SXkey and at least 5 programmers for Atmel chips and 6 large cabinets with lots of drawers stuffed with hundreds of components. I guess I have a hobby.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2007-05-26 07:01
    For the purposes that you described, the BS2 series would make the best choice, for several reasons:

    1. The widest range of educational material of all the Parallax products
    2. The most available code samples
    3. Very beginner friendly
    4. Still expandable via module upgrades, including using the new Spin stamp in some situations
    5. The BS2 is 5V logic based vs. 3.3 for Propeller. As a beginner, you'll find it a bit easier to deal with, find part, sensors, etc.

    Since you want to use a laptop to do a lot of the heavy duty computing, you wouldn't really lose much by choosing the BS2 over the Propeller. If you were choosing one or the other as the main CPU for the next Mars Rover, the Propeller would be the better choice. Although there are a few people that post here that could probably get the BS2 to work. If you read some of the case studies about what people have built with the seemingly wimpy BS2, you'll find that it isn't wimpy at all.

    As for the excitement over the Propeller, a lot of that is from people that already have a lot of experience with the BS2 & SX under their belts, and can really take advantage of the extra power.

    A book that you might want to check out is titled Physical Computing: Sensing and Controlling the Physical World with Computers. It deals with the BS2 and a few other brand micros, and the title gives you the right idea about its emphasis.
  • grindelgrindel Posts: 68
    edited 2007-05-30 21:46
    I understand and appreciate the comments. It looks like the BS2 is the microcontroller for me, but before I plop down my money, I just want to be sure, will the BS2 have enough horse power to shuffle information from 2-5 sensors (including the ping module and compass sensor to begin with, and then maybe adapting an optical mouse for movement and position tracking) to the computer at about 10 times a second (probably overkill for my slow moving robot)and recieve instructions from the computer at about the same rate? And, in the future, conceptually, could I hook the Parallax Servo Controller directly to the basic stamp and have it supply the computer with information and handle the nuts and bolts level corrections for navigation? (I am pretty sure it is possible, but I want to make sure I am not shooting myself in the foot for my specific application)

    I find there is a minimum of a second lag when using a webcam to control my robot right now, so I want to inch my way closer to enabling the user to hit "kitchen" button on the web and not worry about my 80lb robot hitting things on the way from the living room.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-30 22:06
    The BS2 will not have the kind of horsepower you want to have eventually, but it will do just fine initially. The Parallax Servo Controller is really just a servo controller. You can't use it for any of the things you're implying. You give it a goal position and some parameters on getting there and it will do the in-between management, but nothing else. On the other hand, the Stamp Motherboard with its BS2pe Stamp and the two little Atmel controllers could certainly take some of the sensor management and servo management load off the Stamp, but probably will require some custom programming of them.

    I think that you should plan on eventually having several controllers (like 2 or 3). They can be all in one, like the Propeller. They can be something like the Stamp Motherboard, or you can "roll your own" using several Stamps.
  • grindelgrindel Posts: 68
    edited 2007-05-30 22:41
    woops,

    I didn't mean to imply that I was doing anything with the parallax servo controller other than control the servos.
    What I was trying to get across, is that, right now, I have the PSC connected to the computer directly, I am still undecided whether to leave it connected to the computer and have the basic stamp provide sensor information to an on computer program which would then adjust it's output accordingly. Or the other option would be to have the basic stamp between the computer and the PSC...essentially the computer would relay movement requests from the web and then the basic stamp would figure out if it is going to hit something if it moves in that direction...I need to figure out how to alert the user that it doesn't think it can move that direction or start moving and guide itself to the middle of the largest space. Maybe it would point the camera to what it thinks you mean and ask if this is the intended course.
  • Dave HeinDave Hein Posts: 6,347
    edited 2007-05-30 22:59
    I first bought a basic stamp kit from Radio Shack and tried out all the examples given in the book. I then discovered the SX, and I ordered the SX Tech Tool Kit PLUS. I have never touched the basic stamp since then. If you program the SX in basic, it is almost as simple to use as the basic stamp. If I had to do it over, I would have gone directly to the SX and skipped the stamp.

    The SX can handle multiple sensors, or you could use one SX per sensor if that better fits your application. A dozen SX chips would be cheaper than a single basic stamp. The only major concern I have with the SX is that it only comes in 1 DIP package. I would like to see 18-pin, 14-pin and 8-pin DIP versions.

    Dave
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-30 23:04
    Your initial description implied to me that you wanted a significant amount of control in the Stamp (or SX or Propeller). I see that you're thinking of the Stamp primarily as a low-level controller for the sensors. For that purpose, it should work well as long as the PC is the master. I say that because the Stamp is a single-threaded processor. When it's listening to the PC, it can't read the sensors. I envision that the PC will request a sensor scan (or some other action), and the Stamp will respond when it's done and has some data, then the PC will ask again.

    I do have a bias towards the Propeller for any kind of multi-sensor or multi-processing sort of application. You can do some interleaving of functions with a Stamp (particularly with servo control since there's 20ms between control pulses ... that leaves lots of time to do other things, even with a Stamp).
  • grindelgrindel Posts: 68
    edited 2007-06-01 05:46
    Thanks again for the input. Mike,Your description is exactly what I had in mind. I have been reading everything I can get my hands on for the propeller and the BStamp..."What is a microcontroller" was a great introduction and it got me excited. I think finding the wulfden PRC has almost pushed me over the edge for the propeller. Any tips on soldering? heh. I think I understand now that the propeller could be sitting in the background with a cog running sensor loops for several sensors and the information would be there for the taking as fast I want to use it (for my application at least). That is a cool concept. I would still like to use the PSC mainly because I have no other use for it, although it looks like it might be an issue for the propeller:

    http://forums.parallax.com/showthread.php?p=649620

    I'm sure the solution lies somewhere in the 5V interface sticky, but I'm having trouble figuring out what are suggestions and what is conjecture.

    If it were easy, it wouldn't be fun, and I'm learning a lot just by doing the research on this decision.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-06-01 06:24
    I've read the thread on using the PSC with the Propeller. I'm not sure what's going on for that particular person, but I've connected a variety of 5V devices successfully to a Propeller and I suspect that the PSC will work just fine if it's connected properly and the Propeller is programmed properly. On the other hand, who needs a PSC if you've got a Propeller with enough free pins (for the servos) and one free cog for the servo driver. A shortage of pins might be a reason to use a PSC, but another Propeller Protoboard is pretty cheap.

    Soldering is something where it's helpful to have the right tools (like a basic temperature regulated iron with a small tip). I'm sure you can find some articles on the web on basic soldering. Get some scraps of PC board material and some cheap resistors and practice soldering. The most important part is to get the parts hot enough without overheating them before you apply solder. When do-it-yourself kits were more common, they all came with excellent instructions for soldering, sometimes even some extra parts for practice.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-01 16:45
    grindel,

    The issue with the PSC/Propeller is due to the way the activity LED works on the PSC. It is connected directly to the serial line and imposes an inherent pull-up effect when the signal goes low. For the Propeller this causes the signal to not swing low enough to be detected when using an inline resistor as recommended when interfacing 5V devices to the Propeller inputs. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Mike GreenMike Green Posts: 23,101
    edited 2007-06-01 16:50
    Thanks Chris for explaining.

    grindel,
    Do have a look at the "sticky thread" on the Propeller forum on interfacing the Propeller to 5V devices. There are all kinds of solutions discussed that should work ... from level-shifting ICs to simple circuits using a couple of transistors and resistors.
  • grindelgrindel Posts: 68
    edited 2007-06-14 16:45
    Just to round this thread out with some initial experiences:

    I bought the wulfden.org PRC with all the bells and whistles and used a good soldering iron at work to put it together. It was an easy assembly and highly recommend it,
    this was my first circuit board assembly.

    Last night I got the PE hardware kit and some other goodies and started working through the labs and code examples. Everything has worked well so far.
    I had done enough research prior to my purchase that to actually start to be able to do things with it was very satisfying. I'm sure I'll have a ton of stupid questions but,
    I was happy I was able to get lights to blink, and ended the night by successfully modifying spin example 4 to display the distance sensed by ping...Which was much simpler
    than I imagined it would be.

    Some notes about the PRC:
    Double check you have all the components before you start assembling it, I was missing a capacitor for the TVIO board, I picked up one from Radio Shack
    no problem, but I had to stop for the night.
    If you set up the board for USB and serial programming connections, you will end up having to make a jumper wire for the USB2SER connection because
    it interferes with the IO boards.

    I'm excited.
  • grindelgrindel Posts: 68
    edited 2007-06-16 06:41
    Thanks to all who commented

    I am pretty sure I have posed this pictures a couple of years ago when I started this project, but I will again to show the behemoth that is currently the web controlled bot. I haven't hooked up the propeller yet because I am still working out the interface between the compass/ping, prop, laptop, and the (possibly eliminated) parallax servo controller

    MVC-026S.jpg
    this shows the drive system based on lawn mower parts using geared 540 motors powered by 2 picoesc (a company that now appears defunct) but basically they are a complicated RC car ESC...taking PWM and changing it to DC voltage
    The frame as eventually reworked.


    MVC-001.jpg
    out for a test run.

    P1108792.jpg
    P1108791.jpg

    shown before I had the pan and tilt mount built, the box housed a freaking heavy deep cycle battery and 110V converter for days of run time. Also missing are the bumper switches which hooked directly to the limit switches of the ESC. Basically, it wouldn't allow you to travel any more in that direction but they supply no information to the program that something is wrong.

    What has lead me to needing a microcontroller: I have found that no matter what quality one uses you still end up with at least a second of lag on webcams. This is ample time for a heavy robot to start slowly climbing an obstacle and be on its way to spilling its lead acid guts all over your nice electronics.
Sign In or Register to comment.