PIC or AVR? I'm a beginner and I need to choose wisely

Go To Last Post
47 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi :)

I am a real novice at working with microcontrollers and I have been
playing with Microchip PICs. I discovered the ATMEL website and
began wondering if I should choose their devices over the PICs...?

I already have some tools for working with the PICs but even so
if AVR chips are a better choice I could sell it all on Ebay I suppose :)

Please give me some feedback on this so I can choose the proper
path...anyone here that has used both PIC and AVR chips would really
be able to give me some advice...

I'm mostly wanting to make simple projects right now so the Atiny
chips look interesting to me...I'm using a lot of 12F629 chips right now
to build small thingies

Here is a picture of my PIC dev board (it's hanging on wall behind my
clear PC case)

:)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Save yourself some hair pulling and use AVR chips (been there done that)...if you must use Pics then the 18F series seem to be a more sane choice than the 12F series. Hmmm fluffy toys and dolls....not often seen in AVRfreaks types workshops :-) but I guess being called Gwen that's OK :-)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Gwen,

Maybe not a strong choice to ask that question here.

Let me tell you why I like AVRs. I have been building motorcontrollers with it and several other projects. Some of which are produced in large numbers; amaizing what the part price of AVRs does than...
I develop all software using the WinAVR compiler environment (with programmers notepad (at sourceforge) to enter the code), all written in C, down to the very lowest level. The code output of this compiler is very nice. I can produce signals shorter than 1 micosecond from C. And I have done a project (again all code in C) where the processor does 115200 interrupts per second and some other things. I guess I am telling you these things are Fast.

So, I would suggest you build a simple programmer, and the rest is officially for free. Give it a try and if you do not like it, the only thing to hang on the wall is the programmer. A lot of fun for say $15....

Simon.

PS. Just remember that experience is the sum of all you mistakes. :wink:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, this topic will be necesarily subjective. As nlsgs said, you can only expect an AVR tendency in this forum!

But with the risk of being excerted of this forum ( :wink: ) my personal opinion is that you could try to learn to use both AVRs and PICs. I prefer (with a GREAT margin) AVRs because I consider them overall "better" (best?) microcontrollers, but there are some interesting PICs around. (SIDENOTE: Atmel, we want an AVR-based digital signal controller!!!)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
Hmmm fluffy toys and dolls....not often seen in AVRfreaks types workshops :-)

Think again

JChristoff
Illinois

Last Edited: Fri. Jan 7, 2011 - 03:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

womanhood and microcontrollers :shock: , do you have a boy friend? I just joking :D, I suggest AVR.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think its good to start with PICs if you intend to get really serious about your microcontroller knowledge. PICs have been in use for so long that you are bound to run into a project/product that uses them at some point, so it can be really useful to be familiar with them. At some point you will naturally want the higher speed and slicker architecture of the AVR series. If you continue learning you may even want something faster and more powerful than an AVR, like ARM for example. PIC might not be the sharpest tool in your toolbox but it comes in handy occasionally... good luck with whatever you decide to pursue ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe a slightly different angle from me. I started on 8051, then PIC16, and then AVR. For me at least, changing microcontroller has always had a reason.
I liked the 8051 - it was well behaved, the instruction set was only moderately annoying (only one 16 bit pointer), and it had enough register/register instructions that one accumulator (PIC: W register) sufficed. The downside was that the parts I could get were EPROM types, so the erase-reprogram cycle was a bit long even with 10 chips on the UV eraser. I had a bulky 40-pin grappler that would fit over the processor so I could load code to an external SRAM for faster program cycles.
Enter PIC16C84: In system programmable EEPROM. That was a very nice concept. Only, the devices were a bit small, and I couldn't cope with the mnemonics as designed by Microchip. Parallax' syntax saved that, and for a couple of years I liked it. Still, the architecture is even odder than the C51, and I constantly found myself thinking that the one W register was making certain things rather slow, and the interrupt architecture was poor at best. And not effectively faster than the C51 (I used 4MHz parts) since the instruction set is anemic - you often need two instructions to do what takes 1 on other architectures.
New employer, new FAE's came by with the AT90S8515. Bigger, in-system programmable, this time without high voltages, more SRAM, nice interrupt system, UART, 16 registers that will work as the PIC's W register.. And it was an architecture that it was possible to generate good compiled code for. Yes, I'm lazy, I like to write parts in C. And the instruction , while not orthogonal, is a lot nicer than both PIC16 and C51 when it comes to how many instructions and the number of brain cells you have to dedicate to get to your goal. AT90S8515 lacked a good power-on-reset circuit, that came with the Mega series, and ditto with lower power consumption and a 20-minute DIY e5 ICE..
I might use C51 some day due to all second sources, but I'm not going back to PIC: The architecture kept the complexity down for the designers, and saved transistors at expense of the programmer. The AVR people had better tools, and could handle more complexity (yes, they too have lapses).
I suspect the next step, when they get sleep power consumption down to AVR levels, will be ARM7TDMI. They're even nicer in instruction set, albeit strange in their own way, and there's second sources to drive the price point down.

