AVR vs PIC (mouhahahahaha)

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

I purchased some TINY11's from Digikey yesterday. I paid $0.40 each buying 25 pieces!

Compare the power of the TINY11 to the PIC 10F2xx or PIC12x5xx as well price.

AVR = Clock 1:1
PIC = Clock 1:4

Why in the world would anyone use Microchip?

I just felt like asking the question afterall, it's friday!

Regards

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

I tried to answer this and my system crashed! Maybe it was an omen.

Anyway, not to be too obvious, but if someone is intimately familiar with the PIC and has a good development environment set up and isn't designing a product with a large manufacturing run, then the PIC is perfeclty fine. In fact it may be one of the best for newbies since there are oodles of learning materials available. And contrary to what you may hear, learning Basic hasn't hurt anyone. Finally, some folks just aren't interested in getting into which-microcontroller-is-best religious wars, they just use what works best for them.

Okay, I got too obvious,

Joe

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

People use PICs for two main reasons . I have been studying the PIC architecture recently and have been using AVRs for five years.

Often because they have code already written for the PIC pertaining to their application. PICs became cost-effective and advertised in embedded systems magazines in 1993-4. They were the first fast cheap Harvard architecture MCU around. For many years they were the best option in for Flash MCUs. This gave them an enormous market advantage which continues to this day. People learned PICs; tools were developed; source code applications published, ect... PICs developed a marketing positive feedback loop. Microchip constantly introduced new models with more 'bang for the buck' (an old American expression for cost-effectiveness) than anyone else.

Until about six months ago, PICs were the best low-cost solution to Flash MCU applications. Then Atmel launched an agressive price reduction on certain models, like the Tiny11 and Mega 8. They reduced the price by 2/3rds. They should have taken ads in Embedded Systems magazines to announce this price cut. But they didn't and it will take years for what is now the absolute advantage of AVRs over PICs to become known throughout the embedded systems development community.

Atmel should sell small quantities of the Mega 8 and/or Mega 48 on eBay. They should offer auctions of a package of 5 Mega48s and 5 Tiny11s, and include a CD-R with the data sheets, ap notes, and most popular compilers in demo form or open source.

Eventually I plan to do just that. I want to buy a 25-piece quantity of Mega48s from DigiKey, keep five to ten of them, and sell the rest in 5-piece lots on eBay. I believe that it would be successful if not very profitable. But why should I be doing this? ATMEL should be doing this!

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

I use both but prefer the AVR. I've used the PIC since early 1994 but when the AVR came out in later 1996 early 1997, I switched over immediately.

I still have PIC16C84's (not 16F). The feature size is somewhere around 1.20 um (micrometers)! It's huge!

I was just stirring the pot.

Regards

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

Simonetta hit the question right on the head, and as far as I'm concerend said all that needs to be said. Which I hope is true :) Because posts like this get out of hand fast. :lol:

-Curiosity may have killed the cat
-But that's why they have nine lives

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

Simonetta wrote:
Atmel should sell small quantities of the Mega 8 and/or Mega 48 on eBay. They should offer auctions of a package of 5 Mega48s and 5 Tiny11s, and include a CD-R with the data sheets, ap notes, and most popular compilers in demo form or open source.

Atmel have already done you one better with the Butterfly. Microchip has *nothing* that can compete with the price-point the butterfly comes in at, and with all the extra bells and whistles onboard, I really think its a valuable learning tool. I think in a few years, AVR will surpass PIC if Atmel keeps up with products like the Butterfly.

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

ezcomp wrote:
I think in a few years, AVR will surpass PIC if Atmel keeps up with products like the Butterfly.

I thought ATMEL already had passed everybody in sales of 8-bit devices.

Joe

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

smileymicros wrote:
ezcomp wrote:
I think in a few years, AVR will surpass PIC if Atmel keeps up with products like the Butterfly.

I thought ATMEL already had passed everybody in sales of 8-bit devices.

Joe


I can't find any hard sales numbers, but I think the stock prices are a pretty clear indicator: Atmel at about $4 and Microchip at about $28

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

Those stock prices don't mean anything. You need to see other things besides the traded value.

Atmel might have been at $40 before and split several times to knock it down. How much is earning to share ratio, etc.

Sirius Satellite Radio was priced higher than it's competitor XMSR back when they didn't even have a radio out yet.

It's all a game in the stock market.

Regards

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

I thought that Atmel AVR was designed into lots of things like set top boxes for satellite TV, automobile keyless remotes, and so on. deeply embedded micros.

whereas PIC is very high profile in the student/hobby world, but not much revenue, compared to Atmel.

Of course, Atmel's total revenue for AVR is probably a small percent versus their other chips.

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

Like 8051's, PIC's are everywhere. AVR's are the newcomer to the game, but they are making steady headway into the market. Basically Atmels AVR market is growing, while the 8051, and PIC markets are remaining relatively stagnant. while they may be shrinking, their market share far outweighs that of the AVR right now.

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

Why you use AVR and not Philips LPC21xx series??? Is nearly the same explanation as why people use PIC and not AVR. In my country, old motorola chips and 8051 are very common. The only relative new MCU that people use is PIC. I think I'm the only crazy man that used AVR, and now it's migrating to Philips ARM7 series.
Mainly, the problem is the cost and the stock. If I want an AVR I have to wait 2 weeks, because the reseller don't have stock. PICs are everywhere....
I used PICs and also Basic Stamp 2. They are just for hobbiest, when you want to do a good job...you find several limitations...
Bye
Ezequiel
Buenos Aires, Argentina

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

I really don't see why there has to be such antipathy between PIC and AVR users, both are good. Competition is also good. If you know how to use PICs use PICs, if you know AVRs then use AVRs. There needn't be a religious war over the topic!

Why be so stupid as to try and beat people over the head with a mantra "AVR is best" when all you reinforce in others is "stuff you, my PIC rules!"

A product is only as good as the support for it, I mean you could make the world's best uC but without anyone knowing how to use it it is useless. Therefore if the AVR is better, when including the environment one is in (Argentina for example) then it will naturally rise to the top of the market. If the chip is good but not enough people know about it then when ppl have a reason to learn it they will. If not, they will not, you attacking them isn't going to change that.

Trying to create a PIC vs AVR war is just another way of saying you haven't thought about the reason for the differences in popularity. ie you haven't thought it through and maybe just plain, you don't think. Who knows?

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

ezcomp wrote:
I think in a few years, AVR will surpass PIC if Atmel keeps up with products like the Butterfly.

http://www.frost.com/prod/servle...
Quote:
Atmel is the Worlds largest supplier of 8-bit Flash Microcontrollers.

But remember that many of these are (still) the AT89 series of 8051 MCUs.

http://www.atmel.com/journal/doc...

Quote:
Atmel has shipped its 500 Millionth AVR® Flash Microcontroller!
Atmel introduced the AVR 8-bit Microcontroller Architecture in 1997. Over the past six years, the AVR has become the industry’s largest selling 8-bit Flash Microcontroller with a market share of over 30 percent.

Microchip also sells OTP PICs, so they are not counted in the 8-bit Flash market share comparison. If you put togehter PIC's flash and OTP MCUs, they still might sell better than AVRs. Of course Atmel also sells some OTP AVRs like the USB AVRs etc, so it's hard to tell which one sells best if you does not only compare the Flash MCUs. But AVr has gained a lot of market share over the last couple of years and are still gaining market share. I think PIC are loosing market share.

I thinkt he largest supplier of microcontrollers overall is Freescale (former Motorola) and the 2nd largest is Renesas (former Hitachi and Mitsubishi).

http://biz.yahoo.com/prnews/0410...

Quote:
The company's major focus area -- the microcontrollers segment -- experienced stronger growth. An outstanding performance throughout 2003 pushed the company into the number five and number four positions globally in terms of microprocessor IC unit shipment and revenue, respectively. The company's microcontroller unit shipment rose from 61.0 million in 2002 to 131.3 million in 2003, a resounding growth of 121.7 percent. It captured 10.4 percent of the global smart card IC microprocessor market in terms of units shipped in 2003, and enjoyed microprocessor revenue market share of 11.6 percent in 2003.

     Atmel market share*

     Year      2001      2002     2003
     Units     5.4%      6.7%     10.4%
     Revenue   7.3%     11.6%     12.2%

     * Source:  Frost & Sullivan

I think TI MSP430 will be a stronger AVR competitor than Microchip PIC in the future.
TI has just released the new MSP430F2xx which is double as fast as the MSP430 available today. MSP430F2xx: up to 16 MIPS @ 16 MHz.
http://focus.ti.com/docs/pr/pres...
Of course you can't get any 6- or 8 pin MSP430 (at least not yet).

It's also exciting to see how Maxim/Dallas brand new MAXQ10 (8-bit) and MAXQ20 (16-bit) families will develop in the future. So far they have only annouced the MAXQ2000 LCD MCU from the new 8- and 16-bit families.

And Atmel's own new AT91SAM7S ARM7 will probably also compete with the big ATmegas as well as Philips LPC2xxx ARM7.
Atmels advertising indicates that they want the new sub $3 ARM7 MCU to compete with the high-end 8-bit market:
http://www.atmel.com/dyn/corpora...

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

EzequielAceto wrote:
... In my country, old motorola chips and 8051 are very common. The only relative new MCU that people use is PIC....

The PIC has been around and popular for quite a long time, at least in the U.S. I remember mask-programmed versions from the 1970s.

- John

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

jfiresto wrote:
The PIC has been around and popular for quite a long time, at least in the U.S. I remember mask-programmed versions from the 1970s.

Yes, you can read about the history of the PIC MCU here:
http://www.electronic-engineerin...
It has been around for almost 30 years, while the AVR was first introduced in 1997.
So the PIC already had already been in the market for more than 20 years when the AVR was introduced and therefore had a good lead when the AVR was intruoduced.
Just like the case with 8051 and 68HCxx.

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

