Another newbie with questions

Iv desided that Im going to get into robotics but torn between what I should start with. Right now im stuck between the ABB with atom processor or the OOPic board. I like the features and hardware that the Atom has but would like something with a more mainstream programing language that OOPic offers. They both seem to have all the features I want but Im still not sure what to go with. I plan on building a robot that will use 2 motor/servo outputs and 4-5 sensor inputs for navigation, and something that is expandible so I can switch between processor control, and control from my 8103H transmitter. Iv looked at the BS2, Handyboard, Cricket and a few others and the Atom and Pic seem to be the only ones that have all the features I want. Im just cant deside betweem, mainstream or specific programming. A major reason for doing this is so I can learn more about computer science and electronics.

In my search for a microcontroller, one thing that I found with the oopic that I didn’t like was processing speed. I think the objects themselves operate quickly, but your code only processes at about 2,000 lines per second. Compare that to the Atom at, I believe, something like 33,000-ish the BasicX at 80,000-ish and the newer Atom Pro at 100,000-ish and it looks pretty anemic. I’m sure it is fine for simple read the sensor and drive some motors type stuff, but if you want to compute trajectories or other computation-intensive stuff it might end up being a bit slower than you’d like. (Note, this is based on reading things oopic users have written – I’ve never used one myself.)

The BasicX 24p is BS2/Atom compatible 24 pin module, but uses a VisualBasic-like syntax that is more “modern” than the BS2/Atom uses. This the processer I chose to go with.

The BS2 and Atom, though have tons of code and users out there. Most any sensor or addon you might want to use probably has a code example for BS2/Atom.

Recently I got a mini-sumo with an Atmel AVR processer. There is a free C compiler and I like C so I’m having some fun with it. It is VERY low-level coding compared to the chips with Basic above, though, so it takes a lot more code to do what the Basic chips do with 1 line.

For a first project, any of the BS2-like chips including the BS2 or Atom or BasicX combined with the Mini-Abb will make a fine starter kit. Hook up a sonar or a couple of Sharp infrared distance sensors and a couple (or 4) continuous rotation servos for movement and you’ll have a nice simple, but still powerful platform to explore with and plenty of expansion options.

The Atom is the best when considering the learning curve of the programming language and speed. In my opinion, when it comes to simple robotics, you really don’t need a powerful programming language. Since you are not going to write a software application that calculates whether or not there are 11 dimensions in the universe, Mbasic or Pbasic is all that you would need. Using these easy to use microcontrollers will allow you to focus on what you need to do, and less time trying to figure out how to use the devices. If you find yourself later on down the road-- that the Atom is not powerful enough for you–you can always make the transition to something more powerful.

Just my opinion.

well when it comes to programming im not really a novice. I know ABEL(very low level) and have used it to program Xilinx chips for things like clocks, calculaters, thermometer, etc. I also have some expiriance in VB .NET but am not really all the proficiant at it. Like I said above Im doing a lot of this just to learn so I can use it in future careers. Im currently an ME student and my field of interest is UAVs(robotics/aeronautics), trying to stay as far away form the auto industry as possible :smiley: . Mr. Jones do you have a website that I can learn more about the Basicx? And thanks for ruling out the OOPic SN96.

To me, it isn’t about a powerful language, it is about fairly standard structures. In Pbasic and Mbasic, you don’t have pretty standard function calls passing parameters and returning a value. I don’t think you have local variables. These kinds of constructs are available in the BasicX and in my opinion, don’t increase the learning curve, and will translate well into any other modern language, all of which will have these.

I’m not saying the Atom isn’t a good first processor. It is better than the stamp, has a stamp-like syntax and there are tons of programming examples for the stamp family and this will be very helpful to a beginner.

I agree AliasMrJones, That is what my main point was. I’m a beginner and I selected the basic stamp to learn on. I have programming experience as well. I learned the basic programming language back in 95 using Qbasic from Microsoft. I moved on to Visual Basic, and then lost interest in programming for several years and had to refresh my memory. When I discovered microcontrollers this past year, I came to the realization that my dream of building my own Bipedal robot was finally a real possibility.

I just wanted to let Topher know that the Atom is a very good first Microcontroller if just starting out. For me, since I had such rusty programming skills, I went with the stamp because of the huge amount of program examples and so many people that use it that can help me.

I would love to get a Basic X but I fear there would be no one to help me learn how to program it with so few resources and examples, which is why I chose to stay clear of it for now.