Uhm... My little pink squeaky pony in an acrylic box. Might be a hit at lan parties.

Last Edited: Sun. Jul 24, 2005 - 03:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Gwen,

Firstly let me commend you on your choice of hobbies. It really can be a rewarding one. Unfortunately few girls choose it. Keep with it, you'll have lot's of fun. I wish you the best of luck.

As for the PIC vs AVR question. Any response you get here will, obviously, be biased towards AVR. So be sure to take that into consideration when making your final choice.

For a beginner I would suggest the AVR because I feel it's architecture is easier to grasp, than that of the PIC. Another advantage for the AVR, is the availability of low cost, and even free, C compilers. Programming in C will certainly make your projects go easier. (Though you should still learn assembly, even if at a rudimentary level) The PIC's architecture, while very capable, is older, and does not lend itself well to development with a higher level language like C. (Yes there are C compilers for the PIC, but often the language is severely hampered by the architecture, and none that I know of are free) Let's not forget one of the best advantages to using an AVR.... this place. This forum has to be one of the best online communities I've ever participated in.

Now having said that, the fact that you have already started with the PIC, and have some experience with it. You may wish to stick with it for now, unless you feel a real reason to change. But if you are looking for a change, then I would recommend the AVR over any other 8 bit micro.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Gwen,

what kind of projects are you planning to do?

(I am a little bit sceptical about your profile, and I am wondering if your post is authentic, because it is amazing, that you are using a real picture of you with the FIRST post and putting a picture with the puppits into this forum, which has only little relation to your question.)

I only saw a PIC application in assembly and thought, with an AVR it would be much easier...

To all girls: microcontrollers is a nice hobby!

Bye
Michael

P.S: One of the best posts I ever saw at AVR freaks. ;-)

In the beginning was the Word, and the Word was with God, and the Word was God.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For simple projects, just about any CPU can do it, so there's no technical reason driving the choice and it comes down to cost and personal preference. For more complex projects, speed and architectural differences start to influence the choice. You may choose a PIC for this and an AVR for that. But when you design things for a living, over and over again, and other people have to make and maintain your products, you have to look at the big picture - what range of devices is available, how fast they run, how consistent they are in software and architecture, how well does the company support them, and so on.

In regard to the big picture, AVR is close to ideal. From the Tiny11 to the Mega128 and beyond, the instruction set is the same - the same assemblers and compilers support them all. The internal architcture is the same - you can take a chunk of code you wrote for a Tiny11 and reuse it with negligible changes on a Mega128, or the other way around. Atmel support is first class - the same development board, programmer and in-circuit emulator work across the range, and although they cost money, it's not much money. Then there's Flash memory - it's a huge convenience, cuts hours or even days off debugging time compared to UV erasable. A few PICs have Flash, but every AVR does.

Now Microchip gives a lot of stuff away for free. This has the side effect of making it attactive to amateurs and hobbyists, so there are a lot of published projects to get you started. However, from an industrial point of view, the PIC is permanently stuck with a "toy" image and PIC experience won't get you far in the job market. It sounds snobby, but that's the way it is. In my industry I see a few PIC designs from time to time, mostly put together by newbie engineers, but they don't make it to the second generation. In fact the electronics industry here in Las Vegas (the "gadget" part, not the main system part) is overwhelmingly AVR. There are a few older 8051 products but these are gradually converting to AVR.

So in summary, PIC is something of a dead end, while AVR is definitely "Big Country". I say you should make the switch.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

peret wrote:
So in summary, PIC is something of a dead end, while AVR is definitely "Big Country". I say you should make the switch.

I agree completely with peret's entire post. I've switched from PIC to AVR. The swinger was a free C compiler (WINAVR). The programming tools (e.g., AVRISP) are inexpensive. Several ATmega's have JTAG and JTAG clone hardware is inexpensive. You can even build your own - I did using a PC board readily available (and inexpensive). JTAG not only allows you to program the ATmega but allows on-chip debugging.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
do you have a boy friend?