I'm comming into the MCU arena fresh with no historical bias baggage (e.g.I use AMD not Intel unless I have to). I've had a look at the PIC and the AVR, the AVR looks nicer.....

srg

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

Same here srg86. I did research for about a month on chips before I picked one to play with. I started with looking at Basic Stamps, then I looked into something called BasicX (A high performance version of Basic Stamps actually not a bad product) I found PIC and AVR at the same time. I read the PDF's for a few different chips from each company and picked the AVR series right off the bat. PIC's have been evolving for 30 years. AVR's are a new base of architecture compleltly. Of course AVR is going to have the advantage, they don't have the baggage of compatabiltiy to deal with (they're working on it though)

-Curiosity may have killed the cat
-But that's why they have nine lives

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

er 20 years :?

-Curiosity may have killed the cat
-But that's why they have nine lives

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

Quote:
People learned PICs; tools were developed; source code applications published, ect...
Any statistics available of how many people committed suicide trying to do something with a PIC? :D I was very close :( Only did one project with it.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

It is my understanding that hte PIC was originally developed inside GI (General Instrument) for use in their own projects around 1979.

Microchip was spun off as a company to mass produce to the public sometime around the early 1990s.

This would put the PIC into the normal persons design just a few years before the AVR and they still had to compete against the 8051 and 6805 stuff.

The PIC was cool cause it was executing faster than it's brothers of that era but they still devide the input clock by 4 which really SUCKS! There's no excuse for their division except for technology when they designed it and now they want to stay backward compatible I guess.

You know they sues Scenix and *lost* cause Microchip runs microcode and Scenix is in pure logic. I believe the judge said something about making Scenix remove the div 4 fuse option in their chips hehe.

Regards

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

sxpilot450 wrote:
It is my understanding that hte PIC was originally developed inside GI (General Instrument) for use in their own projects around 1979.

Around 1975 according to the link about PIC history which I my previous post in this topic.
http://www.electronic-engineerin...

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

So PICs are the old man of the house, and AVRs are the kids. No one takes kids seriously (I work with a lot of people much older than me this is very true) No matter what the kid says, no matter how right they are, the old man's always right :)

I don't care how much of a punk kid you are though, you have to respect a company and product that's been around as long as the PIC line has. You just have to hope that after PICs finally expire (or grow up) that you'll be the one holding the torch.

This is the real world, a superior product means nothing if no one is willing to use it because everyone is using something else (Uhh, Microsoft/Intel say what?) :P RISC based systems were proved to be superior in performance to their bloated X86 style (Oh lets just add one more instruction set) counterparts years ago, but no one will use them. Why? Cause it won't run mainstream applications out of the box.

If you want to make AVR's truly prosper and dominate, be a rebel, don't go preeching from the highest mountain about superiority, write a PIC to AVR assembly converter, and show that it can execute the equivilant code faster..

If a group of engineers, designers, programmers, and (Yes them too..) managers, actually sat down and talked to each other and came up with a new hardware/software base that wasn't Wintel flavored, the effective processing power of the average computer would increase by a factor of at least 10 given todays manufactoring techniques.

The world doesn't care if an MCU's processor architecture is superior to another's, it cares about results, the here and now, and known quantaties. It cares about profit margins, and marketing. It cares about cash not AVRFreaks :wink: I'm just here for the ride.

-Curiosity may have killed the cat
-But that's why they have nine lives

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

sxpilot450 wrote:
Microchip was spun off as a company to mass produce to the public sometime around the early 1990s.

This would put the PIC into the normal persons design just a few years before the AVR and they still had to compete against the 8051 and 6805 stuff.


I guess that makes some of us abnormal for considering it in the 1970s! :) It looked like it would have been a great at twiddling I/O bits but we didn't have the volume.

- John

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

Sceadwian wrote:
So PICs are the old man of the house, and AVRs are the
kids. No one takes kids seriously (I work with a lot of people much
older than me this is very true) No matter what the kid says, no matter how
right they are, the old man's always right :)

You may be associating with the wrong sort of crowd or I guess I was
lucky. Some of the engineers and machinist I worked with when I started out
were approaching three times my age and had been in the business for decades. I
don't ever remember any of them not taking my ideas (or me) seriously. The only
exceptions in the company were a few of the cost accountants who became
incredulous when our work drove some of their waste figures negative. (We were
only doing our job - so well that it exposed inaccuracies in their calculations.
Gentle reader, I was young and didn't realize the consequences of showing a cost
history is bunk.)

Quote:
This is the real world, a superior product means nothing if no
one is willing to use it because everyone is using something else (Uhh,
Microsoft/Intel say what?) :P RISC based systems were proved to be superior in
performance to their bloated X86 style (Oh lets just add one more instruction
set) counterparts years ago, but no one will use them. Why? Cause it
won't run mainstream applications out of the box.

I have been developing AVR code on a RISC-based PowerPC machine with out of the
box applications and development software from Apple, and precompiled binaries
and trivial-to-build sources off the web. It has easily been the most
productive development environment I have ever had the pleasure of using. It is
undoubtedly a superior product, and I have no problems with having "everyone"
(including the competition) using something else (add smilies to taste). Except
that it is sad, sometimes, to watch some of the things my fellow man has to suffer
through.

- John

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

sexpilot450 wrote:

Quote:
It is my understanding that hte PIC was originally developed inside GI (General Instrument) for use in their own projects around 1979.

I've got a GI databook from 1982, and PICs were certainly available outside GI at that time.
I confess I never really paid them much attention back then. I needed the data book for the AY8912 (??) complex sound generators which were used in video games of the time.

Four legs good, two legs bad, three legs stable.

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

John_A_Brown wrote:
sexpilot450 wrote:
Quote:
It is my understanding that hte PIC was originally developed inside GI (General Instrument) for use in their own projects around 1979.

I've got a GI databook from 1982, and PICs were certainly available outside GI at that time.
I confess I never really paid them much attention back then. I needed the data book for the AY8912 (??) complex sound generators which were used in video games of the time.

It's not "SexPilot450". It's SuperCross-Pilot 450 because my active hobby is extreme motocross as you can see in my thumbnail. That's me in the desert in Southern California. The bike is a Honda CRF450.

I read the historical article after I posted. Interesting document! I knew GI was involved somewhere ;). I see copyright dates as far back as 1978 on device dies from the older era of chips.

Regards

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

Dingo_aus wrote:
If you know how to use PICs use PICs, if you know AVRs then use AVRs. There needn't be a religious war over the topic!

My old pappy used to tell me "If the only tool you have is a hammer, then everything looks like a nail"

Imagecraft compiler user

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

sxpilot450 wrote:
It's not "SexPilot450". It's SuperCross-Pilot 450 because my active hobby is extreme motocross as you can see in my thumbnail. That's me in the desert in Southern California. The bike is a Honda CRF450.

That's what can happen when you don't use the quote button the right way, to include the name of the member you quote. Just hit the quote button at the right of the post you want to quote, then the name is automatically included in the quote header.

Anyway, I always thought it was an eagle or some other bird in your thumbnail, It' first now I realize it a guy on a motocross bike

I thought SX was because you use the fast PIC clone family called SX... from Ubicom (former Scenix): www.ubicom.com/processors/sx-fam...

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

I like the SX family of processors as well. Scenix started out on a roll but then got bought out by Ubicom and things became frozen.

The problem is their memory model in my opinion. Paging small amounts of ram into place is not fun!

The PC on PIC processors is obnoxious too needle to play around setting the higher bit's manually is a pain and never bought them security so why do it like that.

Just my $0.25

Regards

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

jfiresto I work in a totally different crowd that's for sure. I work at a metal finishing plant with a lot of very stuborn people. It's a very small company so it's more of a family type atmosphere. I only play with AVR's for fun at home. So we're coming from very different backgrounds. What I ment by out of the box was what the public ends up using. There aren't many RISC stations sitting on Bobby Joe's desk at home to play video games on => Although I don't know if any console's are RISC based never studied console system architecture, so I could be wrong :)

-Curiosity may have killed the cat
-But that's why they have nine lives

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

sxpilot450 wrote:
I like the SX family of processors as well. Scenix
started out on a roll but then got bought out by Ubicom and things became
frozen.

I don't remember Scenix being bought out: I just thought they renamed
themselves when they discovered Internet-connected devices as their calling.

Quote:
The problem is their memory model in my opinion. Paging small amounts of ram
into place is not fun!

That was arguably their biggest mistake which must have cost their customers
many man-years of grief and needless cost. The other is the SX's interrupt
system. It is so problematic that Ubicom suggests, apparently in all
seriousness, that a system have no more than one source of interrupts to avoid
having another interrupt occur while one is being serviced. You have probably
noticed the next family of processors they brought out doesn't have any
interrupts. Their marketing department trumpets that as a ground-breaking
advantage. I should have gone into marketing rather than take a job where you
bang your head against the wall fixing things. :)

- John

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

uhm.....

Lucky this is an AVR Forum.
And we don't talk about scary things like PIC in here. :twisted:

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

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

Sorry. I was just getting that out of my system. I feel much better now and thank you for your patience. :)

- John

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

Basic Stamps SUCK. They have limited I/O's, are slow, have almost no onboard features and cost the earth.

I paid AU$50 for an AT90S8535 development board. This has 4 MOSFETS, Speaker Output, Opto-Isolators, RS232 and RS485 chip, etc. onboard. In comparison, a basic stamp has almost no extra features, cost almost AU$100 - JUST for the board, motherboard a good AU$100 or more extra. Seems to me that the AVRs are the clear winner.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

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

abcminiuser wrote:
Blatent Advertising: Learn how to get started with the ABCmini/ABCmaxi development boards for FREE at http://www.zipworld.com.au/~ccyl....

