Looking at microcontrollers again

I’ve been doing a lot more research and looking at the various microcontrollers available, both from a feature and power standpoint as well as a pure cost standpoint. I really like the Basic Atom and Atom PRO chips, but they are just a bit too expensive for me to work with and risk destroying, as I seem to have already done with an Atom PRO module. I’ve learned quite a lot about programming robots using the Atom chips, so I don’t feel my money has been wasted on them at all. I just need something I can more easily afford to replace if I happen to fry a chip. I would also like something I can program in a more standardized language, like ‘C’. I know the Atom PRO can be programmed in ‘C’.

Microchip’s PIC chips are easily had, are very inexpensive, and the software to program them in ‘C’ is also free. PICs also come in many different configurations of 28 and 40 pin packages and inexpensive boards are available from Modtronix and others. There is also quite a bit of support from users here who use PIC chips in their projects regularly. There is also a nice little controller board available from Oricom Technologies, called the OOBot40-3, that will accept several different 40 pin PIC chips. I’ve already verified that the pinouts for the 18F4620 and 18F4680 are compatible with the OOBot40-3 board.

The Atmel Atmega chips are also pretty inexpensive and are also used in the Open Servo project, so putting effort into learning to use them would be worthwhile also. The IDE and toolchain software also available free for the ‘C’ language. I will very likely put some effort into learning these when I get closer to being able to use Open Servos.

As far as modules go, I am also looking at the Mod5213 from Netburner with the associated development board. These modules are nearly half the cost of the Atom chips, and they offer more power and functions, which may have more to do with the larger 40 pin package. It would still be a little expensive ($39.00 for a Mod5213 module) to replace a module if one got fried, but the cost would not be completely unreasonable for the capabilities. Prototyping with the Netburner modules should be at least as easy as using the Atom chips, aside from the necessity of having to work in ‘C’, which is not a problem for me at all. I think some sort of Super Bot Board using the Mod5213 would be exceedingly cool to have. :slight_smile:

Also in the module catagory, are the Cubloc units, which are based on the Atmel Atmega128 chips. These are also programmed in a dialect similar to BASIC and provide a lot of functionality for the price. However, I have decided I would prefer to stay with the standard DIP form factor units, and the only Cubloc unit in this catagory is the CB220 that is pin compatible with the Basic STAMP and would work on an Atom Bot Board after shorting one capacitor (it’s already on the CB220).

I am also considering the Atmel ATNGW100 Network Gateway Kit. It is available for $69.00 from several sources, such as Avnet, and runs Linux. It’s small, has lots of functions and best of all it runs Linux, which opens up many different languages for programming such as Python. This is a complete Linux based controller board with Ethernet, that costs just a bit more than an Atom chip and can be programmed in ‘C’ using Open Source tools. Did I mention it runs Linux and development can be done for it using completely Open Source tools??

Well, there you have it. This is my current take on what’s available in the microcontroller world for use in robots. I know there are many more choices available also, but most of those would just not fit into my budget or would not suit what I want to do with my robots, now and in the future. My current robot interests are tending toward the swarm type technologies using a wireless solution such as ZigBee, so I want to eventually be able to build more than one (walker and wheeled) as inexpensively as possible. Each of the microcontrollers I have written about have their own sets of pros and cons, of course, but they all fit what I want and hope to do with robotics as far as capabilities and cost. I can put together a complete development environment for each of the above microcontrollers for right around $100.00 (or less), which is mostly the cost of an added hardware programmer for the PICs and Atmel chips.

Right now I am leaning more towards getting setup to use PICs, Atmega chips, and the NGW100 gateway board. I have to admit that a Linux based solution is particularly attractive to me for some reason. :wink:

8-Dale

Hey linuxguy!!

Seems you did a lot of research. I think PICs or Atmels are a good choice for you. They are fairly inexpensive (high starting costs because of programmer) and easy to program. There are also a lot of users out there who use them and will be able to help you out with code including people on lynxmotion :slight_smile: Not to mention you can order multiple PICs from microchip via sample =D

-robodude666

I’ve been looking at these things for awhile.

I am leaning towards the PICs, since I have a lot of them now. I just need to get the programming setup for them. For that, I think I will go with the ICD2 sold by Sparkfun. Was it you who showed me the link for the 28 and 40 pin sockets that have the ICSP connector on them? I can’t seem to find the product now. :frowning: This would be great to use with the ICD2.

We only have to buy the programmer once though, and the ICD2 I would get will handle both the standard and dsPIC chips.

I would also like to get one of the NGW100 network gateway boards. They are very inexpensive for a complete Linux solution.

I’ll be tapping you (tap tap) to help me through my PIC learning curve. :smiley: One of the first things I want to do is experiment with the 18F2550 and 18F4550 chips to create a USB sensor module that can also speak I2C. I know you have worked with these chips. :smiley:

8-Dale

This info might be out of date, but here goes: Microchip’s C compilers come in two flavors. C16 and C18 for the differently powered chip lines respectively. C16 I believe was in fact free, but C18 was not. So if you wanted to compile for any of the 18Fxxx chips (including I think the ds flavors), you had to lay out the cash. Either way, you have to deal with the lovely MPLAB IDE which leaves a lot to be desired. Not sure if this is applicable, but I believe there is a student version. The other compiler that a lot of people use is made by CCS. It’s a real stretch to call this thing a ‘C’ compiler. I’ve used it extensively and in my opinion, it should probably be avoided. It’s also something like $400.