Please note that this is not the forum for marriage proposals...they should be posted on the off topic forum I guess...:-)
Many of us here have worked with microcontroller for most of our lives and have settled on AVR. I worked with Motorola chips for more than 20 years, but when Motorola betrayed me by dropping my favourite chip I went looking for something different. The PIC is the perfect chip to break any mental barriers to change...I did one project with the PIC and all of a sudden I could work with pretty much anything!!! Once I recovered enough to start thinking again I looked at several other chip from National, Hitachi, ST etc. I finally settled for the AVR. Is it perfect for everything? NO! But for my applications it comes very close. All of Ampertronics' products are pretty much 100% AVR or they will be by the end of the year (New web page is being worked on).
So you can certainly play with the PIC, there are lots of applications out there, my point being that if you can work with the PIC you can then work with anything else. I have been asked by clients to work on PIC based projects...If I fail to convince them otherwise and use AVR then I will work with the PIC, but it is not my favourite chip. One great thing about the PIC is the backward compatibility of new products in the same family, which is a very important factor fo me, so as long as Atmel keeps with the same attitude and provide backward compatible chips wich are better and cheaper than the old one they have me as a client.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

WoW!

Lots of really great comments :D

Since I already have the tools to work with PICs I am going to do as
LeoNoAioria suggested and just use both PIC and AVR chips. I will do
some simple projects in both AVR and PIC..then I can really see which
is easiest to use ..

I think I will get that AVR butterfly thingie and the ASTK500 kit....with those I will be able to play :D

I got most of my PIC tools at a place called Mikroelektronica...they have a really
cool looking AVR board called the EasyAVR2...it is almost identical to my EasyPIC2
board...has anyone here ever used an EasyAVR? and if so what do you think of it?
They are 114.00

Quote:
what kind of projects are you planning to do?

Well, I will start with just little LED blinkie toys...that's what I started with on the PICs. After I can blink some LEDs then I will move on to more complex stuff,

I will need a suitable AVR part to use in place of the 16F88 I use now.

The chip will need to be able to write to its own flash at runtime..can AVR chips do that?

4k of program space will be enough.

The 16F88 is about 3 dollars... is a suitable AVR about the same price?

Microchip says that the flash in a 16F88 can be written up to 100,000 times...AVR says their chips can be written to at least 1000 times???
Why the huge difference?

Quote:
The swinger was a free C compiler (WINAVR)

That's nice...I wish I was better at C though...I find C very hard to use..maybe i'm just not smart enough for C... I love to program in Delphi (pascal) too bad there is no free pascal for the AVR..

BTW..where is a good place to buy AVR chips at low cost??
I get my PICs at glitchbuster.com.. I use mostly
12f629 -1.34 each
16f88 - 3.19 each

are low-end AVR chips in this price range?

Do AVRs have precision internal oscillators or must you use an external
crystal or resonator?

Hi js :D
I went to your site www.ampertronics.com.au
It has lots of cool things... I like the relay control boards.
I wrote a customizable relay controler for the PC that
uses the lpt ports. I did it in delphi about 3 years ago.
I will include it as an attachment..it's pretty small and
I bet you will find it interesting...you can change the
names of the relays and other stuff at runtime..it's fun.
It is called Portie.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have used three MCs recently; 6812, PICs, and AVRs. All have their benefits and their problems. I moved from PICs to AVRs mostly because of processing power. I would suggest you stick with PICs for a little while for the following reasons.

1. You seem like you are really new at programming MCs. I personally think PICs are easier (there is always someone who will disagree with me though).
2. Your projects are pretty simple it seems and most the benefits of moving to an AVR would probably be lost.
3. You already have the PIC programming equipment.

So stick with PICs for now. Save your money and buy other lots of other ICs to interface with your PICs (once you get bored with LED projects, nothing wrong with LED projects just that as your skill grows they will become less interesting) and then once you want to do a lot of interesting things on the same MC you will probably notice that your PICs are coming up short. That is the time to move to AVRs.

Just my two cents.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I did it in delphi about 3 years ago. I will include it as an attachment..it's pretty small and I bet you will find it interesting..

I DO!! But I would find more interesting if I would get a copy of the code also :-) I dabble a little with Delphi 6 and have a simple application where I want to be able to rename the buttons as you do....but have't got around at doing it..so your code may come in handy as I'm not that good at Delphi even though I found it quite easy to use...with the help of a support list which gave me lot's of help.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi js :)
Unfortunaltely I lost the source to that program along with the source to many others
when my old first computer died.
But the code that you need to rename buttons and stuff and store the changes right
into the exe itself is in a freeware unit I wrote called ExeMod.pas. You can find it on
my very lame website along with many demos that I have made for people.
http://www.geocities.com/gacarpe...