A bit off topic, but I just had a short look at your website:
Quote:
EPROM is similar to Flash, but it stores data that is not part of the actual program (such as data-logging data, variables or settings) and is non-volatile. EPROM is programmed separately to Flash and can be modified by the microcontroller program. Most designers will make a generic program, and have the settings for a specific device stored in EPROM - EPROM’s 100,000 write-cycle rating makes it a good choice for storing data. The HotChip boards have 512 bytes of internal EPROM.

You descibe the different memory types in the AVR and mention EPROM. It's actually EEPROM and not EPROM. There's a big difference between EPROM and EEPROM.
EEPROM's (like in AVR's) are electrically eraseable, which EPROM's are not. You need UV-light to erase an EPROM. As the AVR's does not contain any window, they don't contain any EPROM but EEPROM.

Quote:
PIC micros divide by 2 or 4, so many use a 16MHz clock but only execute the same 8,000,000 cycles per second.

I have not heard of any PIC's that devide the clock by two, but maybe there are some I'm not aware of. Which PIC divide the clock by two?
Howerver the new PIC18 series has an x4 internal PLL, so you can use a 10 MHz crystal with the x4 internal PLL, so it runs 10M clock cycles per second with a 10 MHz clock source connected. (First it multiplies the clock with 4 and then use four clock cycles per program excecution).

Quote:
Each port can act as either an input or an output. The AT chips use 5V TTL (Transistor-Transistor-Logic) technology for the ports...

Isn't it CMOS and not TTL compatible?? I don't think the AVR supports 5V TTL levels when it's running at 5V. There's a huge difference between 5V TTL logic levels and 5V CMOS logic levels. You can't just connect 5V COMS IC's and 5V TTL IC's directly to ecah other.
TTL uses BJTs (Bipolar Junction Transistor) instead of MOSFETs.
And to say it uses 5V for the ports are not true in all cases, it depends on which voltage you use to supply the AVR, you can supply it with lower voltages than 5V.

Quote:
Pulse-width Modulation:
Most microcontrollers (the 8535 is no exception) have the facility to perform Pulse Width Modulation commands (PWM commands) to control the speed of motors. In short, PWM rapidly cycles an output port at a desired frequency at the supply voltage (5v) to speed up or slow down a motor. Since digital IC’s cannot output an analogue voltage (variable voltage), the workaround uses the fact that rapidly pulsing the motor will cause it to rotate, with a speed proportional to the frequency (similar to a stepper-motor).

With PWM it does not run at a speed proportional to the frequency, in fact the frequency is constant with PWM. It runs at a speed proportional to the duty-cycle, which is not the same thing as the frequency.
This is not similar to stepper-motors at all.

Quote:
Many MOSFETs come in a TO-20 package, similar to a voltage regulator.

I beleive you mean TO-220.

Quote:
To use a MOSFET, you will need a resistor to limit the voltage. 100 Ohms is adequate for the AT90S8535.

No, this is wrong. This is not the reaon why there's a 100Ohm is sometimes connected at the gate of the MOSFET. MOSFETS can easily handle 5V, in fact most requires more than 5V unless it's a logic-level mosfet. (Check the Gate-Source threshold level).
In fact the 100 Ohm resistor does not limit the voltage at all, because pratically no current runs in the gate.
You can easily use the MOSFET directly without the 100 Ohm resistor. The 100 Ohm resitor is used to prvent ringing and make the MOSFET turn on/off slower, not to limit the voltage.


You should always remember to connect a back EMF diode across the relay coil in this circuit, otherwise you will soon destroy the transistor that drives it because of the high voltages created by the relay coil when you switch off the relay.


Again connect back EMF diodes or your transistors wil soon be toasted.


Where are your 7805 and AVR decoupling and charge capacitors?

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

there are many circuit about 5-12 votlage covert ,you can choose one

a girl like reading and a bird filled with strange and hopeful ideas.

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

hibiscus wrote:
there are many circuit about 5-12 votlage covert ,you can choose one

???

What excactly are you talking about and which post do you reply to??

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

AndersAnd wrote:
abcminiuser wrote:

Each port can act as either an input or an output. The AT chips use 5V TTL (Transistor-Transistor-Logic) technology for the ports...

Isn't it CMOS and not TTL compatible??


It is if I interpret your question the right way. The JEDEC standard for 4000B-series CMOS specifies symmetric maximum/minimum Vin-low/Vin-high thresholds of 0.3Vcc and 0.7Vcc, respectively. The first two AVR parts I checked are close: 0.3Vcc and 0.6Vcc for the AT90S2343 and 0.2Vcc and 0.6Vcc for the ATtiny26. In practice that should be close enough.

I also can't imagine how or why Atmel would use bipolar i/o transistors particularly at low voltages.

- John

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

This is a bit off topic, but after 58 largely-AVR related posts, I hope the moderators won't mind.

Sceadwian wrote:
jfiresto I work in a totally different crowd that's for sure. I work at a metal finishing plant with a lot of very stuborn people.

A certain kind of stubborness is not always a bad thing, though stubborness that prevents someone from ever changing their mind is not so helpful. The trick is to benefit from someone's stubborness by trying to understand what is behind it. Often you uncover some long held assumption that is appealing but not quite true or that was true enough one time but no longer is. That often helps improve a product or process in a way you would not otherwise have considered.

I worked with a guy for a couple years who was always suggesting how I should do things - in a friendly and well intentioned way. The only trouble was, none of his suggestions seemed to work. I soon realized the best thing I could do was to give an enthusiastic listen to what he had to say (he seemed to enjoy helping people) and then quietly ask myself: Why is this a really bad idea and why would following it lead to disaster? More often than not, that lead to some productive insight that advanced whatever I was working on.

I must have been pretty nice in how I went about this because he never caught on to what I was doing. To this day, he thinks I am one of the most independent workers he has ever met. Oh, Doug, if you only knew :D - and thanks for all your help!

- John

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

8)

Im surpriced how unskilled people who are confident they know right, but actually do it wrong.... This is sad.

That the webpage writer said 100 ohm on the gate is required, really caused me to laugh. :lol:

Let me warn all new comers to the microcontroller scene:
Being able to write assembler, or C, or basica, and then get it to run on a microcontroller is only a very TINY part of the whole product!

Power supply design is probably the easiest to get working, and equally the hardest to get done propperly!! Just using 7805 with 4700u decoupling caps is rather amusing at best. :roll:

Using transistors and (mos)fets requires atleast a class about analog electronics. Just foobaring with grabbing resistors is ok if you dont want to engineer. A true engineer knows what its circuit will do, and can do, and wont do. Not knowing a coil/inductor builds up a magnetic field, which will try to counter efect any change it finds, is just a lack of knowledge... That relay will give a desastrous strong counter EMF when switched of quickly. Ul = di/dt * L .. Lets assume that relay has a self inductance of 22mH draws 50mA, and the turn of time of that mosfet is 1uS

-50mA / 1uS * 22mH = -1100 volt peak.

OUCH said the mosfet, who had a burned chanel.

:wink:

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

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

To add to what has been said a little history...
GI introduced the pic as a peripherial controller to it's 1600 micro processor line.
It used a similar bus pin out to the 1600 up. The first pics were very limited in memory
(they were similar to the current 12 bit pics). When GI went belly up Microchip bought up some of the product line (sound chips, pics, etc).

The AVR processor was introduced as an 8051 arch. with a RISC core. It was the third
(or 4th?) upgraded 8051... Intel introduced the 80251, Philips had their own 16 bit version of the 8051, and Atmel went RISC with the AVR. The AVR is a little different in that while the instruction word is 16 bit, it is still an 8 bit DATA word, while the others have gone 16 bit throughout. The MEGA avr's have expanded the address spaces and added new peripherials.

The 12 and 16 series pics don't translate to C very well, the 18 series does as well in C as the 8051 does. (Yes there are C compiliers for the 12 and 16 series pics, but it must be a very limited subset to fit in such a simple cpu design). The mega avr's are equal to the 18 series pics, the tiny avr cpus compare well with the 12 and 16 series pics.

All of the above are good processors, use what you feel comfortable with. I think that
for hobby / and "skunkwork" projects the mega 16-128 offer rapid prototyping with the avr-gcc compilier and the jtag ice. Maybe a commerical design would be shrunk into a smaller cpu (mega8 or tiny avr) for reduced cost, but for a one off project the extra few bucks just ain't worth saving.

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

Quote:
You can easily use the MOSFET directly without the 100 Ohm resistor. The 100 Ohm resitor is used to prvent ringing and make the MOSFET turn on/off slower, not to limit the voltage.

And in a lot of cases - save the driving circuit in addition to the reasons you mentioned. Since the MOSFET gate is capacitive, nailing the gate with a fast-enough turn-on pulse may result in rather large current spikes. If you don't need the fast turn-on a resistor is a sure-fire way to limit the current demands from the MOSFET - so the thing is there to save the driving circuit I believe.

Quote:
50mA / 1uS * 22mH = -1100 volt peak.

OUCH said the mosfet, who had a burned chanel.

Disclaimer - the following logic is totally wrong, see two posts down by AndersAnd which states the correct information - this part only left so you can continue to follow the thread, and as a monument to my inneptitude

OUCh said the MOSFET, or the power MOSFET? For example grab the datasheet for the IRFZ44 - http://www.irf.com/product-info/... - notice that there is effectively a diode in reverse across the source and drain. Very handy, no?

Obviously this diode does have limits, and I'm just showing that perhaps not all cases do require a reverse polarity diode. But if you are switching smaller loads it actually could be OK to go w/o a reversed diode - don't just assume that because "thats the way its always worked, thats the way it always will work". If it was a bipolar transistor you would be screwed.

Now I'm not an EE, so this could all be wrong of course.