I also went for the Olimex’s ICD2 clone from Sparkfun way back and I think I later found out that the one from Microchip is the same price. Take a look at them both. I ended up having to build a mounting case for the one I got from Sparkfun which came naked. If you’re expecting a Visual Studio like debugging experience with this thing, you’ll be disappointed. Breakpoints pretty much work and you can in fact inspect memory, but interrupts confuse the hell out of the debugger. The wind blowing confuses the hell out of the debugger. It’s not a tool I would give up, but it’s enough of a pain that you’ll want to try a lot of code fixes before you fall back on it. Something else to note that is extremely obnoxious is the length of the ICSP cable. It’s only about 5 inches. Worse, you can’t just build a new one that’s longer, it won’t work. I don’t claim to know enough about electronics to begin to explain why but mine didn’t work and some quick googling turned up countless others who had failed.

The compiler tools on the Atmel side are MUCH better. There’s a GCC port that will build for it so you have a proper/mature compiler for your code (even though I think there were some questions about its output optimization). I haven’t tried any sort of a debugger in this world, in part because the C compiler was so much better than CCS.

The bulk of my experience lies in PICs and I only delved into the Atmels for OpenServo. Had I worked with them more, my gripe list on the Atmel side might be comparable to the PICs :wink:

Something you’ll probably want to explore relatively early is bootloaders. I ended up with two 18Fs forming the core of my hex, one tied to the radio doing packet marshalling and the other which ran the main program code. The one running the “main” code was setup to be bootloaded from the otehr. So I could reflash over the radio by talking to the packet marshaller. Once I finally broke down and built this system, test cycles were so much faster, I didn’t miss the debugger. When I did absolutely need the debugger, I had built an ICSP connector onto the board that would let me plug the ICD2 into the “main” chip and flash the code directly for debugging, find the problem, reflash the bootloader and disconnect.

Microchip’s Student Edition compilers do not time out at all, and the only difference is some optimizations that wouldn’t be used normally anyway won’t be done when building the code. In The Microchip compilers are based on GCC, but I don’t know which version or how often they are updated.

This doesn’t appear to be true any longer with the Student versions of C18 and C30. The MPLAB IDE definitely isn’t in the same class as the Highspeed Embedded Workshop tools for the H8’s from Renesas, but it works and is does not appear to have any serious problems, which is what matters. Sometimes it is better to have less frill and just plain old solid function. :slight_smile:

I will definitely also take another look at the Microchip ICD2 before I purchase anything. I don’t want to work any harder than necessary putting together the programming environment for the PICs. :slight_smile:

Right now, the only reason I would have to delve into the Atmel chips is for the Open Servos, but I keep getting further away from getting into that. It would be too expensive for me to use Open Servos the way I want to use them right now (my 10 servo BiPod), so I will wait on that, although I can see using an Open Servo board as a motor controller for each motor in a wheeled robot.

Now, this is something I am very interested in. One reason I want to redesign my WALTER rover from two wheels to four wheels is to have more space to put stuff. I also really like what others are doing with four wheeled rovers too, and I hope to use some of their ideas in my redesigned WALTER. I also want to add the capability for WALTER to be radio controlled, autonomous, internet controlled via wireless, but I think this is a more long term goal. I first need to get a reliable and stable four wheeled platform working.

8-Dale

I was casting about myself for similar things, with the idea of getting a basic control system done on a low power chip, then moving up to something like a Gumstix plus botboard later. I also wanted something that had GCC available, after having looked at a lot of chips and boards that wanted an expensive compiler.

You might want to take a look at the Coridium ArmExpressLite as well. It also runs around $40 or so and is pin compatible (more or less) with the basic stamp. It works very well in the ABB (you do need to solder on a switch - or just short out, whichever is your preference - to two contacts on the stamp to enable programming mode). There’s a Basic on board, but you can ditch that and use the GCC compiler provided (includes a C function library for pin control - essentially all the functions you’d find in BASIC).

Cheers

I had forgotten completely about the Coridium modules. I have looked at them, and checked out their dialect of “BASIC” some. If I were to go with another module, it would likely be the NetBurner Mod5213 though. Right now, I have lots of different PIC (and dsPIC) chips and it makes more sense to me to get setup to learn and use them. I am leaning more towards having something programmable in ‘C’ rather than a dialect of BASIC (too may dialects) that gives me more direct control of the chip hardware.

I think a 40 pin PIC pn the Oricom Technologies OBot3-40 controller board would be a great combination, or one of the Modtronix boards.

8-Dale

Good reason to go with the PICs. I’m writing in C on the Coridium, I never tried their BASIC. The library functions they provide give you ‘out of the box’ functionality, they’re #defines and are rough equivilants to the basic commands, but it is a C library.

I’m starting out in robots, I really did’t fancy delving too deeply into the chip innards to start with - a prebuilt library had great appeal.

Yeah, I thought the same thing. The only problem is the Coldfire chip uses 3.3v for IO, and is not 5v tolerant. That would make interfacing some common sensors a pain I think…

I agree, a good library makes all the diff…

Well, 5V tolerance could be designed into a board that uses the Mod5213 though. :slight_smile: It would possibly not require more than a voltage divider on each I/O pin, but that would add quite a few components to a board which is not necessarily a good thing. Every added part eats a tiny bit of power from the battery pack.

8-Dale

Gumstix’s robostix is an Atmel AVR board that can be used standalone.
That’s the route I’ve invested in.
smileymicros.com has a good book for C on AVR and the butterfly dev kit is cheap.
Being able to use all my linux knowledge on a gumstix embedded system is a no brainer for me.

That being said I’m sure if you learn C on PIC you’ll have no problems porting your knowledge to whatever other family you need.