View Full Version : BASIC Stamp
GregT
Aug 30, 2002, 04:21 PM
Does anyone use these in thier models?
We just got a few of them in school and im in love :)
I see so many applications to models, I just figured I would see what (if anything) others have done...
Andy W
Aug 30, 2002, 04:36 PM
I use 'em, but never in a model (yet).. I bought an LTC1298 A-D convertor with a view to building an in-flight data logging unit. Never got 'round to it, however..
..a
Mr.RC-CAM
Aug 30, 2002, 05:35 PM
I have used dozens of them in custom factory automation projects. First time I did so was back in the early 90's. Even the lowly "Stamp I" can be used in surprisingly complex systems.
One was even used to test angioplasty balloons. It was the brains to a device that would blow them up, then deflate, all the while checking for the proper inflation times. Would do this until the balloon failed, where it then reported the stats. Was used to validate the materials.
I occasionally still use them to prototype new products, especially for quickie mockups destined for "Dog & Pony shows." At some point the design migrates to a lower cost embedded solution.
Yes, there is a lot to love when it comes to the Stamp family.
Regards,
Mr. RC-CAM
www.rc-cam.com
GregT
Sep 01, 2002, 12:03 PM
I plan on using them instead of a computer radio :)
Mainly because I have basic stamps, but don't have a computer radio...
I've successfuly used a basic stamp2 to mix, duel rates, even to take action if it loses the transmitter (sets the plane into a gentle glide-decent, sets off a alarm to aid in locating downed planes).
I haven't yet begun to think about the posibilities regrading input. Imagine if you could place sensors on your plane and program your computer radio using the output of those sensors!! A gyro and you've got auto-pilot. GPS and you've got some really cool options (though a serial connection is a bit much for the basic stamp to handle, buffers and such are too large)... If you can get rpm's / current / voltage to the motor you can do some stuff with extending your flight time...
Im gonna have a fun couple of months :)
Steve McBride
Sep 02, 2002, 01:44 AM
Not sure how complicated or possible it would be, but how about an IR based dog fighter setup?
Could have an IR emitter in front, an IR detector in back. Strapped to the top or bottom of your favorite combat ship, you fly around and try to 'zap' the other guy. A hit would drop the voltage to the ESC to about 5v, kicing in the ESC low voltage cutoff. You could drive a tone in a tiny speaker to indicate a hit. Could even run the 'gun' off another switched channel or let it go automatically.
Possible?
Steve
Tapio
Sep 02, 2002, 02:47 AM
BASIC Stamp
Does anyone use these in their models?
I do not have a computer radio, thus I made a V-tail mixer from one. Recently I've switched over to PIC16F84 with PicBasic compiler, much cheaper hardware, much more speed, and as easy to program as Stamp (due to the Basic).
BUT!
As you did not state "RC" models, I must add that I'm also using a PIC programmed with Basic in my F1H glider, to control the model through bunt and glide. These same things could be made with mechanical timers, but electric ones are much more convinient. For more details see: http://www.pp.htv.fi/tlinkosa/digitimer/
http://www.pp.htv.fi/tlinkosa/digitimer/fuz.jpg
Gary Warner
Sep 02, 2002, 11:23 AM
I used the PIC micro controller IC (the heart of the Basic Stamp) to make an angle of attack sensor that controls the elevator on a sailplane.
SkynetAir
Sep 02, 2002, 01:53 PM
Hi, I also use the PIC microcontroller for RC aero and heli applications. So far I have made 2 speed controllers, and am currently designing a 3rd one which hopefully will be better. I also have developed a NiCd/Mh battery charger and am working on a Li-Ion charger.
I think you would be better off using the PIC microcontroller instead of the BASIC stamp, -the language is virtually the same, and PICs come in many many more flavours than the stamp. For example, MicroChip have just released these tiny 8 pin MCUs with on board 4 channel ADCs!! (12F675).
In the next month or so, I am also going to be starting an onboard avionics / autopilot system using distributed processing of PIC micros,- all of them programmed in PIC Basic.
You can see my ESC at this address:
http://www.peaps.btinternet.co.uk/mcu/escmk2/escmk2.htm
There are so many applicaitons where PIC micros could be used in the RC community, -it kind of makes it a double hobby when you get into them! :D
tekochip
Sep 02, 2002, 03:29 PM
I've used Pics, but not since I used the Z8.
The ZiLOG uPC is far more powerful, and you get a full emulator for the price of a PIC programmer.
They're releasing a FLASH family next month with on-board debugging. The complete eval kit with compiler and debugger is only $49.00
MrBungle
Sep 03, 2002, 01:57 PM
I too play with PIC's, also the scenix range which are the uC's replacing the PIC's on BasicStamps.
The Scenix chips are copies of PICs but are much much faster ... 50MIPS(!!!) compared to 5MIPS for an '84 running at 20Mhz.
I did try PICbasic for a little while, but its limitations quickly ended that. I only use assembler now, with MPlab (free software)
By tekochip:
The ZiLOG uPC is far more powerful, and you get a full emulator for the price of a PIC programmer.
???
My PIC programmer cost about $2
One nice thing about the programer I use is that it requires no external power, it gets power direct from the serial port (5 to 8v I think) and charge pumps a pair of capacitors to generate the 14v programing voltage needed.
If anyone would like to find out more about this programer let me know and I'll try to find the link.
Simon
SkynetAir
Sep 03, 2002, 02:36 PM
From a modelling point of view, I don't see the point in having to deal with assembly language. There's not a lot that you can't do in PIC Basic that you can in assembler.
Also, because BASIC is such a widespread and commonly understood language, it doesn't take long for someone to get to grips with it and start producing useful programs in not a lot of time. Try and get people to start learning assembly, and they'll have to have a history of C++.
As for the ZiLOG, again, there is much more info on the PIC. It is the heart of the STAMP and lots of people have them. I think it is ideal for many applications, especially RC.
As an example, some guy is making a UAV which processes GPS, altitude, attitude etc etc, solely with PIC processors. At the end of the day, the only limitation is your creativity.
Andy Peaple.:D
RMihara
Sep 03, 2002, 05:09 PM
Originally posted by APSystems
Also, because BASIC is such a widespread and commonly understood language, it doesn't take long for someone to get to grips with it and start producing useful programs in not a lot of time. Try and get people to start learning assembly, and they'll have to have a history of C++...
Ahh but Assembly came before C and C++ so I don't see why you consider it to be a prerequisite. I had to learn assembly before C and did not find it too difficult. Keeping track of my stack, etc. was :D
Regards,
Roger
waagbuck
Sep 03, 2002, 05:20 PM
I've seen simple robots move about the floor with a basic stamp at the core, but I have only the bare minimum as to how these things work. Can anyone recommend a book that gives an overview of the basics?
RMihara
Sep 03, 2002, 06:10 PM
Waagbuck,
check out the Parallax (http://www.parallaxinc.com/) website, particularly the Bo-Bot and Sumo-Bot links. They also have books on stamp basics.
Regards,
Roger
Kitsu
Sep 03, 2002, 11:50 PM
I noticed this while looking through a year old Model Airplane News... http://www.rcmodels.org/csm/Airwars.htm
Horizon is supposedly the US store that carries it, but they only had the PC interface on the site. Looks like it could be very very cool, tho I have never heard about anyone using it. Don't even know the range of the system.
~A
Originally posted by Steve McBride
Not sure how complicated or possible it would be, but how about an IR based dog fighter setup?
Could have an IR emitter in front, an IR detector in back. Strapped to the top or bottom of your favorite combat ship, you fly around and try to 'zap' the other guy. A hit would drop the voltage to the ESC to about 5v, kicing in the ESC low voltage cutoff. You could drive a tone in a tiny speaker to indicate a hit. Could even run the 'gun' off another switched channel or let it go automatically.
Possible?
Steve
MrBungle
Sep 04, 2002, 03:03 PM
Originally posted by APSystems
<snip>
Try and get people to start learning assembly, and they'll have to have a history of C++
<snip>
.Andy Peaple.:D
I have never seen C or C++
I have no problems with Basic as a language, It seems to be very popular and there must be a reason for that.
Assembler is the only language that I have learnt, I'm not saying it was easy, actually It was pretty hard for someone that had never programmed anything before, all these wierd terms and names, but it only took a couple of nights reading to get a basic grasp of what was going on, everything just kinda falls into place after a while, but I'm still learning new ways to do certain things, and I always will, as I find Assembler to be extremely versatile.
As far as I understand it, these Higher level languages were designed to make programming easier for much more complex systems, like PC's and such where the CPU's machine code has many thousands of possible commands. PIC ('84) assembler has 33 core commands, this number grows ofcourse with the different ways each command can be used with literals, operands and flags and such but it still pales in comparison to an 80x86 or 68xxx, where higher level languages are almost mandatory.
I honestly think that for me, learning Basic would have taken just as long to learn as did Assembler.
An advantage I see with Assembler is that the software is free from MicroChip.
To be fair, the brief experience I had with PICbasic was VERY brief and it was the first time I have ever played with Basic of any kind(except as a kid on the old C64), so I haven't explored its full capabilities and I may have been going about things in totally the wrong way.
While I only played with PICbasic for a short time, I found that while using the PWM and DELAY commands, the PIC was tied up counting and could do nothing else until it had completed that command.
With assembler, while the PIC is executing delays or PWM or anything else that needs accurate timing, you can make the pic execute other commands INSIDE the PWM routine, these commands actually become part of the delay. Ofcourse, you can't do anything that would exceed the length of the delay, but it's easy to do things like scanning pushbuttons, outputting to LCD's or in our case, checking to see if the state of the Rx input pin has changed.
If this is indeed possible With PICbasic, I appologise.
My only experience with PICbasic is limited to helping a friend with a PWM Halogen Light dimmer for night-time mountainbike use. He had already written his program and asked me to help debug it ... The light was Off when connected to power, but each time the pushbutton was pressed the lamp increased in brightness, from 25%-50%-75%-100%-Off-25%-50% etc etc.
Pretty simple, but a headache with a language I was not familiar with. I also found debouncing the pushbutton a pain, I finally got a clean reading, but the debounce delay would turn the light off until it had completed.
Anyway, I agree with you that in most RC applications that the speed advantage of assembler is not needed and that Basic will do the job. (I would like to see a BL ESC done in Basic ;) ). I dissagree that an understanding of C is needed to learn assembler.
Simon
Gary Warner
Sep 06, 2002, 04:26 PM
I agree with Mr. Bungle.
In the PIC I used for the AOA feedback system I had to trap the servo output from the receiver, read an optical sensor in analog, do the number crunching and spit out the servo pulse (corrected) to the servo. Used a 16C71, 98% of 2K program memory and all but 3 bytes of ram. There would have been no way to do all this with 128 step resolution to the servo in Basic Stamp, even with the 20mhz clock.
I do like the math routines in PIC Basic and PICC assemblers. And com code is easier too. Still, with a bit of effort, bit/byte math operations are not that hard. If the project is simple, a Basic Stamp will do, but I liken it to cutting butter with a chain saw. Complicated projects need the assembler code approach.
Gary
--
SkynetAir
Sep 07, 2002, 05:51 AM
Fair play, assembler IS more versatile than PIC BASIC because you have pretty much direct access to the PIC's registers and so and so forth.
When I said that you needed a history in C, C++, what I meant was that assembly language appears to me as quite an unfriendly language to look at. A lot of code as to be written in order to produce very menial tasks. E.g. Serial comms. In assembler, quite convoluted code would be required to support this, however it is one line in PIC BASIC.
The advantage with BASIC type languages is that it is easier to read, and a lot more can be done in a smaller number of lines.
I still maintain that PIC BASIC is easier to learn than assembler, and with the likes of the PIC BASIC mailing list, help is always at hand.
As for PWM, it is not possible to use software PWM with inbetween statements, however normally one would make use of the hardware PWM module which runs independently of the code.
Andy Peaple
MrBungle
Sep 07, 2002, 01:50 PM
Originally posted by APSystems
....
As for PWM, it is not possible to use software PWM with inbetween statements, however normally one would make use of the hardware PWM module which runs independently of the code.
....
Andy Peaple
Ahhh true, I didn't realise you were using PIC's with hardware PWM.
I use the 18pin '84 (13 I/O) and the 8 pin '508/'509 (6 I/O) which have no PWM.
Yeah assembler requires a far greater number of lines of code to do comms, math, etc, but once I've done it, I don't really need to do it again. I keep well commented routine libraries of the most usefull routines I've written, and Microchip's website has heaps of assembler help and routines available, also their MPlab IDE software, all for free. Then its just a matter of a copy/paste keystroke and a little tweak here and there in the routine to suit the new app.
Gary has a point about Math in Basic.
I've not played with alot of Math in the PIC's yet, other than rolling left/right to multiply/devide.
Actually, I'm thinking I might get PICbasic now :D
It would make a good 'proofing' or 'roughing' tool for prototype work, before comitting to assembler .... hmmmm.
Simon
SkynetAir
Sep 07, 2002, 01:58 PM
I highly recommend it if you do go for it. The mailing list is excellent for support, people reply to posts in a matter of hours usually, I have earned excellent advice from there many a time.
I really like the PIC BASIC as you can tell. The limitations of the language are mainly the lack of floating point routines, however as you say, you could do your own library in assembler to get round this. Apart from that, there's nothing that I think that you can't do with it.
I am currently investigating doing my own UAV based around PIC BASIC and distributed processing. The ease of interfacing SPI, microwire and RS232 devices to the PICs makes this very possible.
Andy Peaple.
AndyKunz
Sep 08, 2002, 08:15 AM
Originally posted by APSystems
When I said that you needed a history in C, C++, what I meant was that assembly language appears to me as quite an unfriendly language to look at. A lot of code as to be written in order to produce very menial tasks. E.g. Serial comms. In assembler, quite convoluted code would be required to support this, however it is one line in PIC BASIC.
It's only ugly if you don't understand true beauty. I've been doing almost exclusively PIC assembly and C for 10+ years and have seen some truly ugly code in my time. Even wrote some of it myself ;)
The advantage with BASIC type languages is that it is easier to read, and a lot more can be done in a smaller number of lines.
Learn C. It really isn't hard. You get the advantage of higher-level coding and, if you use Hitech (www.htsoft.com) you get code which is often better-optimized than hand coding.
As for PWM, it is not possible to use software PWM with inbetween statements, however normally one would make use of the hardware PWM module which runs independently of the code.
Why not do it the way all the ESCs based on 12C508's do it - set a bit high, do something, set the bit low?
I never investigated PICBasic (I outgrew BASIC when I went thru puberty 25+ years ago) but doesn't it have the ability to control any pin directly?
Andy
SkynetAir
Sep 08, 2002, 05:37 PM
If people want to begin learning assembly language or C in order to make projects for their RC hobby, then that is all well and good.
But, if you still want a life apart from typing in mind numbing monotonous code and you care more about flying than you do coding then PIC BASIC is one of the best options.
I am not attacking assembler or C, merely stating that PIC BASIC is fore the majority, easier to use.
Andy Peaple
jimsp
Sep 09, 2002, 08:45 AM
This thread started with a question about using Basic stamps in electric flight projects. While there are more powerful. faster, cheaper, smaller, and lighter devices one could use, for someone new to embedded processors, IMHO none of them are as easy to use as the BASIC stamps. In addition to being easy to program and requiring little extra hardware there are extensive easy to read applications and instructional material available through free downloads. Within an hour of receiving my first BS2 I was flashing a LED and within a month I had build a data logging speedometer for my bicycle. After the ride I upload the data to my computer to manipulate and plot it. Later I added an altimeter. I also used the data logging to monitor my heart rate during the ride.
After a 10 year break from RC flying I have just returned to flying attracted by the simplicity of the Parkflyers.
My list of Electric flying projects that I have thought of using the Stamps on:
A data logging altimeter to record altitude and rate of climb.
Data logging in flight voltage, current and RPM.
Using it to control a camera when you don’t have an extra channel available.
Monitoring, logging, and controlling the charge cycle of batteries.
Also, the heart rate monitor might be interesting during the first flight of a new model.
RMihara
Sep 09, 2002, 12:43 PM
Originally posted by jimsp
Also, the heart rate monitor might be interesting during the first flight of a new model.
Hi Jim,
Love this idea, could also add two more parametrics;
Moisture (sweat) sensor.
Pressure (hand grip) sensor.
:D
Roger
Gary Warner
Sep 09, 2002, 04:44 PM
Ya, what he said. :rolleyes:
...and I want one that records the "pucker factor" too. (any ideas on the sensor design? :D )
RMihara
Sep 09, 2002, 05:22 PM
Actually I was in the process of setting up a 'Stamp' to monitor in-flight power levels (voltage, current) for a micro-heli. I am hung up on the current thing (using a Hacker/Schulze right now, soon to be a Hacker/Phoenix). Someone had mentioned that there is a current sensing resistor on the Schulze already, I just don't know how to locate it. Any ideas/thoughts folks?
Oh and Gary...use a 'tube' balloon hooked up to a pressure sensor. :D
Roger
jandirks
Sep 10, 2002, 03:11 AM
I followed this thread a little and you guys made me interested in this.
Can anyone say which of the two is better, PIC or Basic Stamp? And why?
Are there any start kits available? Price indication?
Thanks,
Best regards,
JanDirkS
AndyKunz
Sep 10, 2002, 07:43 AM
The BS uses a PIC to execute BASIC. The PIC is the "CPU."
If you are looking to reduce cost, size, weight, etc. then by all means a bare PIC is better. If you want to reduce development time and aren't bothered by the inherent limitations of an interpreted system (extremely slow, limited functionality) then by all means use it.
Andy
Tapio
Sep 11, 2002, 11:22 AM
If you want to reduce development time and aren't bothered by the inherent limitations of an interpreted system (extremely slow, limited functionality) then by all means use it.
"Extreme" is a rather relative concept. For example, a BS is fast enough to base a V-tail mixer on.
-Tapio-
jimsp
Sep 11, 2002, 02:44 PM
Originally posted by jandirks
I followed this thread a little and you guys made me interested in this.
Can anyone say which of the two is better, PIC or Basic Stamp? And why?
Are there any start kits available? Price indication?
Thanks,
Best regards,
JanDirkS
The first thing you should know is that to use any of these devices you will need to have some basic understanding of electronics as they are not electrical equivalents on an ARF.
The Basic Stamp2 cost $49. In addition you’ll need a serial cable to hook the Stamp to your computer and a solderless breadboard to develop your project. They have expensive starter kits, which you really don’t need.
All the software and documentation including applications and instructional materials are available as free downloads. It’s this wealth of documentation with some of it in lesson format that makes the Stamps ideal for the beginner. The Stamps may not be the fastest or most versatile of the programmable microcontrollers but they are more than adequate for almost any of the projects you may dream up for your electric flying hobby. Also there are many inexpensive accessory devices (ie. a/d’s ,timing chips) that can aid in designing Stamp applications. The real draw back with Stamps is they are not as easy to make into a very small package for a permanently installed application aboard your airplanes and unless you use the same stamp, new projects will require another $49 for the stamp.
The PIC’s with associated parts are in the are in the $5 - $10 range but you will need some sort of programming board($40 - $100) and unless you are going to program in assembler a PicBasic Compiler($150-$250) . Of course subsequent projects will only be in the $5-$10 range for the PIC’s .
Also the PIC’s is they can be made into fairly compact packages and there are inexpensive prototyping board to make this easy.
For excellent discussion comparing STAMPS and PIC’c see
http://www.phanderson.com/stamp/stamp-pic.html
AndyKunz
Sep 12, 2002, 08:26 AM
A PIC programmer can be made from junk parts in your toolbox and two 9V batteries. Lots of free burner software, or you can download the programming specs from Microchip and roll your own.
The PIC List www.piclist.com is the ultimate source for support on the Microchip processors.
Free assemblers are available from Microchip and Tech-Tools www.tech-tools.com, free C compiler from www.htsoft.com (for the '84 the favorite of most home brewers). You can get PIC chips from under $1 (I use them in ESCs) to the latest 40-pin FLASH parts with lots of internal hardware support for about $6.
I do beta testing for both Tech-Tools and Hitec so I'm slightly biased. But then I was biased AGAINST Microchip's tools BECAUSE I used them.
Andy
tekochip
Sep 12, 2002, 09:50 AM
The only problem here is debugging. You'll burn a part, hope it runs, if it doesn't you'll have to figure out where you went wrong. If you get a full-blown emulator you can do source level debugging one line at a time.
This is why I like the ZiLOG parts. The emulator for the ENTIRE family is only $100. You can program parts and do source level dubugging on everything from .5K to 8K parts. No burning, praying that it runs, and trying to figure out what went wrong.
Now I know some of you have firm opinions, and that's a rather popular emotion on this website, but be open to new ideas. If we weren't open to new ideas, we'd all be flying control line slimmers. ;)
MrBungle
Sep 12, 2002, 02:11 PM
Originally posted by AndyKunz
A PIC programmer can be made from junk parts in your toolbox and two 9V batteries. Lots of free burner software, or you can download the programming specs from Microchip and roll your own.
Yeah I built mine from spare components and it cost me around $2 total, that was the cost of the female DB-9 connector, backshell and about 2 metres of shielded 4-core cable.
No 9v batteries needed, self powered off the serial port.
----------------------------------------------------------------------------------------
12C508's and 509's (the chip most used on cheap BRUSHED controllers) are unfortunately OTP parts (one time programmable) but sell here in Oz for around $2 each in 1+ quantities, but as Andy says, they are available for less than $1 if buying in bulk.
The Talking Electonics links below describe how to develop code on the reprogramable 16F84 and then port over to the OTP 508/9's when your happy with the code. (the code difference is very minor -: www4.tpg.com.au/users/talking/10_Quirks.html ) -- cheaper and a lot quicker than buying/burning/erasing a windowed Eprom '508.
For those thinking PICish:
Cheap self powered programmers to build:
www.jdm.homepage.dk/newpics.htm
www4.tpg.com.au/users/talking/MultiChipPgmr-Intro.html
This is the programmer I use. Will program many types of PIC's, even EEprom chips (24Cxx). The JDM site is the designer, the Talking Electronics site is the same programmer design but with a lot more for beginners, info on how the circuit works and how to build it.
One word though, When I built mine a year or two ago, I found that my programmer/serial-port pairing couldn't maintain the programming voltage. I figured the caps couldn't store enough charge to supply current and maintain the 13v programming voltage, so I upped the size of the 10uF to 100uF and problem solved.
I just noticed the JDM site has 100uF for that cap now.
www.jdm.homepage.dk/newpic0.htm
Another JDM design, that I've not tried, much simpler, programs '84 only.
Free programming software for JDM programmers:
www.jdm.homepage.dk/picsoft.htm (PIP02 for DOS -- what I use, never had a problem ... ever)
www.ic-prog.com/index1.htm (Windows)
http://home5.swipnet.se/~w-53783/ (Windows)
FREE PIC info/help:
www.piclist.com (already mentioned)
www4.tpg.com.au/users/talking/index_of_chapters.html (Talking Electronics beginners course for PIC '84 and '508/9 assembler, old messy site but good value)
http://talking-electronics.netfirms.com/index.html (more Talking Electronics stuff ... '84 data)
www4.tpg.com.au/users/talking/(yet more TE stuff ..... )
and ofcourse:
www.Microchip.com (HUGE website, full of datasheets, app notes, code idea's/snippets, and best of all, free MPLAB assembler software that covers the entire PIC range)
There is MUCH MUCH more information out there, a search on www.google.com using a PIC part number, keywords like 'programmer' and you will be reading about PICs for the rest of your life :D
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.