Warm Regards,

-Colin

Last Edited: Mon. Dec 6, 2004 - 08:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The IRF512s shown earlier have an internal zener diode that (per the datasheet) aborbs up to 19 mJ of back EMF. I don't know if that is enough protection for this example. (I haven't done the calculation).

[Oh, someone beat me by one minute!]

- John

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

c_oflynn wrote:
OUCh said the MOSFET, or the power MOSFET? For example grab the datasheet for the IRFZ44 - http://www.irf.com/product-info/... - notice that there is effectively a diode in reverse across the source and drain. Very handy, no?

Obviously this diode does have limits, and I'm just showing that perhaps not all cases do require a reverse polarity diode. But if you are switching smaller loads it actually could be OK to go w/o a reversed diode - don't just assume that because "thats the way its always worked, thats the way it always will work". If it was a bipolar transistor you would be screwed.

Now I'm not an EE, so this could all be wrong of course.

Warm Regards,

-Colin


Yes you are wrong on this one. I'm fully aware of this diode, but it doesn't help anything at all in this case. When the MOSFET is switched off, the voltage over the coil will reverse. This means that a very high positive voltage will build up at the drain of the MOSFET. So the diode will be revese biased all the time and has no effect.
Remember that the drain is negative compared to the other side of the coil (12V). When you switch off the coil the voltage at the drain will change voltage compared to 12V, which. If you use the example from the previous post by MaxK, then you will have +1112V at the drain, not -1100V. So you willl toast the MOSFET (or BJT very fast).
The diode you mention is inside every MOSFET, so there's no need to check the datasheet to see if it's there or not, it's always there in MOSFETs; both N-Channel and P-Channel. Sometimes the internal didode is not shown in schematics, but it's still there.
But some diodes has an internal zener instead of a normal diode, as mentioned by a previous poster. The zener can help reducing the back EMF of the coil, if it can handle the back EMF current. So to check if it's a zener or normal diode, then you have to look in the datasheets.

The two previouse posts forgets that back EMF of the relay will not cause a high negative but a high positive voltage at the drain. Otherwise it would't be back EMF seen from the coil.

Last Edited: Mon. Dec 6, 2004 - 08:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Yes you are wrong on this one. I'm fully aware of this diode, but it doesn't help anything at all in this case.

Ahh.. right you are! I've edited my post to include a disclaimer...

Regards,

-Colin

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

jfiresto wrote:
The IRF512s shown earlier have an internal zener diode that (per the datasheet) aborbs up to 19 mJ of back EMF. I don't know if that is enough protection for this example. (I haven't done the calculation).

[Oh, someone beat me by one minute!]


Yes, you are right an internal zener diode can help, I haven't done any calcultaions either, so I don't know if it's enough.
I missed that info about the IRF512, so the circuit might be good enogh without a back EMF diode, if the zener can handle the current.
But since the webpage is ment as a tutorial, then I think it's important to mention the back EMF diode in all cases. If someone uses another MOSFET then they will get in trouble. It's also important to mention the Gate-Source threshold voltage of the MOSFET, if you want to connect the gate to a logic level signal. Many standard MOSFETs has too high a threshold level to be used for logic level signals.

But MOSFEt's without a zener, but only a normal diode has no effect.

Last Edited: Mon. Dec 6, 2004 - 08:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AndersAnd wrote:

Yes you are wrong on this one. I'm fully aware of this diode, but it doesn't help anything at all in this case. When the MOSFET is switched off, the voltage over the coil will reverse. This means that a very high positive voltage will build up at the drain of the MOSFET. So the diode will be revese biased all the time and has no effect....

The two previouse posts forgets that back EMF of the relay will not cause a high negative but a high positive voltage at the drain. Otherwise it would't be back EMF seen from the coil.


The IRF510+ datasheet show a zener diode. I'm no analog engineer and I haven't read the datasheet carefully but it looks like it would conduct a certain amount of back EMF. The datasheet shows and specifies its series inductances which suggests that that is its purpose. If it is not, why is the diode there? I am just curious!

- John

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

jfiresto wrote:
The IRF510+ datasheet show a zener diode. I'm no analog engineer and I haven't read the datasheet carefully but it looks like it would conduct a certain amount of back EMF. The datasheet shows and specifies its series inductances which suggests that that is its purpose. If it is not, why is the diode there? I am just curious!

I was not aware the IRF512 had an internal zener to begin with, but I have already made another post mentioning the zener diode, just before you made this post, I guess you missed this post.
You were right in your previous post about the zener, I missed that in my first post to begin with, but then I discovered it and edited my post. But you quoted me just before I had editied my post.

But in any case it's important to mention the back EMF in a turtorial and also to mention the internal zener, if this is used to limit the back EMF. Otherwise you will just get in trouble if you use another MOSFET without the internal zener.
The turtorial doesn't mention this zener, so I just thought it was a standard MOSFET without a zener.

My post shouldn't have said "the two previous posts", but "the previous post by c_oflynn". Sorry thats my mistake.

Last Edited: Mon. Dec 6, 2004 - 08:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wasn't clear that Ul = di/dt * L is the voltage over the coil ... my mistake.
Indead the voltage at the drain of the Fet becomes strong positive. Ouch :lol: The reverse diode inside the (mos)fet isn't neccesarely there... These diodes add capacity,, but the diode is present in a FET. the fet is basicly a diode,, which depletion area is controlled with the gate, which again is part of that diode.

Power mosfets often do have them. those diodes where we are arguing about. In H-bridges these diodes are handy!

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

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

MaxK wrote:
The reverse diode inside the (mos)fet isn't neccesarely there...

I haven't heard of a MOSFET without the internal diode, can you give an examle of a MOSFET without this internal diode?
I was convinced that this diode is always inside because of the way the MOSFET is made. I have heard that the MOSFET can't be made without this diode. But I'm not an IC engineer, so I'm not if it's possible or not.
But I would lie to see an example of a MOSFET without this didoe, if you can give an example.

If I understand you correctly, you say that the revese diode is always inside a depletion FET, but not neccesarly inside a enhancement MOSFET?
I think I was told by an IC engineer once that you can't make a MOSFETs without a reverse diode, and I have never seen one myself either. But you say that it is possible to make an MOSFET witout the reverse bias diode?

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

I think that the previous poster made clear that a (mos)fet IS a diode.
A diode with a (insulated) gate, that controls the reverse current flow...

Regards.
Giorgos.

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

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

Giorgos_K wrote:
I think that the previous poster made clear that a (mos)fet IS a diode.
A diode with a (insulated) gate, that controls the reverse current flow...

Regards.
Giorgos.


No he did not, he said that the reverse diode is not neccasarly there in a MOSFET.
Try to read his post again.
There's different types of FETs, both enhancement and depletion types, and he says that depletion type FETs always has the diode. There's JFETs, MESFETs and MOSFETs.
But MOSFETs like in this circuit is not depletion FETs but enhancement MOSFETs.
He said that power MOSFETs often do have these diodes. "often" means: "not always".

Last Edited: Mon. Dec 6, 2004 - 08:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Uhm, Im starting to get confused.

Mainly I only done calculations with FET's
A JFET or FET, has a channel material, this channel ends in drain and source.
NO DIODE (Diode is direct P-N stacked)! no material other then P or N type material! If im wrong, kick me! the channel is made of 1 material.

then the gate is added around the channel, this gate is made of ther other type of material.. if the channel is N, then the gate is P, THERE IS your diode :D obviously thats where the P and N type FETS come from.

Now we where using MOS FETS, thats oxidised layer of metal is a insulator that gets rid of this diode effect of the gate. in a FET.

MOSFET Channel is still 1 material, the only thing that changed is that the gate itself isn't made out of P or N material but just oxidised metal, and ontop a metal tab. on the inner side of the channel theres a nice thick coat of the other type of material (P or N). The Gate can then make an electric field which can repell or attract that coat allowing to close or open that channel.

At this time, we should better find pictures..

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

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

So do you say that you can get MOSFETs without revese bias diode or not? I'm still not sure what you meant by you previous post.
As I read your post you say that it is possible to have a MOSFET witout the reverse bias diode, but I have never haerd of such a MOSFET.

Sorry for the off topic

Anyway if anyone wants to learn about semiconductors like diodes, BJTs and FETs then I can reccomend this book:
Microelectronic Circuits
By Adel S. Sedra & Kenneth C. Smith.
http://www.oup.com/us/companion....
Chapter 5 about BJTs can be downloaded for free a sample chapter.

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

Ah i just found a doc about (power) mosfets
http://www.irf.com/technical-inf...

certain types of power mosfet do have a different design.. the channel idea is much more like a multilayer platch, not a tube.

My books described mosfets as tubes,, RF (MOS)FETS kinda are it seems.

the more powerfull mosfets are likely those large patches :roll:

nobody was wrong.

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

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

About the 100 ohm resistor mentioned earlier:

The input current of the Gate of a MOSFET is typically 10^-15 A.

Try to multiply 100 ohm with 10^-15 A:
100 ohm * 10^-15 A = 10^-13 V
This is the voltage drop acroos a 100 ohm resistor conneted to between the AVR and the MOSFET Gate.
So to use resistor (even in the mega-ohm range) to cause a voltage drop at the gate would be pointless, because it would be very very small.

I know he have also connected a 47k ohm resistor to GND (not sure why, but maybe beause the AVR port pin is floating sometimes in the design), so 100 ohm togheter with 47 kohm causes a very very small voltage drop across the 100 ohm resistor:
MOSFET Gate voltage @ 5V from AVR output pin:
5V * 47,000ohm / (47,000ohm+100ohm) = 4.99 V.
If the MOSFET Gate can handle 4.99 V, then it can probably also handle 5 V as the max Gate voltage would be if the 100 ohm and 47kohm resistors was removed and the Gate was connected directly to the AVR. :wink:

This does not mean that a Gate resistor should never be used, but never to cause a voltage drop, unless you have two reistors conneted as a voltage divider.
But all MOSFETs can handle a Gate voltage of 5V, so you don't need to reduce this voltage. If you do reduce this voltage, the you will probably get below the Gate-Source hreshold voltage and the MOSFET would never switch completely on, which would be a very bad idea when you use the MOSFET as a switch.

Last Edited: Mon. Dec 6, 2004 - 09:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the only reason when the 100 ohm resistor can be used for saving the mosfets channel.

if the gate capacity is 100pF (just picking a number) and the gate resistor is 100 ohm.. the Tau is 10uSec.
roughly after 1 Tau, the voltage over the Gate has settled to 63% of its final value.

Tau = R*C
Vgate = Vin * (1 - Exp(-T/Tau))
So after the output of the micro became high:
1 Tau, the voltage over Gate-Source is 3.16V
2 Tau 4.32V etc.
The revese is basicly the same.

The higher Tau, the slower di/dt,, the less voltage is induced in the coil during switching on or off.
edit: the slower Tau is, the longer power is actually being disipated in the MOSFET itself. That power can quickly be higher then the maximum rated power.

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

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

MaxK wrote:
roughly after 1 Tau, the voltage over the Gate has settled to 63% of its final value.

Theroretically it will never reach a final value becuase it will never reach 100%, but it will keep increasing forever and getting closer and closer to 100% but never actually reach 100%. Anyway, this is some theory that we don't have to worry about, to design a circuit.

But in pratical circuits a rule of thumb is used that states that the capacitor it is fully chraged after 5 tau, because it has alomst reached 100% after 5 tau.

Last Edited: Mon. Dec 6, 2004 - 10:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I know he have also connected a 47k ohm resistor to GND (not sure why, but maybe beause the AVR port pin is floating sometimes in the design)

Ah - this one I do know the answer to ;-) Either during reset or reprogramming the pin will be floating. At that point since it is capacitive it will simply have the last state until it bleeds off the charge - in this case the resistor is handy as it bleeds the charge off instantly.

And for example if you have a BOD on the device - if a brown out occurs it will keep the device in reset. But since there might be enough power to drive the motor, the motor will keep on despite the fact that the control logic is now dead! Depending on the application it could result in hassles, burnt out motors, or severe damange.

-Colin

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

How about the variable capacity with diodes :lol:

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

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

I forgot what the port states will be in the different sleep modes. Are all the ports set as inputs (floating) or pulled high or low in sleep mode or do they just keep their state?

The 47 kohm resistor in the design is a good idea because of the reasons you mention.
There might be cases where the state of the MOSFET doesn't matter during reprogramming, maybe the 12V is off during reprogramming and reset or maybe the state of the relay does not matter at this time. It all depends on the application as you say.

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

I believe they keep the last state you set them to.

- John

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

sxpilot450 wrote:
I purchased some TINY11's from Digikey yesterday. I paid $0.40 each buying 25 pieces!

Compare the power of the TINY11 to the PIC 10F2xx or PIC12x5xx as well price.

AVR = Clock 1:1
PIC = Clock 1:4

Why in the world would anyone use Microchip?

Seriously? I bought 100 tiny11s ($0.25 each) as part of the piclist group buy. They're nice
enough, but they don't blow the 8pin PIC flash chips out of the water, either...