If you ever need any help using ExeMod.pas just ask and I will whip up a demo for you :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
ExeMod.pas. You can find it on my very lame website

Got it, thanks. I'm sure I can get some directions from that...when I get around to do it! By the way I can see from your live cam picture that you have been working with the PIC...that's how most people feel after trying to do anything with it :-) especially when one tries to switch memory banks or the program goes past the 2K and into the next 2k memory.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In response to the original question, I've heard rumors that PICs are slightly more user-friendly for ASM programming purposes. This is consistant with my recent experiences...as after trying some simple Tiny12 functions, I've been plauged with a hellish mess of inexplicable errors that I can only describe so far as a curse. My only advice is to start with something like AVR2313 or Tiny2313 if you come this route. Appearantly, Tiny12 is some bad mojo.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I've heard rumors that PICs are slightly more user-friendly for ASM programming purposes.

They are ABSOLUTELY WRONG!! This is from someone who has used PICs and lots of other processors in the past 25 years :-)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I'm reading through an article I found here on the site called "Newbie's Guide To AVR Development"

If I can get through this article without becoming too frightened then it will be time to order some stuff.

(if I can only figure out what avr chips to get..it's all so confusing at first)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I've heard rumors that PICs are slightly more user-friendly for ASM programming

I can't agree with that at all. I can understand almost any assembly listing, but working on (someone else's) PIC assembly code counts as one of the most disagreeable experiences I've ever had. The mnemonics are meaningless and there are so many hardware dependencies that you have to spend a week with the data sheet before you even start.

@DigiTan, I've never had any problems with Tiny12. Why not start a thread to discuss your Tiny12 difficulties, maybe we can shed some light on it. (edit: my bad - I see you already did. That'll teach me to look first.)

@Gwen, most AVRs have precision internal oscillators, and most can program their own Flash at runtime. I have Tiny12 projects running a "soft" UART at 19,200 baud on the internal RC oscillator; it's accurate enough for that. I wouldn't use the internal oscillator for a real time clock.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all!

Quote:

