After doing my homework on Microcontrollers...

marshmallow

Weaksauce
Joined
Oct 12, 2004
Messages
104
Ok, Ive done all my homework on microcontrollers. Learned on Parallax's stamps, and educated myself on PICs and AVRs. Now the only problem I face is a finacial one. Which setup, PIC vs AVR would be cheaper in the end? Considering a programmer, a language + compilers, and ICs. Been to AVR freaks, been studying up. Been to countless PIC websites and studied up. I think I can handle learning Assembly, but would like a basic-like language compiler to use instead (preferably free). Id more then love to go the PIC route, but have yet to find any sort of kits that contain a programmer for various ICs and software that I like to go with it. On the other hand, AVRs seem more accesible supply of what to buy.

I need opinions and possibly a few vendors.

Thanks,
-marsh
 
I'd have to say go with the Atmel ATMega series... I've had to make the atmel-versus-microchip decision at work, and all signs pointed towards Atmel.

Compared to microchip, they're cheaper to buy for equivalent products; eg ATMega8's are cheaper than PIC16F873's.

You can program them over SPI using a Ponyprog (google for it)..

And compilers? google for winavr, it's a open source C compiler for Atmel parts.

marshmallow said:
Ok, Ive done all my homework on microcontrollers. Learned on Parallax's stamps, and educated myself on PICs and AVRs. Now the only problem I face is a finacial one. Which setup, PIC vs AVR would be cheaper in the end? Considering a programmer, a language + compilers, and ICs. Been to AVR freaks, been studying up. Been to countless PIC websites and studied up. I think I can handle learning Assembly, but would like a basic-like language compiler to use instead (preferably free). Id more then love to go the PIC route, but have yet to find any sort of kits that contain a programmer for various ICs and software that I like to go with it. On the other hand, AVRs seem more accesible supply of what to buy.

I need opinions and possibly a few vendors.

Thanks,
-marsh
 
If you don't need more than 2K for your program (and you can accomplish quite a bit in that space), the free demo version of the BASCOM AVR BASIC compiler is a great IDE with a lot of features. I've used it for many projects and found it's very easy to use.

I prefer AVR's because the whole setup is inxepensive, from parts to development and programming; in fact you don't even need a fancy programmer, you can build a ghetto version with just a couple of resistors on the parallel port. I've never used PIC's, but it's my understanding that AVR's outperform them on a clock to clock comparison.

Whatever you choose, it's amazing what projects you can create with very little resources.
 
If you go the AVR route - use WinAVR for your compiler (free, open source C compiler) and get an AVR ISP ($30). I'd reccomend something along the lines of an ATMEGA8 as a good chip to learn on. If you want to go the PIC route sparkfun.com makes a number of good PIC products (as well as AVR products - but IMO the AVRISP is essential for AVRs). Not sure about compilers for PICs - as I prefer AVRs.
 
NleahciM said:
If you go the AVR route - use WinAVR for your compiler (free, open source C compiler) and get an AVR ISP ($30). I'd reccomend something along the lines of an ATMEGA8 as a good chip to learn on. If you want to go the PIC route sparkfun.com makes a number of good PIC products (as well as AVR products - but IMO the AVRISP is essential for AVRs). Not sure about compilers for PICs - as I prefer AVRs.

My company bought our PIC programmer from sparkfun. Great company. As for the programming side...we went the uber expensive route...HiTech ($900 C compiler). They offer a free version, but compiling speed is severly limited (our paid version is 10 times faster than the freebie).

If AVRs perform just as well, if not better, then PICs...go that route. Especially since they offer a full-blown free compiler.

EDIT: Under no circumstance should you PLAN on using assembly. Save that for time critical algorithms. You'll just be wasting your time (unless you're a programming god).
 
Agent: Would that "ghetto" programmer work for most AVRs? That demo program looks right up my alley.

Gee: Ill probably take your advice and grab a AVGmeg8 to learn on.

NleahciM: What exactly is an AVR ISP?

joe: yeah, Assembler is definetly a pain, I think I am definitely going the AVR route.

Thanks guys, Ill be picking up some supplies to see if I can get something started.
 
I'd stick with AVR's for your 8-bit needs. I used them for my college senior project. I use PICS at work now. For the college project, we got the Kanda STK200+ (it's $65 now, and improved over the one we used, but I still have mine around if you're interested...). It comes with the AVRGCC compiler if you like Linux. For our project, we used CodeVision AVR from HP Infotech (the guy that runs it is REALLY friendly and helpful). It comes in a Lite version for around $100 from PRLLC.

I use PICs at work now and the tools look like they're more expensive - the compiler we use now from CCS runs anywhere from $125 to $425 depending on your needs. There may be cheaper options out there, but that's what my company has used since before I got here.

So, from a financial and ease-of-use standpoint, I'd say go with AVR and a nice dev kit, then use the free GCC compiler or buy one that is well supported. [/$0.02]
 
marshmallow said:
Agent: Would that "ghetto" programmer work for most AVRs? That demo program looks right up my alley.

Gee: Ill probably take your advice and grab a AVGmeg8 to learn on.

NleahciM: What exactly is an AVR ISP?

joe: yeah, Assembler is definetly a pain, I think I am definitely going the AVR route.