The clock multipliers are essentially irrelevant. the internal PIC clock is 4MHz, and the
internal Tiny11 clock is "about" 1MHz, so the both end up running at 1 MIPs.
(you weren't going to put an external clock on an 8pin chip, were you?)

The PIC clocks are calibrated "almost enough to do serial comm", the tiny11
clock is uncalibrated and especially primitive, with clock rate being highly
dependent on supply voltage.

The AVR sources somewhat less current on an IO pin than the PIC.

The tiny11 uses "high voltage serial programming", a programming method not well
suited to ICP, and not well supported by "hobbyist" tools.

The tiny11 is one of the minimal AVRs, not supported by GCC, while there are
several demo PIC C compilers than produce fine code for the 8pin PICs.

The tiny11 is artifically low priced; if you don't fit in it for some reason, you face a
significant price increase right away. The small PICs have a much more 'continuous'
range of similar products.

The 8pin pics are 2 to 5.5V parts; it take three separate tiny11 parts to cover the same range.
(Officially speaking, anyway. Presumably they're the same parts and only the testing is different.)

I've burnt out (somehow) 4 of the tiny11s on my initial programmer and project.
I don't know how. They seem a bit '"fragile."

Mind you, it's a great deal, and there are lots of projects where being half the price is
very nice, and you won't notice or can work around the quirks of the tiny11. But its not a
complete slam/dunk, either.

BillW

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

One area in which Microchip beat Atmel is embedding fuse info. Microchip have a defined method of embedding fuse information in the .HEX file. EEPROM too for that matter.
I for one am sick of manually re-entering fuse and lock bit information.
I programmed 18 prototype boards yesterday, and then noticed I'd forgotten to check one fuse box.
Maybe this is possible with Atmel's production programmers, but Microchip make this available right across the board.
It's not enough to make me switch back, but what's so difficult, come on Atmel! If Microchip can do it...

Four legs good, two legs bad, three legs stable.

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

When I am being long-winded, I type

make fuses prog lock

using "uisp", an STK500, and Mac OSX. It would be no trouble at all to automate the process or to add a nice one-click GUI. Any chance you could use a more developer friendly development system?

Another thought. When I had a similar problem on an old Macintosh, I bought a copy of QuicKeys from cesoft.com and programmed it to click and fill in things whenever I hit a function key. You might give their Windows version a try. The original Mac version saved me a lot of time and trouble back then.

- John

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

Quote:
Any chance you could use a more developer friendly development system?

I only want to program my bootloader, after that I have a very user friendly dev. system.
Anyway, that's like saying "there's no word for 'elan' in English, so I'm going to have to move to France".
Why not steal the word and incorporate it into your own language?

Four legs good, two legs bad, three legs stable.

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

westfw wrote:
Seriously? I bought 100 tiny11s ($0.25 each) as part of the piclist group buy. They're nice
enough, but they don't blow the 8pin PIC flash chips out of the water, either...

You could just buy ATtiny13 instead of ATtiny11. ATtiny13 has many of the features that ATtiny11 lacks, but it's still cheaper than PIC12F629 and PIC12F675.

Prices at Digikey:
ATtiny11: $0.54
ATtiny13: $1.29
PIC12F629: $1.68
PIC12F675: $2.08

westfw wrote:
The clock multipliers are essentially irrelevant. the internal PIC clock is 4MHz, and the
internal Tiny11 clock is "about" 1MHz, so the both end up running at 1 MIPs.
(you weren't going to put an external clock on an 8pin chip, were you?)

The PIC clocks are calibrated "almost enough to do serial comm", the tiny11
clock is uncalibrated and especially primitive, with clock rate being highly
dependent on supply voltage.


ATtiny13 has a calibrated internal RC Oscillator that provides an 9.6 MHz or 4.8 MHz clock + 128kHz internal clock.

westfw wrote:
The tiny11 uses "high voltage serial programming", a programming method not well
suited to ICP, and not well supported by "hobbyist" tools.

ATtiny13 has low voltage ISP supported by all hobbyists tools.

westfw wrote:
The tiny11 is one of the minimal AVRs, not supported by GCC, while there are
several demo PIC C compilers than produce fine code for the 8pin PICs.

ATtiny13 has internal RAM which ATtiny11 lacks, and therfore ATtiny13 is supported by all the AVR C-compilers.

westfw wrote:
The tiny11 is artifically low priced; if you don't fit in it for some reason, you face a
significant price increase right away. The small PICs have a much more 'continuous'
range of similar products.

As mentioned earlier, ATtiny13 is actually cheaper than the PIC12 family.
Eventhough ATtiny13 has 4x10-bit ADC inputs, it's still cheaper than PIC12F629 which has no ADCs.
PIC12F675 which has ADCs is much more expensive than ATtiny13.

westfw wrote:
The 8pin pics are 2 to 5.5V parts; it take three separate tiny11 parts to cover the same range.

ATtiny13V covers the whole range from 1.8V to 5.5V in one single device.

westfw wrote:
I've burnt out (somehow) 4 of the tiny11s on my initial programmer and project.
I don't know how. They seem a bit '"fragile."

ATtiny13 uses low voltage serial programming and is probably thes fragile.

westfw wrote:
Mind you, it's a great deal, and there are lots of projects where being half the price is
very nice, and you won't notice or can work around the quirks of the tiny11. But its not a
complete slam/dunk, either.

I think ATtiny13 is a beeter offer than PIC12xxx.

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

jfiresto wrote:
The IRF512s shown earlier have an internal zener diode that (per the datasheet) aborbs up to 19 mJ of back EMF. I don't know if that is enough protection for this example. (I haven't done the calculation).

[Oh, someone beat me by one minute!]


I just checked the IRF512 datasheet and as far as I can see it has no internal Zener diode, but only a normal diode with a reverse breakdown voltage of >100V.
So I don't think you can avoid the back EMF protection diode across the coil, unless you want to destroy the MOSFET/BJT/IGBT.

http://eecs.evansville.edu/pdf/i...
http://www.irf.com/product-info/...

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

AndersAnd wrote:
I just checked the IRF512 datasheet and as far as I can see it has no internal Zener diode, but only a normal diode with a reverse breakdown voltage of >100V.
http://eecs.evansville.edu/pdf/i...
http://www.irf.com/product-info/...

Both datasheets show the American symbol for a zener diode between the drain and source, or at least the symbol I remember from some years ago! It would not surpise me that Harris Semi and International Rectifier would use that rather than the European one with a single right angle barb. (Isn't the IRF510 fairly old?)

- John

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

jfiresto wrote:
AndersAnd wrote:
I just checked the IRF512 datasheet and as far as I can see it has no internal Zener diode, but only a normal diode with a reverse breakdown voltage of >100V.
http://eecs.evansville.edu/pdf/i...
http://www.irf.com/product-info/...

Both datasheets show the American symbol for a zener diode between the drain and source, or at least the symbol I remember from some years ago! It would not surpise me that Harris Semi and International Rectifier would use that rather than the European one with a single right angle barb. (Isn't the IRF510 fairly old?)

This symbol is also used for some schottky diodes that are not supposed to be used as zener diodes, try to look here for examle:
http://www.irf.com/product-info/...

But all diodes are basically zener dioedes; if the reverse voltage is high enough, they will conduct as a zener didoe.

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

AndersAnd

Quote:
I think ATtiny13 is a beeter offer than PIC12xxx

For me ATiny13 is useless because have not own Xtall oscillator, you can select or internal RC or externall input. It is strange idea - uP without precise clock source. It looks like rest from Tiny 2313 faulty silicon packed to little box.

Szymon

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

John_A_Brown wrote:
Quote:
Any chance you could use a more developer friendly development system?

I only want to program my bootloader, after that I have a very user friendly dev. system....

My first suggestion wasn't meant to be taken too seriously. I would definitely check out QuicKeys or something similar. I found it did wonders for making GUI-driven programs do exactly what I wanted, every time.

- John

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

Izotech wrote:
AndersAnd
Quote:
I think ATtiny13 is a beeter offer than PIC12xxx

For me ATiny13 is useless because have not own Xtall oscillator, you can select or internal RC or externall input. It is strange idea - uP without precise clock source. It looks like rest from Tiny 2313 faulty silicon packed to little box.

Szymon


You can use an external crystal clock oscillator to get a precise clock for ATtiny13.
The on-chip crytal oscillator is probably left out o make the device cheaper and by using an external crystal clock oscillator you will also save a port pin.
The footprint of an extrenal clock oscillaor is about the same as for a crystal + two capacitors, and you will also have an extra port pin to use for other purposes. The extra port pin can be important on a MCU with max 6 port pins.
Using ATtiny13 + exteranl clock oscillator is probably not more expensive than using PIC12 + crystal.
So I wouln't say this makes the ATtiny13 useless, you can always get a precise crystal clock for ATtiny13 if you want to.

But a precise clock is often not necccasary for many 8 pin MCU applications, the internal oscillator willl be sufficient in many cases.

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

AndersAnd wrote:
This symbol is also used for some schottky diodes that are not supposed to be used as zener diodes, try to look here for examle:
http://www.irf.com/product-info/...

Oh, I give up. I have always drawn Schottky Diodes with square 180-degree hooks at both ends. Too bad Clarence Zener is not around to show us how we should draw his diode versus the others!

- John

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

Oh, I give up. I have always drawn Schottky Diodes with square 180-degree hooks at both ends. Too bad Clarence Zener is not around to show us how we should draw his diode versus the others!

From what I've seen the Schottky diode is drawn with an integral sign for the cathode, while the Zener is drawn with a "Z" for the cathode.

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

jfiresto wrote:
AndersAnd wrote:
This symbol is also used for some schottky diodes that are not supposed to be used as zener diodes, try to look here for examle:
http://www.irf.com/product-info/...

Oh, I give up. I have always drawn Schottky Diodes with square 180-degree hooks at both ends. Too bad Clarence Zener is not around to show us how we should draw his diode versus the others!

Yes, there seems to be no standard for differnt diode symbols.
Often schottky diodes are often drawn as normal diodes.
America and Europe uses different components symbols too.
There are European IEC standarized symbols for gates, counters etc.
Philips uses these symbols in their datasheets. But most european engineers prefers to use the standard (American) symbols instead of the strange IEC symbols.
I find it much easier to read digital schematics with noraml gate symbols instead of IEC symbols. The IEC symbols are not that popular in Europe even though they are supposed to be the European standard. But most books uses the American symbols anyway.
I don't think there's any IEC standard for didoe and transistor symbols, like the case is with logic symbols.

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

kscharf wrote:
From what I've seen the Schottky diode is drawn with an integral sign for the cathode, while the Zener is drawn with a "Z" for the cathode.

Try to see here then:
http://www.irf.com/product-info/...
They use the z symbol for a schottky diode.

But in Europe we often use this symbol for zeners tinstead of the z:

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

Try to see here then:
http://www.irf.com/product-info/...
They use the z symbol for a schottky diode.

As my grandmother would say, they are mixing Kassa with Borcht.

There are TWO diodes in this device, both drawn the same way.
However, the diode across the mosfet IS a ZENER, while the other
is a schottky. Technically, the free diode was drawn with the
wrong symbol.

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


But in Europe we often use this symbol for zeners tinstead of the z:

That symbol is closer to that of a TUNNEL DIODE.

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

kscharf wrote:
However, the diode across the mosfet IS a ZENER...

I don't think so, what makes you think that?
I don't see any indication of that in the datasheet (except for the symbol).

What is the zener voltage if it is a zener diode as you suggests?

I think it's a normal diode and not a zener diode.

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

I have a silly question as a newbie to this forum. Is it normal for threads here to drift a bit? This one started out as a comparison of AVRs to PICs and now we are debating zener diodes and power MOSFETs!

- John

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

I don't think so, what makes you think that?
I don't see any indication of that in the datasheet (except for the symbol).

What is the zener voltage if it is a zener diode as you suggests?

I think it's a normal diode and not a zener diode.

The mosfet is Pchannel. Take a look at how the diode is connected,
reverse biased. It will NOT conduct until the voltage reaches it's
zener voltage. It's purpose is to short around the mosfet BEFORE
an applied voltage reaches the breakdown voltage of the mosfet,
IE: it is a protection device.
The zener voltage might not be specified in the spec's, the user can
ignore the existance of the zener, unless he exceeds the rated source
to drain breakdown voltage.

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

kscharf wrote:
The mosfet is Pchannel. Take a look at how the diode is connected,
reverse biased. It will NOT conduct until the voltage reaches it's
zener voltage. It's purpose is to short around the mosfet BEFORE
an applied voltage reaches the breakdown voltage of the mosfet,
IE: it is a protection device.
The zener voltage might not be specified in the spec's, the user can
ignore the existance of the zener, unless he exceeds the rated source
to drain breakdown voltage.

Of course the diode is reverse biased, otherwise you could never turn off the MOSFET.
A reverse diode is inside all MOSFETs, this is a good thing when you use MOSFETs for a H-bridge for motor control, then the current runs through the diode when the MOSFET is reverse biased. Without this diode the H-bridge wouldn't work if you did not connect an external diode as you have to do if you use BJTs or IGBTs for H-bridges.

Last Edited: Thu. Dec 9, 2004 - 02:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jfiresto wrote:
I have a silly question as a newbie to this forum. Is it normal for threads here to drift a bit? This one started out as a comparison of AVRs to PICs and now we are debating zener diodes and power MOSFETs!

In my experience, this Forum drifts less than most.

In particular, specific questions on a topic tend to stay very close. Often, however, EW and his minions try to convert me to the "correct" compiler and syntax to use. :)

Once in a while, informal threads like this one turn into more of a chat. I remember the one when the new Forum software was introduced, and we tested to see how many levels deep we could nest the Quote feature. Mean Moderator Colin (often referenced in this Forum as a search for "MMC" will attest) finally put a stop to the fun. Scan the titles of the last page or two; almost all of those threads will stay on-topic. Even those titled "HELP".

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

theusch wrote:

In particular, specific questions on a topic tend to stay very close. Often, however, EW and his minions try to convert me to the "correct" compiler and syntax to use. :)

What minions? :shock:
What's the correct compiler?

And you're always free to use your typically non-portable code anyways. :wink:

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

John_A_Brown wrote:
One area in which Microchip beat Atmel is embedding fuse info. Microchip have a defined method of embedding fuse information in the .HEX file. EEPROM too for that matter.
I for one am sick of manually re-entering fuse and lock bit information.
I programmed 18 prototype boards yesterday, and then noticed I'd forgotten to check one fuse box.
Maybe this is possible with Atmel's production programmers, but Microchip make this available right across the board.
It's not enough to make me switch back, but what's so difficult, come on Atmel! If Microchip can do it...

This can be addressed by your programmer John. Your programmer can say "put the fuses at 8000h, put the eeprom at 800h" etc.

Regards

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

John_A_Brown wrote:
One area in which Microchip beat Atmel is embedding fuse info. Microchip have a defined method of embedding fuse information in the .HEX file. EEPROM too for that matter.
I for one am sick of manually re-entering fuse and lock bit information.
I programmed 18 prototype boards yesterday, and then noticed I'd forgotten to check one fuse box.
Maybe this is possible with Atmel's production programmers, but Microchip make this available right across the board.
It's not enough to make me switch back, but what's so difficult, come on Atmel! If Microchip can do it...

I agree
There is no reason why atmel could not specify a segment way out of range (say segment FFFF, as I'm sure an AVR will never have 4G of flash) to contain the fuses. It would also prevent a lot of mistakes, as now the fuse info is bound to the binary, and not left to the tech on the floor to set them correctly.

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

There is no reason why atmel could not specify a segment way out of range (say segment FFFF, as I'm sure an AVR will never have 4G of flash) to contain the fuses. It would also prevent a lot of mistakes, as now the fuse info is bound to the binary, and not left to the tech on the floor to set them correctly.

So what is to prevent avr-gcc from adding a fuse pragma which would generate a new code segment in the hex file, and then have avarice or avr-dude see this in the hex file and burn the fuses as required? Sounds ONLY like a software tool issue, and if Atmel won't fix avrstudio, then lets do it in the open source tools.

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

sxpilot450 wrote:
This can be addressed by your programmer John. Your programmer can say "put the fuses at 8000h, put the eeprom at 800h" etc.

Of course it can be addressed by the programmer, and in part it must. But it's Atmel that needs to set the precedent here, and define the linear address space, so that all the tools will can use a common format. Though this will make it harder for generic tools, as you are now placing out of band information into the band. Would have been nicer if atmel provided a linear map through the SPI to program all the address spaces of the AVR.

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

kscharf wrote:
There is no reason why atmel could not specify a segment way out of range (say segment FFFF, as I'm sure an AVR will never have 4G of flash) to contain the fuses. It would also prevent a lot of mistakes, as now the fuse info is bound to the binary, and not left to the tech on the floor to set them correctly.

So what is to prevent avr-gcc from adding a fuse pragma which would generate a new code segment in the hex file, and then have avarice or avr-dude see this in the hex file and burn the fuses as required? Sounds ONLY like a software tool issue, and if Atmel won't fix avrstudio, then lets do it in the open source tools.

It's absolutely a software issue. And sure it can be done in the open source tools. The problem is to get all the tool makers to agree on a common format, so it won't mater who, or what, generated the code.

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

sxpilot450 wrote:
John_A_Brown wrote:
One area in which Microchip beat Atmel is embedding fuse info. Microchip have a defined method of embedding fuse information in the .HEX file. EEPROM too for that matter.
I for one am sick of manually re-entering fuse and lock bit information.
I programmed 18 prototype boards yesterday, and then noticed I'd forgotten to check one fuse box.
Maybe this is possible with Atmel's production programmers, but Microchip make this available right across the board.
It's not enough to make me switch back, but what's so difficult, come on Atmel! If Microchip can do it...

This can be addressed by your programmer John. Your programmer can say "put the fuses at 8000h, put the eeprom at 800h" etc.

Sorry, I was meaning that your programmer can say to you that in your .HEX or .BIN file that at location 8000h you would have the words for your fuse settings and at say 800h your eeprom would rest.

This is how my Allpro-48 works for Atmels, Pics, etc. If you choose not to embed your eeprom at the location they tell you for a device, you have to manually add the eeprom.

It's cosmetic appearance and has nothing to do with the actual device.

Regards

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

glitch wrote:
sxpilot450 wrote:
This can be addressed by your programmer John. Your programmer can say "put the fuses at 8000h, put the eeprom at 800h" etc.

Of course it can be addressed by the programmer, and in part it must. But it's Atmel that needs to set the precedent here, and define the linear address space, so that all the tools will can use a common format. Though this will make it harder for generic tools, as you are now placing out of band information into the band. Would have been nicer if atmel provided a linear map through the SPI to program all the address spaces of the AVR.

Atmel doesn't have to do anything Glitch.

When I select an Atmel 2313 with my Allpro-48 device programmer, it tells me that the chip's memory runs from 0-7FFh and the eeprom content is at 800-87Fh.

Just as the Allpro people did, you can do the same with public programming tools. You would place the eeprom proceeding the flash area for example and the fuses can proceed the eeprom.

Then you programmer software says, "Ok, this device is 2k words so at 2k+1 we have eeprom data and at 2k+eeprom_max+1 we have the fuse words".

;)

Regards

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

I'm with glitch and kscharf on this one.
I don't want to have to get another programmer. I want to carry on using the AVRISP, and I want my remote colleagues to be able to use the AVRISP.
It's a glaring omission in my opinion, and no amount of "why not buy another programmer" will change my mind.
That said, maybe I should post a request in the AVR Studio forum. If I do so, can I expect any support (from you lot I mean)?

Four legs good, two legs bad, three legs stable.

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

kscharf wrote:

So what is to prevent avr-gcc from adding a fuse pragma which would generate a new code segment in the hex file, and then have avarice or avr-dude see this in the hex file and burn the fuses as required? Sounds ONLY like a software tool issue, and if Atmel won't fix avrstudio, then lets do it in the open source tools.

glitch wrote:

It's absolutely a software issue. And sure it can be done in the open source tools.

I agree. Just realise that "just adding a pragma" is not always quick. As always the contrained resource here is volunteers and volunteer time. To change anything in any of the GNU tools (GNU Binutils, GCC, GDB), requires filing a copyright assignment to the FSF, getting permission from your employer, getting your changes worked up into a patch, getting approval from the appropriate maintainer, and getting it rolled into the main code in CVS.

The last 3 are not that hard, and some help is available for doing that. But right now there are a limited number of people who can get things into any of the GNU projects. More volunteers are always welcome.

glitch wrote:

The problem is to get all the tool makers to agree on a common format, so it won't mater who, or what, generated the code.

Are you talking about all the commercial AVR tool makers to agree on a common format? If so, that will never happen as it's too competitive. I would say pick a decent format for the open source toolchain and just get the thing implemented ASAP. There is such a place for a de facto standard. :wink:

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

John_A_Brown wrote:
If I do so, can I expect any support (from you lot I mean)?

Sure. I'll send you a quote.... :lol:

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

EW wrote:
John_A_Brown wrote:
If I do so, can I expect any support (from you lot I mean)?

Sure. I'll send you a quote.... :lol:

A. I was really talking more about AVR Studio than GCC.

B. If there was a "standard" address space in the HEX file for fuses and lock bits to be stored, I'd be prepared to write my own macros and to work out how to emit the data to the appropriate address.

C. What I meant by "support"; Iif I posted a request in the AVR Studio forum asking for such a feature to be included in a future release of AVR Studio, would my post shrivel up and die of loneliness, or would it attract any endorsements.

D. To be honest, this problem will eventually disappear for me, as the programming will be done by the manufacturers, but I stick by my original observation, that it's one area in which Microchip beats Atmel.

E. It constantly amazes me how much effort people in these forums put into defending Atmel. I've no desire to badmouth them, but call a spade a spade for heaven's sake. Otherwise there's no pressure to improve.

Four legs good, two legs bad, three legs stable.

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

Back to MOSFETs for a minute.. :) Too much generalization; not all parts are the same. With so much variation in symbols, we have to look elsewhere for guidance.

Some MOSFETs have an avalanche current and energy rating. I infer from this that they have a useful Zener diode inside, subject to those limitations. See IRF540.

Other MOSFETs do NOT have an avalanche spec. Of course the diode inside will break down with enough voltage. If the data sheet doesn't give avalanche specs, stressing the part to breakdown is NOT a good thing to do.

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

John_A_Brown wrote:
EW wrote:
John_A_Brown wrote:
If I do so, can I expect any support (from you lot I mean)?

Sure. I'll send you a quote.... :lol:

A. I was really talking more about AVR Studio than GCC.

Oh. Oh, well.... :)

John_A_Brown wrote:

B. If there was a "standard" address space in the HEX file for fuses and lock bits to be stored, I'd be prepared to write my own macros and to work out how to emit the data to the appropriate address.

Well, that's one nice thing about Open Source tools. You can write your own method and it works well enough, and enough users use it, it can become a de facto standard. There's power in numbers....

John_A_Brown wrote:

C. What I meant by "support"; Iif I posted a request in the AVR Studio forum asking for such a feature to be included in a future release of AVR Studio, would my post shrivel up and die of loneliness, or would it attract any endorsements.

Well, this looks encouraging:
https://www.avrfreaks.net/phpBB2/viewtopic.php?t=25369

John_A_Brown wrote:

D. To be honest, this problem will eventually disappear for me, as the programming will be done by the manufacturers, but I stick by my original observation, that it's one area in which Microchip beats Atmel.

Sure, there's definitely room for improvement.

John_A_Brown wrote:

E. It constantly amazes me how much effort people in these forums put into defending Atmel. I've no desire to badmouth them, but call a spade a spade for heaven's sake. Otherwise there's no pressure to improve.

Really? I don't notice people really defending Atmel, other than the "my processor is better than your processor" garbage. I'm definitely willing an do point out where they need improvement. I've seen others do that here on AVR Freaks as well.

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

No one needs a new programmer guys.

You can still use your AVRISP. The change would be in how the software handles files it loads into devices.

The software controlling the programmer would parse the file apart and load the flash, then eeprom, then program the fuses, ...

It's not rocket science. I have parallel port serial programming code lying around from 1996 that did this exact scenerio for the older AVR's.

I think the easiest way to implement this would be to ask the software designer of the programmer for this type of funtionality.

Regards

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

Well, I thought that's what we're talking about. It could be done in avrdude...

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

!RUN! :shock: This thread has breached 100 posts. The pure ego and babble is approaching critical density! Get clear before she blows!

-Curiosity may have killed the cat
-But that's why they have nine lives

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

Well it seems that I can do pretty much everything I want by using avrdude with my AVRISP.
Great, that means I can ditch Studio completely!
Many thanks to whomever wrote avrdude. What a cool piece of code!

Four legs good, two legs bad, three legs stable.

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

John_A_Brown wrote:
Well it seems that I can do pretty much everything I want by using avrdude with my AVRISP.
Great, that means I can ditch Studio completely!
Many thanks to whomever wrote avrdude. What a cool piece of code!

Here are the authors:
http://savannah.nongnu.org/project/memberlist.php?group=avrdude
Brian Dean is the original author. He occasionaly posts here on AVR Freaks and I know he advertises his MAVRIC boards here.

Also, FYI, avrdude is known to run on Windows, Linux, FreeBSD, and Mac OS X. And you can add both new programmers and new devices to a configuration file, and not have to rebuild the software.

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

I havn't followed this forum for some days. So I'm a little late with this comment.

In this thread, many subjects has been discussed, but I will add to this long list of replies, as the subject of driving MOSFET's concerns many, and the statements could be more precise with respect to two things.

abcminiuser raised a lot of discussion on his link, and Anders And and others made many good comments, including MaxK with the formula on voltage over the coill.

MaxK wrote:
8)

Im surpriced how unskilled people who are confident they know right, but actually do it wrong.... This is sad.

That the webpage writer said 100 ohm on the gate is required, really caused me to laugh. :lol:

Let me warn all new comers to the microcontroller scene:
Being able to write assembler, or C, or basica, and then get it to run on a microcontroller is only a very TINY part of the whole product!

Power supply design is probably the easiest to get working, and equally the hardest to get done propperly!! Just using 7805 with 4700u decoupling caps is rather amusing at best. :roll:

Using transistors and (mos)fets requires atleast a class about analog electronics. Just foobaring with grabbing resistors is ok if you dont want to engineer. A true engineer knows what its circuit will do, and can do, and wont do. Not knowing a coil/inductor builds up a magnetic field, which will try to counter efect any change it finds, is just a lack of knowledge... That relay will give a desastrous strong counter EMF when switched of quickly. Ul = di/dt * L .. Lets assume that relay has a self inductance of 22mH draws 50mA, and the turn of time of that mosfet is 1uS

-50mA / 1uS * 22mH = -1100 volt peak.

OUCH said the mosfet, who had a burned chanel.

:wink:

I fully agree on the difficulty of making good power supplies, especially switch mode power supplies. For a relative simple circuit a lot of small questions pop up when the PCB is designed. Simply ignoring them will not result in the reliable power supply I am aiming for.

Regarding the switching of FET's I have two things to add.

1. The gate resistor controls the switch time, and thus switching power loss and EMC. The FET itself does not need the resistor, but what about the driver ?
If the gate is charged to 15 volts, and the drive circuit has a max. current of eg. 1 amp, and the total gate circuit resistance is 2 ohms, then a resistor is needed to avoid compromising the reliability of the driver by exeeding the max current..

A mega8 has an absolute maximum rating of 40mA DC per pin. If the mega with 5 volt supply has a port pin directly conected to a FET equivalent to a capacitor of say 1nF, the initial current is dependant of the circuit resistance. If we assume 0 ohms outside the mega, then we get a clue about themax initial discharge current watching the curve under "Pin driver strength" . When we switch the gate from 5V to 0 volts, from this curve it can be seen that the 40mA is exeeded. I did not find data for dynamic peak current capability, but for the sake of reliability I would place a resistor limiting the current to less than 40mA. If you need the speed, a driver from Microchip (there it was again) TC4420 is cheap and capable of max 6A gate current without using a gate resistor.

2. I agree in the formula, but not in the current assumption. When the FET turns off, we have an "open" curcuit, and thus no current flowing. It is basical a coil discharging its energy into the connected curcuit. If the current is zero the voltage is infinite.

However the practical circuit is not "open", as we have stray capacitance. Depending on the actual curcuit "component" values (not restricted to the simple relay driver) it may not be the FET that determines the di/dt.

The voltage across the coil will continue to rise until a spark is formed or a semiconductor starts conducting (destructive or non destructive), or stray capacitance has received the magnetic energy as electrostatic energy with reduction for ohmic loss and EMC.

mneary wrote:
Back to MOSFETs for a minute.. :) Too much generalization; not all parts are the same. With so much variation in symbols, we have to look elsewhere for guidance.