(if I can only figure out what avr chips to get..it's all so confusing at first)

As you said before, you could start with the great AVRButterfly. It's very cost-effective, since it uses one of the bigger devices and that allows you to grasp the real power of the AVRs...for under US$30. Smiley micros (smileymicros.com) have a good free introduction to the AVRs using butterfly and WinAVR and also sell a book with more in-depth content (I want my commission for this Smiley :D... just kidding!). Also, for general development, in this forum you'll find lots of interesting articles, tutorials and code examples.

If you need a little help selecting an appropiate device, this table is useful:
http://www.atmel.com/dyn/products/param_table.asp?family_id=607&OrderBy=part_no&Direction=ASC

Quote:
If I can get through this article without becoming too frightened then it will be time to order some stuff.

Don't be that modest ;)! It's easy to see that you have a "programmers soul" so I'm sure AVRs will be very fun and somehow easy to learn for you!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was recently looking for a low cost microcontroller for a commercial development and considered all of PIC, AVR, TI MSP430, various 8051's and even Zilog Z8s and given that they all had devices containing the various peripheral blocks I needed (ADC, PWM, SPI, UART etc) the thing that really swung it to AVR for me was COST. This may not be an issue for one-off home hobbyist projects but in consumer electronics where every saved cent counts it is a BIG factor. Atmel's advantage is that they're really a memory vendor who have bolted on a CPU whereas most others are CPU vendors who've botled on flash/SRAM and Atmel seem able to do it for a WHOLE lot less than anyone else (even MicroChip) as the memory arrays occupy quite a lot of the silicon. Actually to say they "bolted on" a CPU is doing them a dis-servicve - they worked in collaboration with IAR to come up with a CPU that's optimised for use with C - which is nice!

It also just turns out to be a nice bonus that the development tools (I tried both IAR and WinAVR and I'm now using WinAVR), KamAVR, AVR Studio 4, etc. are some of the nicest development tools I've worked with. Most of what I do is on ARM7's and ARM9's with ARM's excrable ADW together with ICEs that cost more than $4,000 each (gulp!). Whereas the Atmel JTAG ICE mkII is only something like $300, admittedly for a lot less complicated processor but it's like entering a whole new world (and stepping back in time 20 years)

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm going to order some stuff and if anyone has any thoughts on where is the best place to buy AVR chips from please advise :)
I'm checking out
Digi-Key
All American Direct
Arrow

All American Direct seems to have better prices and to have stuff in stock.
If you know any other suppliers or have any comments on these suppliers
let me know..

I'm looking to order some
Atmega48, Atmega8515,atTiny11,12,13,45
and the STK500

I'm getting the butterfly+c-book+partskit from SmileyMicros

..what is the difference between
Atmega48-20-ND and Atmega48-10-ND ..is it just the operating clock freq?

..what is the difference between
Atmega8515-16PC-ND and Atmega8515-16PI-ND ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not sure that you can get the tiny45 yet, but I could be wrong, it's a really new part.

When you see the part numbers, the 'P' suffix usually means it's in a PDIP package (through hole) The C suffix is for commercial temperature range, while the I suffix is for industrial temperature range. For you it's not likely going to matter, so buy whichever one is cheapest and available.

As for the -10 and -20, you missed the 'v' in there as well it's a atmega48V-10 or a atmega48-20.

The V-10 version both has a max clock of 10MHz, and an operating voltage that goes down to 1.8V. The 48-20 has a max clock of 20MHz, but needs a supply voltage of 5V.

If still unsure, look in the ordering information section of the datasheet.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

Last Edited: Mon. Jul 25, 2005 - 09:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Digikey and Arrow are my suppliers of choice, Digikey for small quantities and Arrow for large. I don't shop around so I don't know who is the cheapest, but I'm quite sure Digikey is the quickest.

The difference between the ATmega48-20 and the ATmega48-10 is that "V" you forgot to include. The ATmega48V-10 will work down to 1.8V, but at a lower clock frequency. There are other options than "V". "L" means a part that works down to 2.7V.

The difference between the PC and PI versions is that "C" means commercial temperature grade (0..70C), "I" means industrial grade (-40..85C).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just ordered all my stuff..
Yipee..can't wait till it all comes in :D

got the parts and STK500 from digikey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course there is no definitive answer. A question like "which is the best chip for my particular application" is more likely to give a meaningful answer.
There are some applications where each device is overwhelmingly better, and others where it makes no practical difference.
If you have some specific applications in mind then it is worth looking at the detailed requirements.
If you just want to 'get into microcontrollers' then it doesn't really matter which you start with, as once you learn one micro, switching to others gets incrementally less hard with each new device.
From the learning point of view, the PIC has the advantage of a small instruction set that can literally be learnt in a day, but this can sometimes be a little limiting once you get into more complex areas (e.g. multi-byte arithemetic is a PITA).
The AVR has a lot more to learn, and a few nasties that can really trip up the newbie and slow the learning process (branch range, different operand formats for SBR vs.SBRC, PIN vs. PORT registers to name the first 3 I could think of), and the newer devices seem to be getting increasingly nonorthogonal (e.g. on teh M169 there are 3 different types of IO register that need to be accessed in different ways).

People always have, and always will argue forever about the relative merits of various archictectures, however in The Real World, issues like cost, availability, packaging, obsolescence policy and tool quality are usually far more important than any architectural nuances like instruction sets and in many cases even processor speed.
A while ago I compiled this page discussing some of the PIC/AVR differences :
http://www.electricstuff.co.uk/picvsavr.html[/url][/u]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mikeharrison wrote:

A while ago I compiled this page discussing some of the PIC/AVR differences :
http://www.electricstuff.co.uk/picvsavr.html[/url][/u]

Interesting page..and quite useful :)

Your right about learning the PIC asm instructions in a day..actually you can do as I did and just jot them all down on a tiny piece of paper and keep it at your side...that way you sort of learn them instantly..since there are so few.

Since I have decided to play with both PIC and AVR chips I should soon know what chip is best for what sort of project..I'd like to play with ARM chips also..if I can find a cheap way to do it as it seems more expensive than PIC or AVR.

My first language was 8086 asm...PIC asm looked really odd at first.
8086 asm is VERY easy to use..even easier than Delphi...if I can use it then anyone can.

My cousin sort of forced me to learn 8086 asm when I was 12. He put an old 386 MB onto a small piece of plywood..it had a vga card and a floppy drive to load the software in and a power supply and keyboard. The whole thing was a sort of GIANT microcontroller... I would make LEDs blink when hooked to the printer port and other simple stuff like that.

I would write the code using TASM on my old Pentium computer and then put it on a floppy and boot my asm code...we had to make up a simple boot sector to load my code in and run it

