I made the $50 Robot AVR based because at the time AVR's were much cheaper.

But someone mentioned recently in the forum that the newer 18 series of PICs no longer require expensive external programmers, and now come with free programming software. Basically what AVR has had for years . . .

You can use the student version (also licensed for commercial use) of microchip C18 compiler. The only limitations are reduced code optimization (unlike previous free PIC compilers that only worked with a handful of devices and were limited in code size etc..)

As for programming, you can buy cheap JDM programming cables like this for $11.95 http://www.sparkfun.com/commerce/product_info.php?products_id=9 which works in a very similar way to the atmega one in the $50 robot. If you are handy with electronics you can make your own from a schematic for under $1 (I did this in the end when my old and expensive PIC programmer got left behind and needed expensive firmware and hardware upgrades)

To actually program with a cable like the one above you need something like IC-prog which is a freeware program.

As well as the compiler you get to use the free MPlab IDE where you write your code. You can run software simulations of the code to make sure it works before transfering it to the pic. Also it lets you get full disassembly listings of your C code, monitors Device memory and code space usage etc...

I've just spent the entire summer writing firmware for pic18's Also a GREAT place for pic18/pic24/pic32 info is microchip.com, they've got a great forum on there with insanely fast answer times. another great resource is Chiefdelphi.com It's centered around the FIRST, but they all use pic's. And if you're looking for base code to expand from use Kevin Watson's code. It has many many things already taken to a high level of abstraction AND it's free! It's great code, you'll find all sorts of tidbits on there, from IR to Encoders to Cameras.

Hi-Tech has made their extremely optimizing C compiler for PIC10/12/16 available for free last month. That compiler is really amazing compared to CCS or any of the BASIC compilers.

I got started with a PICKit 2 programmer and free samples of PIC16s from Microchip. I'm still using the PICKit, but now I'm on their pretty new PIC18 lines with built in USB transceivers. I use the free C18 compiler. The most appealing part of the PIC setup is that once you pay for the programmer, everything you do is free, because you can get free samples of chips from Microchip.

I found that the AVR compiler didn't optimize code very well, but I guess that's true for most GCC toolsets. Doesn't matter, I guess, since AVRs tend to have much larger program spaces.

As for actual hardware differences, there isn't that much. AVRs have more program memory (and, since it's modified Harvard architecture, more RAM), and fewer choices in their lineup, but still enough to fill every niche. AVRs are 12 to 20MIPS, and operate 1MHz = 1MIPS. PICs are 20MHz for 16F and 40MHz to 48MHz for 18F. However, they operate 4MHz = 1MIPS, so that's actually 5MIPS, 10MIPS and 48MIPS.

I would say AVR is definitely better, but I don't really want to pay for it, so I'll stick to my PICs. However, there are plenty of reasons to use AVR over PIC. Lots of books, documentation, and code are written for very old PICs. PICs are used more extensively in industry than are AVRs, and vice versa in hobbyist fields. Since hobbyists do cooler stuff (in general ), that's a good reason to switch. Kind of like the reason why you should use Python over other scripting languages: because more cool stuff is going on in that camp.

AVRs were designed to run C code. PICs were most definitely not. But like it says PIC18s are a big step over the PIC17 I had (the Cerebellum back in the day, remember how many times I bricked that Admin? Gah )

The PIC userbase is bigger, actually, but if you subscribe to PIClist, you'll find that most of these guys are pretty hardcore and they're using PICs in "applications" in their "jobs." The users of AVR are more likely to post their "projects" on their blogs.

Basically, what I'm trying to say is that you're going to find lots other hobbyists who use AVRs in robotics and homebrew electronics. The PIC community is also very knowledgeable and helpful, but sometimes they're more worried about power consumption or form factors or whatnot, because there are more professionals mixed in.

Of course, these are all generalizations. You'll find that you can do anything you like with either set of tools, and plenty of people that are doing what you're doing in either camp.

If pic userbase is bigger you can always convert PIC projects to AVR projects...As said before the main concept is always the same...

If I was to use PIC or AVR... Although I haven't used PIC a lot, almost non, that would be a very tough choise...

Yes AVR are free software and all... but still something I don't like... Maybe it's the compiler... cause I can not generate the frequencies I want precisly and I'm a little bit furstrated about this... Everything else is far above the middle...

PICs.... the not free compiles was such a great repulsion so far that I would even think about them...But some of them, have peripherals that I have dreamed of... And I'm not talking about the can bus and such...I have never used it anyway. Some USB PIC via a bootloader can be directly recognised and programmed via USB...

That's too much for me forget the cost and anything else...I wait for the new ATXmega to come... until then I can not talk...

Generally without being using the PICs for complicated projects and having used AVRs for almost anything, I can not judge 'em and say: hey yo AVR rulezzzz or PIC rulezzzzz.....

Regards, Lefteris

Logged

For whom the interrupts toll...

P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

I generally prefer the PIC along with the assembly language. There are limited commands available but I have yet to find a project I haven't been able to implement using assembly (sometimes like with the older 16F series, etc.. an extra math-coprocessor chip is required). I find it to be a rewarding challenge

Porting projects over from other languages, etc... is another challenge altogether. You have to match processor speeds then figure out what steps are happening when and in what order among other minutia. The end result is that I have been forced to try and fully grasp what is happening within my code and learn each and every aspect of the microcontroller's capabilities.

I also like having all available memory available to my application which is typically not the case when a bootloader is involved.

Cost-wise, the initial expense was the programmer. Now it's just the chips - and brain cells

With ICSP (In Circuit Serial Programming) you can update the software while the PIC is in place using four wires. The MPLAB suite from Microchip is free and has a debugging routine built-in. You can also run your code in the circuit itself during debugging, although I have "yet" to try this out. -sounds interesting though.

The in-circuit debugger is nice. You should check out the Special Function Registers Watch window and the Watch window. They allow you to see what all of your registers and variables are when you stopped the debug.