Some MOSFETs have an avalanche current and energy rating. I infer from this that they have a useful Zener diode inside, subject to those limitations. See IRF540.

Other MOSFETs do NOT have an avalanche spec. Of course the diode inside will break down with enough voltage. If the data sheet doesn't give avalanche specs, stressing the part to breakdown is NOT a good thing to do.

I fully agree, again from a reliability view, don't exploit component properties not specified. And don't stress power components to the specified limit, if you want many years of reliable operation.

Erik

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

AndersAnd wrote:

You could just buy ATtiny13 instead of ATtiny11. ATtiny13 has many of the features that ATtiny11 lacks, but it's still cheaper than PIC12F629 and PIC12F675.

Can you? AVRFeaks device area still says "limitted sampling." :-)

I was aware that some of the other AVR 8-pin devices fix all or most of the problems that I listed for the tiny11. However, they move into the 'slightly cheaper than a PIC'
realm, rather than being "dramatically cheaper" (although I thought the tiny13 price was higher than it seems to be, so that's good...)

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

DigiKey now has stock on several flavours, priced ~US$0.75/100. What would the price be on the comparable PIC? [I wouldn't know which PIC(s) would be closest.]

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

westfw wrote:

Can you? AVRFeaks device area still says "limitted sampling." :-)

DigiKey has a couple of thousand. I talked to a distributor yesterday and he said that he hadn't heard of any supply problems, and that 10k lots would have about an 8 week lead time, which isn't unusual in my experience.

Joe

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

theusch wrote:
DigiKey now has stock, priced ~US$0.75/100.
What would the price be on the comparable PIC?
[I wouldn't know which PIC(s) would be closest.]

Well, that gets to be a tricky question. The closest PIC to the tiny13 (EEPROM, A-D, etc)
is probably the 12f675 at about $1.25 (100), BUT we got here by saying "what's the
cheapest avr like the tiny11 without the annoyances of the 11 (in particular, the
uncalibrated clock.)" That would put it up against the PIC12F508 at about $0.85
(but there's no eeprom and no analog stuff.)

The tiny13 looks to be a really interesting part, though...

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

westfw wrote:
theusch wrote:
DigiKey now has stock, priced ~US$0.75/100.
What would the price be on the comparable PIC?
[I wouldn't know which PIC(s) would be closest.]

Well, that gets to be a tricky question. The closest PIC to the tiny13 (EEPROM, A-D, etc)
is probably the 12f675 at about $1.25 (100), BUT we got here by saying "what's the
cheapest avr like the tiny11 without the annoyances of the 11 (in particular, the
uncalibrated clock.)" That would put it up against the PIC12F508 at about $0.85
(but there's no eeprom and no analog stuff.)

The tiny13 looks to be a really interesting part, though...


The Digikey price for PIC12F508 is $1.40 which is still more expesive tha ATtiny13 ($1.29).

The reason why I metioned ATtiny13 in the first place was because someone mentioned a lot of drawbacks for ATtiny11 compared to PIC12Fxxx.
Then I took ATtiny13 as example and compared it to PIC12Fxxx, because ATtiny13 does ot have all the drawbacks that ATtiny11 has compared to PIC12Fxxx.
But both ATtiny13 and ATtiny11 are still cheaper than all the PIC12Fxxx devices.
So if the cheap ATtiny11 has too may drawbacks compared to PIC12Fxxx, then you could use ATtiny13 (with ADC, EEPROM etc.) and still get a cheaper device than the cheapet PIC12Fxxx without ADC and EEPROM.

The only PIC Flash MCUs that are cheaper than ATtiny13 is the PIC10F20x series. But PIC10F20x devices has a very small amout of Flash, on iteral EEPROM and only 4 I/O pins.

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

sxpilot450 wrote:
Atmel doesn't have to do anything Glitch.

I think he was saying that Amtel should do it first so that everyone else can use that as a standard. Otherwise all the .hex files will be different for each compiler, and each programming software will require the .hex from a specific compiler.

Or maybe I'm the one missing the point. :)

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

NogginGTS wrote:
Or maybe I'm the one missing the point. :)

Nope, you didn't miss the point. :)

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

AndersAnd wrote:

The Digikey price for PIC12F508 is $1.40 which is still more expesive tha ATtiny13 ($1.29).

The reason why I metioned ATtiny13 in the first place was because someone mentioned
a lot of drawbacks for ATtiny11 compared to PIC12Fxxx

Yeah, that was me. Perhaps you missed the following message where I mentioned
the difference between DRAMATICALY cheaper ($0.40 vs $1.40) and slightly cheaper
($1.29 vs 1.40) Pay attention to quantity when comparing prices, especially at digikey
where price premiums for small quantities can dissappear at quantity levels as low as 25.

A dramatically cheaper part (tiny11) is interesting enough to get people to switch architectures,
within the limitations of the part in question. Slighly cheaper only puts a chip on your radar
screen (especially since at the volumes where a $0.50 parts cost makes a big difference, prices
tend to be very 'negotiable' anyway. Even for a hobbyist, the difference in cost can be
dwarfed by other issues (like shipping charges...)

BillW
i

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

Quote:
Even for a hobbyist, the difference in cost can be
dwarfed by other issues (like shipping charges...)

Or the cost of development tools.
Which is enough to make a larger chip that supports jtag cheaper to use than a tiny
chip which needs an expensive ice to debug with. (for a hobby application anyway).

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

kscharf wrote:
Quote:
Even for a hobbyist, the difference in cost can be
dwarfed by other issues (like shipping charges...)

Or the cost of development tools.
Which is enough to make a larger chip that supports jtag cheaper to use than a tiny
chip which needs an expensive ice to debug with. (for a hobby application anyway).


For hobby use, it could often be cheaper to buy only one or a few types of AVRs and then buy 10 or 25 of this type instead of buying a differet AVR for each project.
Instead of for example buying 3 ATtiny2313, 3 ATmega48 and 4 ATmega88, it might be cheaper to get a discout by buying 10 ATmega88 and use it for all the projects instead.

Or use a larger ATmega with JTAG like ATmega16 for example.

You could also use a large AVR with JTAG for development and the move it to a smaller AVR when the application is almost finished. This porting is easier if you use C instead of assembely. But remeber to check timers, uart etc. available i the small device before you use these pheriherals on the big AVR for developmet.

But I agree, the price of the device is not that important for hobby projects. The price of developmets tools and kits are much more important. Ease of use is also more important.

A plus for Microchip vs. Atmel is that it's much easier to obtain free samples from Microchip than Atmel.