Thanks guys, Ill be picking up some supplies to see if I can get something started.
AVR ISP = AVR In System Programmer. It's an inexpensive, easy, and well supported tool for programming AVRs.
 
marshmallow said:
Agent: Would that "ghetto" programmer work for most AVRs? That demo program looks right up my alley.
I don't think it's really a chip issue because the AVR ISP is a standardized protocol, but the programming software has to support the interface. I believe this interface has wide support for many software packages. The BASCOM software supports this method, and the compiler IDE has the flashing utility built in.
 
ghetto version[/URL] with just a couple of resistors on the parallel port. I've never used PIC's, but it's my understanding that AVR's outperform them on a clock to clock comparison.

The only reason I'm not fond of the direct connect is it doesn't offer any protection to the parallel port.
It's a bit more work, but a http://www.lancos.com/prog.html#hardware using a 74HC244 tristate buffer offers at least some protection for the computer's port. That chip itself is less than a buck, and if you ever screw up and short the parallel port connection, it may save you from buying a new parallel port card.


Agent: Would that "ghetto" programmer work for most AVRs? That demo program looks right up my alley.

All the AVR sereis (excpet the Tiny24 i think) support ISP, the only change would be the location of the RESET pin on different sized chips. If you do work with 20, 32 and 40 pin chips you may want to design the reset connection as a plug so it can be moved around.
 
Here is a question for all of you... What kinda of things can you do with these chips. Like everyday things you would do with them. All this talk about them makes me want to learn more about them but I want to know what I can expect to do with PICS and AVR chips.

Aybabtu.
 
Aybabtu said:
Here is a question for all of you... What kinda of things can you do with these chips. Like everyday things you would do with them. All this talk about them makes me want to learn more about them but I want to know what I can expect to do with PICS and AVR chips.

There's quite a bit you can do...you have general purpose i/o, so you can read input from buttons, switches, etc or drive relays;
There's PWM outputs for control or even generating tones on a speaker;
There's analog input for reading sensors.

For 'real world' examples, we've used them to control a soil sampling system (drive relays, take sensor input, talk to a PC over serial or CAN) and built a 2-PIC control system for a hydraulic motor.

There are even examples out there for using them to build MP3 players (more advanced processors) or data storage devices using compactflash.

So, really, if there's anything you could automate, sense, or control you could do it with an MCU!
 
Apparently you can also create your own usb i/o adapter with just an AVR... This will probably be part of my next project.

Link
 
Ok, Ive gone to the shack, picked up my parts, and constructed my own parallel port programmer for AVRs. First time sodering anything too... Got myself the BOSCOM demo program to play with, and now just need to find myself a ic to start on.

Agent, what would you recommend I use first? And would you mind helping me set up the program correctly :confused: ?
 
marshmallow said:
Ok, Ive gone to the shack, picked up my parts, and constructed my own parallel port programmer for AVRs. First time sodering anything too... Got myself the BOSCOM demo program to play with, and now just need to find myself a ic to start on.

Agent, what would you recommend I use first? And would you mind helping me set up the program correctly :confused: ?
BEGIN PROGRAMMING THEM IN ASSEMBLER. Starting out with a higher level language is foolish. Even if you only write a couple fairly simple programs in assembler before moving up - you'll have gained a bit of understanding as to how they work.

Also I can't imagine why you'd be attracted to basic over C - but whatever flops your mop I guess.

As far as good chips to start out with - the ATMEGA8515 is pretty much the "classic" AVR and you will find tons and tons of code written for it on the Internets (though it will all be written for the AT90S8515 - which should be compatible). The ATMEGA8 is a newer chip that I'd reccomend if you don't go with the 8515.
 
NleahciM said:
BEGIN PROGRAMMING THEM IN ASSEMBLER. Starting out with a higher level language is foolish. Even if you only write a couple fairly simple programs in assembler before moving up - you'll have gained a bit of understanding as to how they work.
I agree that learning assembler provides the most insight into the operation of the hardware, and allows for better performance or logic that may not be able to be created in a higher language. I also highly recommend this path, but offered the Basic compiler as requested in the 1st post. I know hacking my VIC20's 6502 provided me with an understanding of processors that allowed me to more easily grasp many other hardware architectures.

However, I think there is also something to be said about being able to draw upon experience you may already have in a higher language in order to accomplish the project at hand. Basic may be the dog these days, but in it's current structured form it is much better than it used to be.

As for parts, the 8515 is a good chip, but I like the Mega8 for the A/D convertors - but that is more a function of what you want to do with them.
 
joecool234 said:
My company bought our PIC programmer from sparkfun. Great company. As for the programming side...we went the uber expensive route...HiTech ($900 C compiler). They offer a free version, but compiling speed is severly limited (our paid version is 10 times faster than the freebie).

If AVRs perform just as well, if not better, then PICs...go that route. Especially since they offer a full-blown free compiler.

EDIT: Under no circumstance should you PLAN on using assembly. Save that for time critical algorithms. You'll just be wasting your time (unless you're a programming god).

i bought an AVR Programmer from sparkfun.com . great place to check out... think it was like 15$ shipped with extra cable for a programmer capable of doing all the ATMega series...

as for assembly, thats what i think he should start with. will give him a complete understanding of exactly how the microcontroller works, then he can really harness it's power efficiently.
 
Back
Top