This stuff is all so much fun! :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey if you can write 8086 ASM, then learning other micro's assembly is not that much harder. And if you're proficient with assembly, then jumping to C language is not that hard either. Plus you'll have the benefit of being more productive (over time) in C.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LeoNoAioria wrote:
Hi all!
As you said before, you could start with the great AVRButterfly. It's very cost-effective, since it uses one of the bigger devices and that allows you to grasp the real power of the AVRs...for under US$30. Smiley micros (smileymicros.com) have a good free introduction to the AVRs using butterfly and WinAVR and also sell a book with more in-depth content (I want my commission for this Smiley :D... just kidding!).

Hey thanks for the good words. I've been a bit asleep at the wheel here lately. And as for the commission -- I here by commission you as a Colonel in the Smiley Army.

Back to my nap,
Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

On the subject of assembly languages, in my experience the second is always the hardest. You have to unlearn (no starwars references please) some perceptions and comparisions one inevitably makes to the first assembly language in the process. The third is far easier and more of an architectural study, and the fourth is just another datasheet.
ARM IS a different architecture, though, and worth a read if just for the entertainment value.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will add a couple of points that I didn't see.

1 - the pics are somewhat more ESD resistant than the avrs. It may matter if you don't properly ground the AVR in a plush toy.

2- AVRs cost less in general than an equivalent pic.

3- PICs tend to have more 16 bit timers than low end avrs. (not that you would need it probably)

4- Microchip GIVES pics away

5- Atmel has a superior development kit (WinAVR/ AVRstudio)

an object at rest...
cannot be stopped!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gwen wrote:
I am a real novice at working with microcontrollers and I have been playing with Microchip PICs. I discovered the ATMEL website and
began wondering if I should choose their devices over the PICs...?

I originally tried PICs, and hated them. Then, I switched to AVRs and am reasonably content. In my experience, the differences between PICs and AVRs are:

1. Microchip makes their money selling PIC development tools to hobbyists, and then gives away the PICs at cost. Atmel gives away their development tools at cost, and sells the AVR chips to make money. For the same $100 or $200, you can get A LOT MORE AVR development tools than you could ever get for PICs at the same price. (Therefore, I got some great tools for under $100 and was able to actually do something with my AVRs, while $100 did not buy me didly squat for PICs.)

2. There are some substantial differences in the PICs. Atmel makes the entire AVR line to run one core of instructions. You cna write a program for a 1200, and run it on a Mega128. This is amazingly useful.

3. AVR compatible development boards are the best sellers around the world. That many developers cann't be wrong.

Gwen wrote:
I think I will get that AVR butterfly thingie and the ASTK500 kit....with those I will be able to play :D

Any of the STK kits made by http://www.Kanda.com are excellent kits. I mainly use the STK 200 and STK 300 kits when I'm not using custom boards.

Gwen wrote:
The 16F88 is about 3 dollars... is a suitable AVR about the same price?

AVRs are a bit more expensive at the low end.

Gwen wrote:
Microchip says that the flash in a 16F88 can be written up to 100,000 times...AVR says their chips can be written to at least 1000 times??? Why the huge difference?

They use slightly different kinds of memory to store their programs in. In my experience, it's not an issue.

Gwen wrote:
BTW..where is a good place to buy AVR chips at low cost?? I get my PICs at glitchbuster.com.. I use mostly
12f629 -1.34 each
16f88 - 3.19 each
are low-end AVR chips in this price range?

Not really. What you see at Digikey is about as good as it gets. Microchip gives PICs away, while AVR makes their money from the AVRs. On the other hand, Microchip charges a small fortune for development tools that are free for the AVR. Given that I might use 100 AVRs in my lifetime, spend lesswith AVRs.

Gwen wrote:
Do AVRs have precision internal oscillators or must you use an external
crystal or resonator?

You can use the internal oscillator, but the STK kits use an external crystal. The reason is that the internal oscillator is impercise. "Real techs perfer crystals."...atleast that's what my co-conspirator who does my hardware says.

Gwen wrote:
Well, I'm reading through an article I found here on the site called "Newbie's Guide To AVR Development"

If I can get through this article without becoming too frightened then it will be time to order some stuff.

When you get your hardware, to get started, work through the tutorial at http://www.AVRBeginners.net It takes a while to load, so I like to download the entire zip of the web site: http://www.avrbeginners.net/zipp...