Perhaps some day one of you guys can take me by the hand and help me learn to program a Basic X. :laughing:

Sorry If I offended anyone, I just wanted to give my opinion on a good starter.

while im asking questions is there a way to have a PDA receive a signal from a 2.4Ghz camera and decode it so I can view video from it on the PDA? Its kind of a junk PDA so some hardware modifiying wouldnt be a problem.

Video to a PDA…Not that I know of. If you have a newer pda with wifi and a wifi webcam you might be able to get something going…

Each microcontroller has strengths and weaknesses. The BS2 has the most example code and virtually any sensor or add-on you would want to add probably already has code written for it. It is also somewhat slow and with limited memory.

The Atom is faster and has more memory, while having code compatibility to the BS2. So, you can use (at least most) of the BS2 example code while having faster speed and more room to play.

The BasicX is faster than the Basic Atom (and pretty close in speed to the newer Atom Pro). It is not code compatible with the BS2 and Atom and this is both a plus and a minus. You can’t use example code for the BS2 on the BasicX out of the box, but you do get modern constructs in the Basic language. The BasicX uses basically Visual Basic compatible basic. Since lots of people have programmed in VB, this makes moving to BasicX pretty easy. There is an active yahoo group for support.

There is also a new microcontroller, similar to the BasicX, but using a faster version of the actual processor chip and a VB-like Basic language with some more features than the BasicX. It is called the Zbasic ZX-24. It is roughly twice as fast as the BasicX with some more advanced features.

The OOPic is a pre-programmed pic processor with objects defined for various interfaces/sensors/etc. and you can program it in a variety of languages. It seems to be popular, based on the number of sites that sell it with stuff. From what I’ve read, virtual cirtuits execute fast, but user programms execute very slow. For this reason, I haven’t bought one.

Microchip Pic and Atmel AVR processors are much faster still than any of the above (like an order of magnitude faster), but you must get into very low-level code which makes programming for things like sensors and servos, etc. more complicated than any of the BS2-type processors above. There is quite a bit of code out there, but I don’t think these make good first microcontrollers because of the extra complexity. On the plus side, the chips are cheap and there is a good free C compiler and a free simulator for testing programs on your computer before downloading to the chip. But, you need extra support circuitry for things like voltage regulation and RS-232, bringing I/O pins out to usuable headers, etc. You can buy boards that do this, though it makes things more expensive. These chips are very popular with people who know what they are doing, but aren’t well suited to beginners.

Of the above, I have used the BasicX and Atmel AVR, so I can speak about those based on my experience with them. Any info about the others is based on what I have read. I have also used the BrainStem from Acroname. It is basically a pre-programmed pic with dedicated pins for A/D, digital I/O, servos, an infrared distance detector and I2C bus. It is programmed in an interepreted subset of C. They have example code to interface it with lots of sensors, etc. and a forum where they will answer questions, but it is kind of slow and, of course, not compatible with the Basic processors above.

I don’t want to give the impression that there is a best microcontroller. None of the above are perfect. You really have to decide what is most important to you and your project and then pick one that meets your criteria. As far as speed and memory…For a simple read some sensors and drive around avoiding obstacles, any of the above can do that. So, for a beginner, any of the above should give you enough power to get your feet wet with an autonomous robot. (And, a fairly full-featured autonomous robot.)

Here are some sites about the above processors:

BS2

parallax.com

Basic Atom

basicmicro.com

BasicX

basicx.com
groups.yahoo.com/group/basicx/

Zbasic

zbasic.net

OOPic

oopic.com/

Atmel AVR

atmel.com
avrfreaks.net (Really good forum and lots of sample code)

Acroname BrainStem

acroname.com

Wow Mr. Jones! Very nice information!

Thanks for the information, I did not know there was a zbasic microcontroller.

It is quite new. Looks like it was launched middle of November. I have some IK stuff for the BasicX that runs too slowly and I’ve been tempted to try it on a Zbasic chip. Based on the site is should run 2+ times faster. But, the chip is so new I’ve been worried that it will be buggy. I heard about it on the BasicX Yahoo group where a guy has been promoting it. You know, someone asks a question and he says, “Well, you could do it like this on the BasicX…But the nifty new Zbasic would make it a lot easier/better!”

So, given that it is so new, I’m a bit cautious about the Zbasic. But, if anyone wants to buy one and report back, that would be cool.

