Embedded - 15: Robot on the Front
Episode Date: August 21, 2013Andreas Eieland (@AndreasMCUguy) from Atmel joined Elecia to talk about how the AVR processor line came to life, why there is an AVR in Arduino, and the spirit of making things. Arduino AVR Freaks Atm...el’s AVR home OpenCores AVR FPGA implementation Elecia’s new dev kit is a SAM D20 Xplained Pro
Transcript
Discussion (0)
Welcome to Making Embedded Systems, the show for people who love gadgets.
I am Alicia White, and my co-host today is Andreas Eiland from Atmel to talk about making microcontrollers.
Hi, Andreas. Welcome to the show.
Hi, Alicia. Thanks for having me.
Before we dive in, what is your background?
So, my background is I have a master's degree in engineering cybernetics,
which basically is a way of saying robotics with more maths and physics.
Fresh out of university, I started working for Atmel as an application engineer,
basically solving people's problems, which is really good.
And then at one point, I guess they found out I was better at talking than writing C code.
So they moved me to the marketing group.
And eight and a half years later, I'm still with Atmel.
But now I'm in San Jose and running some of our Flash microcontroller product lines.
You said you wanted to talk a bit about how Atmel made a microcontroller
as opposed to a system using a microcontroller.
What did you mean by that?
So the maker movement today is big.
People are talking like the maker movement.
People want to make things.
And I think it's funny because it's the same reason why Alf and Vegard,
the inventors of the AVR, it's the same reason why they made the AVR.
They looked at all the micros that was out there, H11, C51s,
and said, you know what?
I want to make a microcontroller that's different to all the other systems
I want to make my own micro
that solves some of the shortcomings we're seeing
with the other micros that were out there
in the early 90s
So shortcomings like you had to program it
in assembly and
everything at that time
even Atmel had an 8051 at that time
Oh, we still have an 8051 actually
So yeah, you had to program it in assembly hardly any vendors Everything at that time. Even Atmel had an 8051 at that time. Oh, we still have an 8051 actually.
So yeah, you had to program it in assembly.
Hardly any vendors did Flash.
You had the light programmable little window.
You had to put the tape piece over.
The instruction set was not made for C or other high-level languages. So if you tried to compile for it, your code just bloated.
Well, we were going to talk a little bit about RISC versus CISC,
reduced instruction set versus complex instruction set.
And that's one of those differences, because to make a C compiler,
you kind of need to not have every single instruction available.
Yeah, so it's kind of a trade-off, right?
You have the complex instruction sets, where your main target is to have as few instructions as possible to make assembly writing code easier so you have
a few amount of instructions but each instruction might take multiple clock cycles like on on
original 8051 architecture and multiplies 48 cycles so basically you start one instruction
it's basically a state machine running in the background, right?
A reduced instruction set, it's important to remember it's not the amount of instructions that's reduced,
but it's the complexity of the instructions.
So instead of having a few instructions that does a lot,
you have a lot of instructions that does very little.
The advantage of this is you optimize it for a single cycle.
So if you look at an AVR, which is a risk architecture, The advantage of this is you optimize it for a single cycle.
So if you look at an AVR, which is a risk architecture,
you'll see that almost all the operations are one clock cycle.
The only things that deviate from that is basically if you need to make a super long jump,
or if you operate on 16-byte variables in an 8-bit system.
So it really doesn't have much to do with the compiler at all. It's about how many clock cycles
everything takes. Yeah, that's part of it.
And also it optimizes
the risk set, at least in
smaller systems, and the newer arms
use those as well, actually. But it
optimizes the clock cycles, it allows you to do some
pipelining, and it's really what
enabled the single cycle execution
on the AVR, which is
what you call a two
address architecture.
So basically you read from two locations, execute, and you overwrite one of the two
locations you came from.
But the upside of this is, or not say, the upside for a compiler on this risk set is
you have to have a lot of different instructions.
But that also allows the compiler to optimize,
to select the best instruction for all the different things they're doing.
And the AVR instruction set, I don't know if everyone knows this,
but it was actually developed together with IAR.
So several iterations between Atmel and IAR to agree on the instruction set.
And IAR is one of the really popular compilers and
IDEs.
Yeah. And they charge a premium for a compiler
compared to other compilers. Yes, they do.
But if you
have a big project, you'll
see code efficiency.
There's a reason why they charge for it.
Yes. And it isn't...
While the AVR may have been
developed with IAR, the compiler,
that isn't the only compiler it works with.
I mean, GCC works just fine.
Yeah, GCC works fine, CodeVision, ImageCraft.
There's like Kyle, there's tons of them out there.
And any of them that want to sponsor the podcast are welcome to.
Oh, I'm sorry.
Well, a fun thing there is like many GCC and Linux ports
are kind of maintained on a student basis.
You go to a student fraternity and you say to people
here's Coke and pizza, make a Linux port for our product.
Oh, very much, yes.
But on the GCC side, we're actually actively involved ourselves from Atmel
to ensure that we have support for new devices that's coming out, that linkers work, that integration with our tools works. We actually contribute to the
open source environment as well on that side. I do know that Atmel is pretty into the open source
environment. You're an Arduino, one of the really, really big open source projects. How did that happen?
So the reason why we're into open source comes from an attitude we have inside Atmo.
We're here to sell silicon, to sell microcontrollers.
We're not here to sell tools.
We're not here to sell software.
So all of software we give away, and the tools we more or less sell for a bill of materials
like an in-circuit debugger is 199 dollars the way we got into arduino was through a lucky backdoor
they must have moved the team in italy actually started with a different mcu vendor but it was
all the time it was meant to be an educational project. But they had so many problems getting everything to work.
So they discarded their original supplier and tried AVR
because they heard that was the easiest microcontroller to use.
And that's the start of it.
So we didn't have anything to do with it in the beginning.
But of course, now we're super happy to be a part of the Arduino community.
We work tightly with those guys.
And actually, in September, we'll be at the Maker Faire in New York.
You can meet me there.
And I'll be in the Arduino tent pushing Atmel and how we do things.
It's really a coup to have the best first place to start is an Atmega.
It's interesting that it happened organically do you think that i remember at the time there was the avr freaks and that was it was a non-atmel
site right in the beginning well it still is a non-atmel site and it was started actually by
some students in throndheim and But quickly it gained so much interest.
And in Trondheim in Norway, there's a big Atmel Design Center.
And we hire lots of people from the university there.
And it ended up being so big that we sponsored their server park
and placed it in our server park just to make it possible for them to maintain it.
And so that's why you see if you go check the IP addresses,
it says Atmel Norway normally.
But AVR Freaks is a website and it is for people who well frankly are avr freaks they are super super excited about atmel processors the whole avr line from the tinies to the big ones
and they provide a giant community that you can get all sorts of questions asked at.
Do you think that having this, I mean, beloved community
fed into being able to get into Arduino?
Well, we hope so, at least.
And I like AVR Freaks.
It can be kind of a tough environment sometimes,
especially if you ask a question that's been answered 20 times before.
Which C compiler should I use? Or one of the standard problems that's been used on
universities around, you know, when the term papers are in, because you start seeing the
same questions every year coming into the forum. Yeah, we think it's a part of it. And I think the
biggest upside for us with AVR Freaks was that people had a place to meet
and discuss their projects. And also with all these people discussing and sharing stuff, we
got a very big base of open source code that people could utilize.
And the people can look at and say, well, I need to make my own PWM controller. How did someone
else do it? And there are a hundred examples out there.
It makes, I mean, the do-it-yourself excitement,
the whole maker spirit and the AVR freaks came out at a similar time.
It wasn't just Make Magazine,
although that kind of fed into it too.
When it arrived, it certainly found AVR freaks pretty quickly.
How do you achieve that level of love from your users?
So I think it's several things, or I hope it's several things at least.
First of all, I think one of the successes on AVR Freaks is we never tried to censor it.
If people said, for this project, you really should use an AVR,
there's a microchip device that has a PWM that's perfect for you.
We didn't go in and delete that post, right?
Well, it wasn't hosted by you.
You didn't own the stuff.
Exactly.
We also didn't go in and challenge it, right?
We let it more or less be and grow.
But why users turn into fans and freaks,
I think it's because the AVR really is easy to use.
It's one of the pillars.
It's in-circuit programmable, cheap debuggers.
You can get started really quickly.
If you sit down and want to make a LED blink,
it's literally eight to nine lines of code,
and you're up and running.
And I think people, at least I hope people, are fans
because they realize when they use an AVR,
their projects are successful.
And if you have that experience once,
you're likely to continue with the same product.
I think one of the other reasons from my personal experience
is small companies in Atmel.
For so long, if you worked at a company
that was two people or six people,
getting the attention of a processor vendor was a non-starter. And with the dev kits and ISIS and JTAGs that cost thousands
of dollars, having a startup was impossible. But at Mel, even when we were like, yeah, we think we
might sell 2,000 of these a year.
Can you talk to us about masked ROMs?
Your people were fantastic about that.
No, it's good to hear.
Yeah, we try to not discriminate anyone.
If you send us an email, we do our best to answer.
And now we're actually not only doing it on email, but we're even starting getting tech
support questions on our Facebook pages and on our Twitter feed.
So the biggest challenge is writing a tech support answer in 140 signs.
It's hard sometimes.
Write it in assembly. It'll be shorter.
And you've told me off-air that Atmel has its own maker spirit, engineering spirit. What's it like to work
there?
So I think it's good fun. Well, what I'm doing now in marketing the last four or five years
is different from being in the applications group where I started. But in the applications
group, which is where people develop code and write code for customers, it's where you
have the really fun spirit there's
electronics spread around right you're there someone's watching the coffee cup to make sure that the pot is almost ready people are hacking people are building there was someone built a big
led cube a couple years ago and it's the it sounds like a cliche but it's the work hard play hard
thing but it really is fun and i get to work with some really cliche, but it's the work hard, play hard thing.
But it really is fun.
And I get to work with some really exciting customers,
whether it's a small startup that has a unique idea,
and you come in and you kind of brainstorm together on how they can solve it,
which is really fun.
But I have to say it's really like humbling and really good experience when you go up to visiting some of the big companies here in the Bay Area
or in Europe and Asia and see what they're doing
and what they're thinking the next two to three years ahead.
So we actually, I'm getting all off topic and stuff.
I wanted to talk about how do you design a processor?
You know, how did AVR happen?
Okay, so AVR happened as a master's thesis actually
at the university in trondheim where someone wanted to build an asic more or less that was
made for television control actually and the clock problem there is every time you clock you can get
a glitch on the television signal so how'd they make a processor that could use as few clock cycles
as possible to do it?
So that's kind of where they started the,
okay, let's build a Harvard architecture RISC
to get the clock frequency down.
And they started working on this
and they worked for an ASIC company first
after finishing it and refining the processor.
And at one point they said,
you know what?
We think this is more than an ASIC core. we can bring this out as a general purpose micro so what do we need to do then and they knew
they have to be excellent support for c which is why we had the ir discussion we already talked
about they also knew that for the future people are not going to stick with rom and light programmable options anymore so at this
time there was two companies doing good flash one japanese and atmel in the bay area and since they
spoke much better english than japanese they made a bid for san francisco first and flew over here
and they walked in to to atmel with this is the day of foils so a lot of printed foils for the overhead
machine and basically get told you have 15 minutes i have 10 guys like you a week coming in here
so they flipped the entire pile over just took the last slide that said 100 million units that's
what we'll sell in five years oh that would be very attractive. Yeah, and then they started from that.
And what they did is part of the deal was to develop it in Norway.
So they hired some of the smartest people they knew
and they started from the CPU out,
just getting the flash block,
building the peripherals.
And you can look at it as it's a twofold exercise.
First, you have to design all the modules,
which is very similar to writing modular code for any application and then you have the back end side of it the layout
which is like three-dimensional tetris where you have to have the colors matched as well for noise
reasons and that that's true asic processor design yeah well asic or mcu it's the same
you develop it is really not a big difference and so i guess i didn't realize atmel only did flash before this but they did we did 8050 once
yeah so atmel originally was a memory company and they started doing flash based 8050 once
and then since the last 17 years we've also been been doing ARM cores. Yes, I've used some of your ARM cores.
So, wow.
So two guys from college came and pitched to Atmel and said,
you know, we can make you a better processor and we promise we'll sell a whole bunch.
And it happened.
It happened.
That's kind of the startup story that we all want to hear.
Yeah.
So you say microcontroller and I sometimes say microprocessor.
What is the difference?
So the way I define the difference, at least, is in a microcontroller,
it's a system on a chip including everything, the flash, the SRAM, everything.
And for me, a microprocessor starts at the point where you have to have your memory external.
Like you have to have an external flash, for instance. So we don't do a lot of microprocessor starts at the point where you have to have your memory external like you have to have an external flash for instance so we don't do a lot of microprocessors anymore
well most arm 9s uh cortex a5s etc they are microprocessors nobody cares about them those
are real like computers yeah they can run full linux if you want and everything on them i know
that you mentioned it that's kind of my definition too, is a microprocessor is self-contained
and a microcontroller contains a processor.
But, you know, I don't think there's anyone on the AVR Freaks
who are going to slap you around for that question.
So the processor is Harvard architecture.
I looked at the Wikipedia page,
and then I looked at what Harvard architecture was,
which is that data and instructions are separate.
And that's different than von Neumann architecture,
where they're in the same memory bucket.
And to programmers, it matters not at all.
Why do processors, developers care so much about whether it's Harvard or Von Neumann
and it seems like they battle it out. Well, I'm a Harvard
architecture fan. I grew up with AVR Freaks so I'm kind of biased
here. But the benefit of a Harvard is you can do two things
at once. You don't have to wait for the instruction
to load
before you can fetch your data you can fetch instructions and data in parallel and write it
back so it's really what enables the one clock cycle on an avr versus the four clock cycles on
an 8051 or a pic and another thing with the avr cpus you have instead of having a single accumulator engine, you actually have 32 registers
that are directly connected to the ALU inside the core. And the easy way to think of this is that a
single accumulator, that's a one lane country road, whereas the 32 direct accessed registers
is the 32 lane highway. You don't have to move your volatile variables around all the time.
You can operate directly on them in the registers.
All right.
All right.
That seems far more efficient.
Yeah.
So if you do, well, it's kind of a detailed exercise,
but if you write a short program in C,
you compile it for an 8051 and you compile it for an AVR,
you'll see there's hardly any move instructions
in the AVR
disassembly view if you look into the assembly code. And move instructions are pointless. I mean,
to me, when I think about, you know, how would I do it if I was a processor? I never move things
from one finger to another. Exactly. It's a wasted clock cycle. So for efficiency, it matters.
But there are DSPs as well when you're talking about efficiency and math.
Yeah.
How is the AVR different and similar to those?
So in some ways it's similar.
So we fight, when I look at sockets at customers, we often fight with the MSP430 from TI, which is a 16-bit DSP or DSP slash microcontroller.
Definitely slash.
So I think a DSP has a lot of more added,
more complex instructions to support
the signal processing part of it.
The FFTs.
The FFT, basically.
And also many of them have good division instructions.
Really?
Which ones have good division instructions?
I don't think I've found those yet.
Better than having to write your own routine.
I have done that.
Yeah.
Okay, so you compete some with the MSP430s
and the PIC processors.
PICs mostly are still programmed in assembly, right?
I mean, there's this C thing,
but it's still half assembly, it feels like.
Yeah, I've never written code for Microchip.
That makes sense.
You work for Atmel.
No, they do both,
but it's for sure if you're looking at,
if you're close to your border, right,
you might end up selecting a slightly larger flash device
if you want to do the same on a PIC.
But that being said, I have to say, it's an interesting thing that's happening in the market now because a lot of companies are kind of abandoning the 8-bit market and really seeing
that us at atmel and microchip are two of very few companies that continue to to push r and d
and to want to grow in 8-bit well st, STM makes an 8-bit processor too.
Is that kind of dead?
Well, I'm not from ST, so I can't comment,
but at least how I see it, they're all Cortex-M0.
But you are continuing development on 8-bit processors.
Yeah.
We're actually, yeah, both 8051 and AVR, we're continuing development.
Why?
Well, 8051 is really easy.
It's almost no one else does it anymore.
So if competitor B end of lives an 8051 product,
we'll make a new product that has the same features and the same pinout and say,
if you leave money on the table, I'll be more than happy to pick up these sockets.
So that's kind of our 8051 strategy.
We have the IP, we have the FAB, why shouldn't we do it?
Well, I'm a little unclear as to why someone wanting to use an 8051
wouldn't just make their own darn chip,
because that IP is pretty available at this point.
It's not like you have to pay ARM a bazillion dollars
just to see their licensing documentation.
No, but it's just like you talked about the 2,000 units per year customer
or even the 200,000 unit per year customer.
They won't build their own ASIC.
They'll buy a flash-based 8051 and they'll solve it.
And there's a lot of those customers out there.
But you also work with 8051 customers
who do want to mask their ROMs
and make a bazillion of these puppies.
Yeah.
So we don't like leaving things out.
So we have the 8051s,
which we're doing this low-end development with.
And on the AVR, we're putting a lot of development in.
We're actually launching some new tiny AVRs this autumn.
There'll be some new 14-pin devices that you'll see.
And we're planning to launch some new 32-pin Mega AVRs
into the new year.
So you'll still see R&D from us in these regions.
Why, I mean, Cortex-M0s, Cortex-M3s,
they're cheap, they're easy, they're ubiquitous.
If I was starting a new project,
why would I look at the AT-Tinies?
So there's a huge difference between 8-bit and 32-bit in regards to market. Yes, there is a
relatively big overlap area on the high-end 8-bit, 16-bit side versus Cortex M0 and M0+.
But still for smaller applications, it's still going to be easier and faster to develop
a small app on an 8-bit than on a 32-bit. And also there's inherently there's things on an 8-bit
that's going to be beneficial to you. If your device, let's say it's your garage door opener,
you press the button four times a day perhaps, so 99.99999% of the time it's in sleep mode right and since there's fewer gates to
implement an 8-bit people select bigger processes older processes whereas for 32-bit you go more
aggressive on the process the upside of going aggressive on the process is you can build a
cheaper micro with more gates you mean the fabrication process the
fabrication process okay yeah and but for most 8-bit people stay with the older processors
which means on an avr you have 100 nano amps with full ram retention if you go to the say that again
i'm sorry you're gonna have to break that all into little words for me so at an avr tiny tiny AVR, mega AVR, AVR X mega, you are at around 100 nanoamps with all your RAM
contained and your registers and latches contained. So nanoamps, and that's kind of when the processor
is sleeping. Yeah. Sleeping, doing nothing, but remembering what it was doing before it went to
sleep. That's kind of cool. Usually I think about microamps when I'm sleeping my processor. Yeah, and that's an ultra low power 32-bit is one to one and a half microamp.
Yeah.
So it's 10 to 15x.
And if this is the remote control for your TV, garage door,
battery life in sleep mode is important.
Battery life in sleep mode is important in lots of things.
I mean, we're getting all these pocket devices that just hang out in your pocket.
And when they die, you have to charge them. But but come on am i not the first person to wash them
yeah and that's sort of the 8 bits are cheaper too aren't they yeah in many cases it depends
kind of it's a it's kind of a curve in flash density so an m0 m0 plus will often be cheaper
for 128 and 256k memory densities.
But if you're talking the tiny AVR range, yes, 8-bit is cheaper than the 32-bit.
So you said garage door openers and remote controls, that makes sense.
What other applications am I looking at for tiny AVRs, the very smallest?
So one application that we sold a couple of years ago that I really like was actually pregnancy testers, the small pregnancy tester strips.
You put two lines or one line or green lines or blue lines.
I guess it's the little LCD controller part of it.
No, it was a very simple one.
And the good thing is there's several good things.
You press the button, it does one A to D conversion. That's the only thing it does in its lifetime and it's thrown away and people will buy a new one. So from a marketing point of view,
it's great. People buy a lot. Consumables. Consumables are where the cash are. The other
nice thing about the pregnancy testers is it doesn't matter which one you win because someone
that's want to be pregnant or afraid they're pregnant they'll buy every single brand and try them all so you're kind of
guaranteed to have your sales um so that's that's kind of one extreme that and the electric racers
but we have applications all the way up to there's actually a mega avr going to the international
space station next summer to do 3d printing. That's going to be pretty cool.
Wow.
3D printing is kind of a big application.
Tell me more about that.
Yeah, especially in space.
Like if they had a 3D printer on Apollo 13,
there would be no movie.
They'd just print the replacement part for their air filter, right?
But the biggest, I would say, upside of
if they can really get 3d printing to work in space
is you don't have to launch everything from earth anymore you can try it with a 3d printer on the
moon and print with the materials you have up there well and even shipping a brick of materials
is easier than shipping a brick with a bunch of holes in it that is called like a device yeah
yeah you don't have to ship one of every spare part instead you ship a brick of holes in it that is called like a device yeah yeah you don't have to ship one of
every spare part instead you ship a brick of material so but i also think i think it's funny
to talk about the space side because it's the last one which is cool but i think 3d printing is
i really like that it's it's catching on i was inches away from buying a MakerBot 2X last summer myself.
But you get to try again in New York.
I get to try again.
But I really like the idea of democratizing manufacturing.
And also I like the idea that I can make my own replacement parts.
Like if I break a hinge somewhere, I can print a replacement for it.
If I need something for my small sailboat, I can make my own little brackets.
So I really of like,
I really enjoy the thought of a 3D printer.
Just have to convince my wife.
I think that's the final obstacle,
the one inch hurdle I need to break through.
That's the true final frontier.
And inside the space 3D printer,
there is an Atmel processor.
And did Atmel participate in this?
No, we were, again,
we were lucky with the open source environment.
Don't say lucky,
it's nurtured through our open source participation.
So they started with a MakerBot,
which uses an AVR.
And MakerBot started with an Arduino that uses an AVR.
Oh, this is grandchildren working out for you.
Exactly.
So the Arduino is great to get started.
It's great for hobbyists.
But the real upside for us is that people start there
and then they start writing their own code
and making their own PCBs, right?
So it's kind of the first two or three steps that they use.
Well, that's why I really like the Arduino is that people use it.
I mean, there was the woman who told me all about the robot she built with her kids using an Arduino and how cool it was.
That's cool.
And then she asked me what I did.
And I said, I make embedded systems, figuring that was enough because she clearly understands.
And then she asked me
what embedded systems were okay and i was like yeah okay you already know you just don't know
you know um so yeah arduino is so cool because so many people are using it and then they get
hooked yeah i think it's i think it's really funny that you see other people adapting it as well. So even some new development
cards from Cypress have support for
the shields for Arduino.
So it's really starting to be not
only an open source company, but
an open source and cross company
platform that people
are using.
Yeah, and that makes sense.
They're essentially trying to horn in on the community,
which is fine. I mean, I want essentially trying to horn in on the community, which is fine.
I mean, I want lots of options.
As a consumer, it's great.
The more people that contribute to an open environment,
the better, right?
So is Atmel going to open source their processors soon?
Well, so it was launched in 96.
I guess the patent is 20 years, right?
So it's a couple of years away.
No, but the thing is,
if you really like processor design,
there actually is, if you go to OpenCourse,
I don't remember if it's opencourse.com or.org,
if you go to one of them,
there actually is an FPGA implementation
of the AVR instruction set already,
as well as the 8051 and many other ones.
So they're not gate optimized and clock synchronized,
but if you want to look into
details on how a CPU
is made, how an ALU is made, there's
some good resources there. That will be
in the show notes. There will be a link, I promise.
Okay, thank you.
I'll be the marketing guy that
led people to someone that reversed engineer
on core. That's going to be...
How could that possibly go wrong?
Yeah, I don't know.
Don't use it for your ASIC.
Well, and Arduino,
I mean, I'm going to come back to that one more time.
You have people
who are using it that are
younger than the processor
is.
How do you feel about that?
Yeah, so we had kind of a employee event at Atmel where
employees can bring their kids in to like this is what mommy and daddy does and we had some visitors
including super awesome Sylvia which I don't know is 12 13 years old she was there with her embedded systems i'm like how did you do this and yeah it's really
it's really fun and i actually oh i want to tell you something funny it's kind of a sidestep from
this but it goes to the avr and our avr freaks and the open community side of it so one of the
application engineers that work in norway we headhunted him through avr freaks because he
wrote so good open source code turned out he was living in australia but still we headhunted him through AVR Freaks because he wrote so good open source code.
Turned out he was living in Australia, but still we headhunted him and moved him to Norway and he
still works there writing code. Well, that's when people say, I don't have a job. I often say
open source because it is a great way to build a portfolio and to get headhunted. I mean,
if you love something and you're willing to do it on your free time
and they find out they love you too, it's like, you know, the job marriage made in heaven.
Yeah.
But I think it's really good fun and we enjoy the Maker Faire.
We have some small toys that we have reversed engineers ourselves that people can play with.
And you really see kids want to build like they want
to build lego when they're smaller and everyone enjoys seeing a blinking led for the first time
right and they they get that same feeling with arduino to actually this is working i actually
made this computer work it's beyond computer it's it's i totally agree i love that feeling
it's it's not just i wrote the code
because some of these kids and when i work with teaching programming to little kids it's it's not
just the website the website's cool they understand that it's computer you push the button and it
uploads and it does whatever you told it to do but uh but when they see the light blink or when
they see the motor move it's the world they're changing.
It's not just the computer.
The computer changes all the time.
This is the world.
I love that feeling.
I love seeing that feeling in other people.
So you'll see the same feeling actually with us at Atmel
because making an LED blink or an IOPIN toggle
is one of the first things we do when you have a new product out of the fab. And it's like, okay, let's open the beers. But for us, it means like
the programming interface works, the SRAM works, the core works, the bus works, and the IO pin
works. So it's the same for us. When we get that LED to blink, we know that the majority of this
system is working. We can talk to it and it listens.
And then you can debug it.
I mean, as soon as the LED blinks, you can debug a system.
You don't need I2C, you don't need SPI, you don't need DMA.
As long as you can compile something, load it,
and then find out if it works by turning on the LED,
you can test all that other stuff.
That's all details. It's a really powerful debug interface
to have a handful of LEDs you can code some output to.
Oh, yeah.
I do that a lot with state machines.
If you've got a big state machine,
it's a good way to see where you are in the state machine
without having to interrupt it or make big timing changes.
One of the reasons that the Arduino is cool,
I said I wouldn't come up to that,
but I can't help myself,
is that it is a processor that I would use in production.
And that's really cool,
is that it didn't turn out just to be for education alone.
It gives a platform that lets you learn enough
and then lets you start shipping product with this processor
it's just amazing uh but it's it's not one of your cheaper processors no so the uh the the basic
arduino uses the mega 328 which is a 32k 32 pin really popular micro by the way if you take
if you go to your studio here and break everything
with a hammer, I'm pretty sure we'll find the Mega 328.
But yeah, millions of them that we've shipped over the years.
The Arduino Duo uses a SAM3X, which is an even more expensive processor.
That's an ARM-based.
That's ARM-based, yeah.
Cortex-M3.
But the beauty of the AVR is that all the CPUs are code compatible.
The instructions are the same.
So if you write a code on Arduino and you find out,
you know what, I'm only using a couple of kilobytes here,
you can go to a smaller pinout, smaller memory device,
and find something that's more cost optimized.
And your family is really thorough.
I mean, if I decide I want an ATtiny
and I have chosen the wrong RAM and ROM,
it goes up and down. I mean, I always try to choose my initial processor to be the
middle of the family so I can decide later which way I've gone wrong.
And that's a good strategy, actually. And we see the benefit of having both the pin and the memory
options is when you run out of code typically
people run out of sram actually they're stacked they get the stack overflow or they get the code
bloat because the marketing guy told them to add one more language to their lcd screen yeah the
additional font set is always what kills us and but so we used to see a lot of people switching
up in memories a couple of years ago.
But apparently, people have been burnt.
So now we're seeing people actually changing down in memories because they select a big processor to start, and then they go down.
And the beauty is with an Atmel AVR or even some of our new ARM processors,
it's fully compatible.
So switching from one product to the other,
it's basically just recompile, and's fully compatible. So switching from one product to the other, it's basically just
recompile and you're done.
Well, and I do like that and I should stop shilling for you. It's certainly a commercial here.
So what is the, if I could go down as far as I could get, what would be the cheapest processor
I could get?
So the cheapest one from us would be we have
a family called tiny avr which is our smaller avrs and there's a six pin family there which
has four family members and the smallest cheapest one is called the tiny four basically it's a 512
byte flash micro without a2d converter. And it's got some RAM,
but not a lot. Some RAM, yeah.
And also we have the bigger
brother, in brackets if you can call it that,
which is up to 1K of flash
and some more SRAM.
And that device actually has
A to D channels on
four out of six pins, which is pretty impressive.
That's kind of an
A to D with a little bit of
processing well there's a full cpu inside that's what when you read the data sheet it's like can
you fit this into a soft 23 package this would be a huge package 10 years ago and the um yeah i
think if you go to digi key i think they start at 30 cents or something but they're so small and
cheap you have to buy a reel of them that's the problem you need to buy 6 000 or something yeah yeah well i have a client who's
looking for a 19 cent processor and i'm just trying to figure out how to check that tiny four
five nine and ten all right all right so without giving anything away, any secret plans, what do you see happening in the future of AVR?
So I can share something that's happening.
I said we're launching a new 14-pin family of tiny AVRs.
We're launching some what I would call feature-improved mega-AVRs,
so compatible to the ones we have, but better oscillators,
better analog, some more io pins and
we're also with this we're also moving to more modern process geometries so it means like there's
this is not the end of the road right we're continuing to put avrs in new modern processes
what does that mean smaller Smaller gate sizes?
Yeah, smaller gate widths.
But normally we try to increase the length slightly of each transistor
as we go to new processes to keep the power consumption levels
where people expect them to be for an AVR.
Because if you didn't do that, the power consumption would go up.
Yeah, you'd see the leakage skyrocket.
Okay.
I should probably go back and ask
you all the questions about how to do
process design. Process
is a hard... We should have an ASIC
guy on. Yeah, don't ask me too detailed
questions there.
But it's
really fun and interesting
discussions at the early stage of a new product.
It's like, these
are the target markets, target applications we're trying to address with this new product. It's like, these are the target markets,
target applications we're trying to address with this new product family.
These are our requirements.
And the first level is,
how does this translate into the amount of timers,
the amount of I2Cs, flash size, et cetera.
But then at one point you get down to like,
okay, so what's the maximum leakage from each transistor?
And then you start doing the, the optimalization of the libraries of the transistors themselves,
selecting which process to use. So it's, there's a lot of people included to make a new product.
It's not the two person job anymore. No, sadly, sadly. sadly and and they're pretty specialized skills i mean
the asic designers sometimes they come from hardware sometimes they come from software
because it's a it's a really you don't wander in and out of that field no and especially on
on analog and on noise coupling for back end it really is a black art and the only way to learn
is experience basically yeah yeah there's no
university programs that says noise coupling in embedded design yeah not yet talk to us in a few
years i'm sure they'll come up with it what are you excited about uh in the future like the five
year big plan future so i had to think a bit about that so i'm really excited about it's a it's a buzzword it's kind of
boring to say but the internet of things i knew that was gonna come up but it's i don't like the
buzzword of it but i like the idea that because i'm an engineer i forget things that's kind of
where you're at and if i could just have a way as I
drive to work to open my app on my phone and says, yes, I disconnected the iron. Yes, I remember to
close the garage door. It would take some levels of stress out of my life. And that's one of the
big upsides I see about this connectivity stuff. Oh, I and and i that that little boarded sitting in front of
you is is the e-ink i got from matt a few weeks ago okay i know i'm electric imp that i got from
matt oh it's the one with the wi-fi connection on it and it's not just the wi-fi connection they do
the whole cloud server so writing your app doesn't mean you also have to run a server they have their
own server and your app connects to their server.
It's super easy.
Oh, cool. You need to show me that afterwards.
They are working on the Internet of Things,
and it looks neat from their perspective.
Yeah, and there's another side of the Internet of Things,
or the connectivity that I like, which is the environmental side of it.
They already have it deployed.
Some places, all the trash cans have a weight sensor inside them so the guy that does the trash round he
doesn't have to drive his big lorry around if the trash cans are half empty so you can optimize his
driving from when is the trash cans in the park 80 percent full that's when he drives out you can
also see if the trend in the trash can on way to changes
so it's filling up fast you can go out a couple of days earlier to avoid trash being thrown around
in the park so you have all these like green reducing waste side of internet of things as well
having the parking parking spot sensors so people stop circling around the block instead they know
there's no free parking spots for eight blocks. I'll just have to drive into the garage.
So there's a lot of environmental
savings of knowing
what things or knowing
the status of things you can't see.
The status of things you can't see.
I like that. Okay.
I agree that that's
going to be huge. It's still
hard though.
The marketing side of Internet of Things is also oversold at the moment.
Oh, yes.
Yes.
And they're going to have to come up with a new phrase because that's oversold and people
are going to stop believing it real soon.
I was at this free drinks arrangement with one of the analyst companies and they called
it the Internet of Everything.
That's cute, but...
I mean, I'm working on an internet-enabled LED,
which definitely falls in the Internet of Things,
but we're going to have to come up with a new phrase.
I think it's just going to be called connectivity in the end,
because it's basically what it is.
It's just...
We're using RF, and it's so cheap, what it is it's just you're using rf and
it's so cheap you can deploy it to areas that didn't have it before fair enough and we see
in athens a big future in it too because around christmas we acquired a wi-fi company
so we now actually have our own wi-fi chips as well so
hmm will at milk come out with an ATtiny with Wi-Fi?
You'll have a hard time running a TCP IP stack on the tiny AVR.
You'll have a hard time running any operating system on those.
Although I have heard that you can run embedded Linux on some 8-bit processors.
I don't know why you would, but you can.
Yeah, I think it's kind of an academic exercise that people are doing. You can even go to the embassy pages and see people have been running core marks for 32-bit processes on an AVR, right?
Just to see like, I can actually run this code, but the result is... Well, and at that point, if you're running this sort of code, you're not also running a very efficient power remote control.
You're checking boxes off for school.
Oh, well.
That would be a nice life to have,
but we probably should get back to work.
Is there anything you'd like to leave us with?
Yeah, I actually thought I'd leave you with some hardware.
Oh, excellent.
Because I know you like to hack.
So I brought one of our new development boards,
our newest one, actually.
So it's not for an AVR that we've discussed at length.
It's actually for one of our new Cortex M0 Plus families.
Well, get it out. Get it out.
I want to see it. I'll open it.
I don't know why you thought Patience was a strong suit.
I swear it isn't
i mean just because matt's is still on my desk doesn't mean that i haven't you know i'll let
you do the unboxing oh it's got the uh the robot on the front i like the robot packaging because
it's good except that there is not going to be a robot on the inside which makes me just a little
sad so a thing you might like about that one is actually if you have a USB cable laying around,
which I assume you have.
Well, you don't have to connect it now.
It's just, it has everything on it.
There's even an in-circuit emulator on it.
So you connect it, it acts like a JTAG, guys.
It mounts as a debugger and asks you,
do you want to do single stepping?
Do you want to debug?
Do you want to program?
And you're good to go.
Well, that's cool.
I mean, there are some other boards that are doing that.
So I'm glad you, I mean, even the Arduino does that.
Yeah, well, they use a bootloader to do it, right?
They don't have a debugger on board.
You can't go in and check,
oh, what are the bits in this register said to now?
Right.
Because at least in my experience,
the first time you write code,
it doesn't work as you planned.
Never.
That's why we blink the lights first.
Yeah.
So that board really doesn't have a lot on it because it's a general purpose product.
So instead, we brought almost all the IO pins
out on the headers.
So you can connect your own breadboards
or Vero boards or whatever.
And there are a lot of headers here.
So, I mean, probably all 32 pins may be brought out.
Yeah, all 64.
64, oh, wow.
Look, I can count.
Really, I can count.
You have to multiply by two, though, you know,
because it's a 2x header.
32 hertz crystal on the outside.
I bet there's an RTC inside.
Yeah, there's a RTC with clock and calendar, actually.
It even does leap year correction.
So you can actually wake up once every 10 years if you want.
Well, I don't think I'm going to use this for a time capsule.
I think I'll find something else to use it for.
Yeah.
Well, cool.
So this is SAMD20.
Yes.
And it's a family we just launched this summer.
So it's fresh out of the box.
So you said cortex and
zero plus plus oh plus i don't have a plus yet excellent excellent well uh thank you for
listening and thank you andreas for being here i'm happy you took the time to talk to me no problem
thanks for hosting alicia and thank you for your present i like that and thank you to
christopher white for producing if you have comments or questions for me or andreas send me
an email at show at making embedded systems.com or hit the contact link on embedded.fm have a good week