Gwen wrote:
(if I can only figure out what avr chips to get..it's all so confusing at first)

Atmel makes so many AVRs aimed at so many markets. Just the specialty UBS and CAN chips take several hours to sort out. They need a chart that has every AVR ever made on it, but that might upset marketing.

Gwen wrote:
..what is the difference between
Atmega48-20-ND and Atmega48-10-ND ..is it just the operating clock freq?

..what is the difference between
Atmega8515-16PC-ND and Atmega8515-16PI-ND ?

Go to http://www.atmel.com/products/avr/ and click on "Documentation" then on "Datasheets" to get the specifics on different AVR chips. Atmel is THE SOURCE for all AVR chips.

Finally, I loved your web cam.

Andy Out!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RecycledElectrons wrote:

Gwen wrote:
The 16F88 is about 3 dollars... is a suitable AVR about the same price?

AVRs are a bit more expensive at the low end.

Attiny2313 is 1.80
Atmega48 is 2.60
The prices plummeted recently.

an object at rest...
cannot be stopped!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tarsus wrote:
RecycledElectrons wrote:

Gwen wrote:
The 16F88 is about 3 dollars... is a suitable AVR about the same price?

AVRs are a bit more expensive at the low end.

Attiny2313 is 1.80
Atmega48 is 2.60
The prices plummeted recently.

There is always the ATTiny11 at the low end. :) US$0.54/quantity 1; US$0.375/quantity 100.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
And if you're proficient with assembly, then jumping to C language is not that hard either.

:? :? It hasn't worked for me yet! But it's only been a matter of a quarter of a century so far...so there is still time :lol:

Quote:
Microchip makes their money selling PIC development tools to hobbyists

IIRC I paid exactly the same for MPLAB that I paid for AVRStudio, the PIC programmer kit and the AVR programmer kit costed me about the same (around AU$40.00) and the PIC ICD (second sourced) would be comparable in price to say an ICE200 (R.I.P.)....having said that..

Quote:
I originally tried PICs, and hated them
I still DO :D

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,

I am new to the world of MCUs. So far, I have been experimenting with PICs, building a programmer and an in-circuit debugger, and some amazing led blinkers... 8)

Like Gwen, I also am considering other MCUs. I have a trio of HC08s (MC68HC908AB32) waiting to be programmed, and a local distributor is supposed to send me a couple of ATtinys by the end of the week.

The only thing I am sure of right now is that I love to play with microcontrollers :D

A couple of things said in this thread so far caught my attention :

gunderwood wrote:
I moved from PICs to AVRs mostly because of processing power.

PICs, as far as I can tell, offer faster chips than Atmel's AVR... Am I mistaken? I don't see any AVR faster than 20MHz. PICs go up to 48MHz... When refering to "processing power", what do you mean exactly?

peret wrote:
A few PICs have Flash, but every AVR does.

According to Microchip's website, more than a hundred PICs have Flash memory... Do AVRs offer better Flash programming/features that only a few PICs can do. What am I missing?

Anyone has some thoughts on Motorola/Freescale HC08s?

Great informative thread so far, keep the info coming! :D

--
Joel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
PICs, as far as I can tell, offer faster chips than Atmel's AVR... Am I mistaken?
YES :-) see below.

Quote:
I don't see any AVR faster than 20MHz. PICs go up to 48MHz

PICs (and HC08 IIRC) divide their clock frequency internally by 4 so a 48MHZ PIC would be roughly equivalent to a 12MHz AVR...many AVR's can run at 24MHz or 96MHz in PIC figures :-)

Quote:
Anyone has some thoughts on Motorola/Freescale HC08s?

Definetely! Many of us on this list have abbandoned Motorola as they do abbandon their clients when it suits them. The chip you use today may not be available tomorrow and, unlike say Microchip, Atmel and others you won't have a pin compatible chip to use so you will have to redesign and in many case get your product reapproved by clients or other bodies for lots of $$$. I have just been having a good discussion with Freescale support on this subject this week, the poor staff is apologetic and understand my point of view but company policy is company policy and they can't do a thing about it.
Not to mention that mostrous Code Warrior development system for the HC08....oh..did I mention that? :-)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

KKP wrote:

Enter PIC16C84: In system programmable EEPROM. That was a very nice concept. Only, the devices were a bit small, and I couldn't cope with the mnemonics as designed by Microchip. Parallax' syntax saved that, and for a couple of years I liked it. Still, the architecture is even odder than the C51, and I constantly found myself thinking that the one W register was making certain things rather slow, and the interrupt architecture was poor at best. And not effectively faster than the C51 (I used 4MHz parts) since the instruction set is anemic - you often need two instructions to do what takes 1 on other architectures.