Wow thats a lot of stuff to learn. I know what I will be doing over break. I think the Basic Atom with the ABB is a good choice for me to start out with. I dont really know enough about electronics and such yet to get that deap into PICS and AVRs so the Atom should be a good starting point. Thanks for all the info.

Just wanted to expand on the speed of the AtomPro. :slight_smile:

The AtomPro AVERAGES 100,000 basic commands per second. I calculated this by taking all the commands in the language that were not inherently speed limited(eg no complex I/O and timing commands) and put them inside a for next loop. I then timed how long it took to run 1000000 loops of the for next. I then devided this by the total number of commands which gave me the average time it took to run any one command. Invert that gave the number of commands on average per second. Now the thing you need to realise is that some commands on the AtomPro can run MUCH faster than 100000 ips and some (ie most floating point) run quite a bit slower. I timed a simple high low goto loop once and it came out to something like 300000 isp. Those are about the simplest commands there are of course. Most commands will be a bit above the 100000 isp. Almost all floating point will be below it.

Nathan

And the SX microcontrollers run in the 50 MIPS range!

Yes the SX runs machine code upto 100 MIPs. But an average basic instruction can take anywere from 5 to hundreds of machine code instructions. For example on the AtomPro the HIGH command takes approx 53 clock cycles(the H8-3664 executes most machine code instructions in 2 cycles so about 27 machine code instructions to set a pin HIGH assuming a constant for the pin number) to execute. A complex floating point command can take thousands of instruction cycles. The H8-3664 is an 8MIPS processor since it can run a singe machine code instruction every 2 clock cycles with a clock of 16mhz. However the H8 can also do a 16bit multiple in 44 clock cycles.

On an H8:
mulxu.w er0,er1 ;22 clock cycles

On a Scenix:
;*******************************************************************
; Double Precision Multiplication
;
; n_2 : n_1 * n_4 : n_3 -> q_4:q_3:q_2:q_1
;
; Standard shift and add.
; Execution time: 215 to 295 clock cycles.
; Code space: 22 locations
;
; Cleaned up and corrected version from Microchip Ap note by BF.
; Note: Ap note has errors! Additional mods by Scott Dattalo.
;
;*******************************************************************

mpy16b16: macro
local m1, m2
clr q_4
clr q_3
clr q_2
clr q_1
setb q_2.7
m1:
rr n_2
rr n_1
sb C
jmp m2
mov W, n_3
add q_3, W
mov W, n_4
snb C
movsz W, ++n_4
add q_4, W
m2:
rr q_4
rr q_3
rr q_2
rr q_1
sb C
jmp m1

endm

As you can see it takes from 215 to 295 to do a 16bit multiply on the Scenix. 4.8 to 6.7 times as many clock cycles to do the same thing.

Make sure when you compare two micros you compare apples to apples. Not apples to atoms(grin).

Nathan

Thanks Nathan for the info. I have not heard of an H8, do you have a link with more information on this?

Thanks

Sure. The H8-3664 is the main processor on the AtomPro. Here’s a link to the hardware manual.

pond.ie/pdf/h83664.pdf

Nathan

I used the OOPic for my first processor, and I recomend it over everything else because of its Live Debugging features and object-orientedness. When trying to design walking robots and figure out problems, the OOPics lets you access and modify every object and variable while it is on, so that you can just initialize 18 servos in your code and then move them around through the SCP interface over your serial port. All in all, the OOPic is easier to debug than anything else, so for a first-timer, I recomend it highly.

The OOPic can not control 18 servos! Even controlling 12 servos is not handled correctly. The processor is too slow. When controlling 12 servos the refresh rate is 30mS. This is almost fast enough to use a servo, but it is not doing it correctly. The servos will stutter and have only a fraction of their real torque at this refresh rate.
My personal experience with the OOPic on a sumo was a terrible disapointment. It would travel right out of the ring 1 out of 5 tries. I contacted Scott and he told me we weren’t programming it correctly. We were using the object’s like we were supposed to, not straight line code like so many people end up using. But the thing would miss the ring edge detectors signal too often. He asked me to send him the robot, which we did, but he never returned it. It’s been over a year now.

Wow, what a theif!

I have not used the OOPic in any projects but I hear more than once that it is a challenge to program. The Atom or the stamp is a much better first microcontroller for a beginner in my opinion.