Same exact scenerio here KKP! I still have a tube or two of the 16C84 (not F84, not F84A).

They were great back then for their reprogramability.

However, the PIC divides it's input frequency by 4 meaning a 40 mhz oscillator provides a 10 mhz internal frequency. Most 6805 divide by 2 and most 8051 divide by 12!

The AVR does not divide the frequency at all and once you understand the instruction set, you will notice simularities to the 6805 (if you choose to look at them).

Good luck!

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quick chart on clock division of some chips I can think of immediately:

ICLK = Internal Clock
ECLK = External Clock

    Motorola HC05, HC08 ICLK = ECLK / 2
    STLite series devices ICLK = ECLK / 2 or PLL on internal osc max 8 mhz.
    AVR ICLK = ECLK (max 20 mhz on newer devices)
    Intel style 8051 ICLK = ECLK / 12
    Dallas style 8051 ICLK = ECLK * (3 or 4) then divided by 12
Notice the AVR is the only one running 1:1. Wierd thing is ST will allow a 1:1 but only in Smartcard solutions and internal OSC selection.

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't you also have to consider how many CLKs per instruction. Seems some micros in addition to dividing down the crystal clock also take multiple clock cycles per instructions. Are we comparing CLKs to MIPs?

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One clock, one operation - that's the magic of RISC. The trick is getting data from some location, doing something to it and putting it back in the same location, in the same cycle. This takes some complicated parallel logic, a different set for every different class of instruction, so the price you pay is a reduced instruction set to avoid having the ALU occupy the whole chip. Most CPUs have an internal state machine and move data around on intermediate clock edges, which is why they need to divide the clock down.

Actually the AVR is a bit of a hybrid, as it must have a state machine for operations like ADIW and MUL. It can't do these in a single cycle because they have 16 bit results and it can only move 8 bits at a time.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Smiley,

We could compare either way. I'm used to seeing what's on a bus during different clock periods so I look into divisors but yes, in theory, we do still care if the 1:1 chip is taking 10 clocks to add or increment!

However, being RISC, we know they don't. The STLite devices are very attractive devices for an engineer if the person can live at or below 8 mhz.

I guess it depends on the application sometimes ;)

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

peret wrote:
One clock, one operation - that's the magic of RISC. The trick is getting data from some location, doing something to it and putting it back in the same location, in the same cycle. This takes some complicated parallel logic, a different set for every different class of instruction, so the price you pay is a reduced instruction set to avoid having the ALU occupy the whole chip. Most CPUs have an internal state machine and move data around on intermediate clock edges, which is why they need to divide the clock down.

Actually the AVR is a bit of a hybrid, as it must have a state machine for operations like ADIW and MUL. It can't do these in a single cycle because they have 16 bit results and it can only move 8 bits at a time.

Every micro out there is technilcally a state machine.

They have to:

1. Setup address of next fetch (aka assign the PC)
2. Fetch data present from step 1 and decode it.

depending on what the decode did, there may be a step 3 e.g. a MUL instruction or 'RET'.

In Verliog you would setup your address and then on the next edge of the clock execute a case statement based off the data present from the bus (most effective way).

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I'm french so excuse me for the mistakes.
I wish this post will live a resurrection :)

I've a big project for guitar electronic customization, you can find the description here http://projectguitar.ibforums.co... and I need a very good chip, a uC/DSP it's better :), to control my effect board at distance with the MIDI protocol, having a midi controller in my guitar, and control the volume, tone & cie of 4 guitar pickups and an hexaphonic (=6 output) pickup, and convert the 10 signal simultaneously with many ADC, and send all this signal to a UHF transmitter.

I'm asking myself of taking a DSPIC or a AVR32 7000.
The AVR32 is more powerful, but the developpment board is moooore expensive ... And I will not use 10% of all what AVR32 can do.

I had done some work on ATMEGA32 and on PIC16F84 and 18F4550 ... But all this uC is not enough powerful for what I want to do.

I'm asking myself so if it's a good point to take an AVR32. I will have the opportunity to do a lot of things, but it's really expensive !

Do you think the AVR32 can have simultaneous 10 serial inputs from 10 24 bit/96khz ADC ?? And multiplex them simultaneously to a RF chip ??

Can you say me if the STK1000 board is retro-compatible with the 8 bit AVR, acting as a STK500 developpment board ?? I have not found information about this, but I think it will be the thing which can make me decide to take the AVR32 ...
Thank you to answer

Yann