VicPy How to Build an AVR Development Board > 아두이노


아두이노 강의 리스트

VicPy | How to Build an AVR Development Board


※ 영상을 선명하게 보기 안내
  1. 유튜브 영상에서 오른쪽하단에 톱니바퀴를 클릭합니다.
  2. 팝업목록에서 "품질" 선택하세요.
  3. 원하는 해상도를 선택해주세요.
※ 모바일에서 Wifi가 아니라면 데이타가 소진될 수 있으니 주의바랍니다.
VicPy님의 아두이노강의 청각장애인을 위한 자막

 the Ben Heck show is brought to you by

element 1the electronic design
community and online store built for
engineers and hobbyists alike join now
and browse the store at
Benjamin J hekkador was a mild-mannered
graphic artist until he was bitten by
the electronics bug now every ek he
takes on new projects shares tips and
tricks and ansrs your vier questions
on the Ben Heck show hello and lcome
back to the Ben Heck show I've used this
custom-built AVR development board and
past episode and 've had several
people ask about it so today I'm going
to show you how to put together one of
your own and point you in the right
direction of the schematics and diagrams
you'll need online let's get started but
first the news today in Ben news I'd
like to show you this new 3d printed
elevator I made for my ghost squad
pinball machine the ball comes in here
rolls down and the hella Vater can come
down like this and make the ball go into
a secret path 3d printing was great I
was able to 3d print a rack and pinion
sidewalls for the elevator and even
these main supports so yeah it's great
adds quite strong and it's
three-dimensional so this is a great
example of what you can do with 3d
printing takes a while to print all this
but it's worth it let's start by talking
about the differences beten an in
circuit serial programmer or ICSP and a
serial bootloader the in circuit serial
programmer usually requires you to have
a little box the programmer this box
connects to your computer via a USB
cable and then it connects to your
development circuit or microcontroller
be a 6-pin programmer now these boxes
vary depending on what kind of chipper
you're using there's a certain one for
an AVR and a different one for a pic but
they're basically do the same thing and
then typically user the program on your
computer such as AVR studio 6 or a
standalone program that flashes hex
files this is the method typically used
for professional development and also
flashing bootloader
now let's talk about a serial bootloader
which is what the arduino uses you need
to flash your microcontroller with a
boot little program which sits at the
beginning of memory you need to flash
the chip using your in circuit serial
programmer but once you do you're able
to program the chip using the RX and TX
serial communication pins hover you
need some sort of interpreter beten
that so usually have a USB to serial
adapter typically an FTDI chip or
another small marker controller that
takes your USB commands translates it to
the old-school rx TX and then your chip
programs itself from there so if you
want to flash your own chips for
development you should definitely get an
in circuit serial programmer but then
you can do it this way which is a little
easier knowing that let's talk about
what 're going to build in this
episode 're going to take a little PCB
and put a marker controller socket here
're going to use the HP mega 3 2 8 and
also a smaller socket here for the 80
tiny so you can program either them
there'll be a 6 pin in circuit serial
programming header here which works with
the AVR programmer
ll the crystal on board for driving
the larger market roller via por
switch DC jack and plenty of pins so you
can pin out what you're doing so you can
use this to flash the chip but then you
can just pull the chips out and put them
in another solution
here are most of the parts need
here the microcontrollers sockets switch
por jack unplug capacitor indicator
light crystal and the header and also
have these headers here
female headers for adding other things
to it so let's get started this is
important I got this off the Arduino
site it's a schematic for thered know
Uno now this is the part actually
need to worry about this is the market
controller and can use the same pin
out for the larger ship and the 80 tiny
and this part of it right here that's
the in circuit serial programmer so
that's how it's going to be connected on
our board so this is the most important
thing right here need to copy I added
a little header here so the crystal can
be removable these micro controllers
have internal crystals but if you want
an external crystal about the option to
be there I've started with the header
here this is the pins 28 down through 23
these are the analog connections as you
can see in the schematic so I just
simply you know use little bits of wire
to jump it over manual soldering fun do
it all the time
I better the reset button with a pull-up
resistor the pull-up resistor will put
positive voltage here on the reset line
when you push the button it pulls a
reset line low resetting it and I'm
going to tie the reset lines of both
processors the same pin because you're
not going to use both in the same time
one of the others so I'll attach this
one here and then lock for the reset
switch down here I have common ground
lines wired in see how go to the
reset switch the tiny end 18 mega is
also a positive voltage rail here and
positive and negative voltage also goes
to the header jack that 're going to
use for programming this is the jack
that you plug your AVR ISP programmer
into to program the device so as I
continue to wire I'm going to hook up
the SPI bus from that programming header
to both of the chips the SPI bus or a
serial peripheral entertained or
interface sometimes called is how the
chips are actually programs
here's how the programming header was
wired you see on the schematic that
depends go to the three programming pins
on the 80 mega which is 17 to 19 've
got that hooked up here these jumpers
then the 80 tiny 're using pins 5
through 7 here and you can see those
have been connected to the programming
header as ll the programming header
also needs positive 5 volts that's as a
reference ground and the reset line so a
reset button it's also hooked up the
burger main header that allows the
programming header to reset the
processor and get it ready for
programming now here's the por portion
of it have a DC jack coming in
capacitor to smooth it out on and off
switch an LED indicator and then the
por goes to both of the
microcontrollers and the ground was the
ground so just hook it up here click it
on and test the por make sure the
por is going need to go yep 5 volts
there and then in this one it's GZ 5 6
7 yep
so that's pretty much all the wiring I'm
going to label these pins and now can
move on to the actual programming part
of this
pitching your big idea to senior
management easier said than done
researching designing and prototyping
your big idea using the node on element
1yup much easier discover how 're
listening to your feedback and building
a better experience now it's time to
program here are the parts need it's
a por cable to plug into our board
even though this header has a por
connection on it you can't actually
por this board through the programmer
you need its own por supply then of
course plug in our programmer right
here then plug the programmer into
the computer via the USB port the first
chip 're going to program is an eighty
tiny 45 it's a small 8 pin AVR
microcontroller let's turn on the por
light turns green ok this is AVR studio
6 you can download this development
environment for free from the App Mail
bsite go up to tools and device
programming then wait a few years for
it to load up ok select our tool
want the AVR is B mark 2 device have
to set to 80 tiny 45 there it is
interface is P that's correct hit
apply and see if get anything ok that
works so hit read the device
signature alright so got a result
there which means that are connected
to it properly let's see as is P clock
just leave that as is the is P clock
does it actually sets the speed at which
it gets programmed rather than the speed
at which it runs you always want the
clock to be slor then it's Drive speed
so you don't break the chip basically so
you can always program in it at slost
speed and at least get in there and
change stuff so now that know that
it's connected let's write a little
sample code to test out our 80 tiny
so I'm just going to hook up this led to
PB 0 of the 80 tiny so eighty tiny has a
voltage ground and it has six i/o
although one of them is also used for
the reset line so I typically leave that
one alone because if you try to use it
as a digital i/o will need a high
voltage programmer so basically have
pv 0 PB 1 PB 2 3 & & 3 & also can be
used as analog digital converters the
first 3 pins here are also your 0 clock
master in slave out master out slave in
for your programming so when you program
the 80 tiny you don't want to have
things like LED connected to it just so
it won't interfere with your programming
I mean it doesn't always interfere but
it might
alright so in AVR studio go to new
project make a location for it and
select a GC cc executable project okay
alright now select our device she's
going to be the AG tiny specifically the
oh come on don't do that select our
device which is going to be the 80 tiny
45 here have our pin Direction data
Direction port B I'm oaring a1 into the
zero position which makes it an output
so now need to do this port B or
equals a same thing one shifted 0 to the
left then do a delay delay
microseconds the nice thing about
something like you know AVR studio is
it's based off once that thing Microsoft
has it's based on visual studio so all
the you know keyboard functions and
tricks that you have are all there I'm
including autocomplete now 're going
to do port B and equals the inverse of
that which will turn off the bit and
then another delay
all right now 're going to hit to f5
to debug and compile and that will also
send it to our chip that previously
it connected there go a blinking
light here's something else should
look at I'm going to go to the device
programming again read the chip and go
down to fuses fuses are what sets
certain things on the chip so here 're
using the internal clock but by default
clock divided by eight design which
means our eight megahertz clock becomes
a 1 megahertz clock want to use the
full speed of the internal clock turn
off clock divided by 8 and hit program
so now 're running eight times faster
the full speed of the internal crystal
but now have to change our program so
have the timing right here up here
before delay put define frequency CPU
8,000 you else basically 're saying
the frequency of the CPU is 8,000 that
way our program knows how to calculate
the delay function if put that
definition after delay or didn't include
it it wouldn't know what speed it is and
therefore it would be the right rate so
if I program it now it knows what the
proper speed is and frequency and the
LED is back to flashing once per second
now that 've used this board to
program in eighty tiny
let's use it to clone an Arduino alright
so have an Arduino to give it
por and then also plug in the
programming header that for these extra
headers are for on there as know now
in AVR studio go up here and
change your device to 18 mega 32:8 hit
apply read it okay there is our
device 're going to go to memories and
then 're going to do is 're going to
read the memory off of the Arduino so
I'll just put it on the desktop here
just call it argue me he'll DL for
bootloader okay now it's copying what's
on the Arduino and creating a hex file
you can actually set bits in your chip
to keep it from being copied to kind of
protect it so no one can take your code
obviously they don't bother doing that
with your do know but in professional
applications they might actually do that
to prevent people from copying that's
basically a one-way street you can't
read anything on the chip ever again
okay now 're going to unplug this just
put this aside
move our 80 tiny yes I know a toothpick
is only the proper way to do this you'll
have that ah ll I'm doing all sorts of
crap today
I put in 18 mega three to eight one
alright put our program around this here
por plugged in so I'm going to go into
AV our programming and read it okay I've
got an air old need the crystal
without the crystal it won't work this
thing has an internal oscillator as ll
but if it's fuses aren't set to use the
internal oscillator it needs an external
oscillator turn it back on okay go
here read it okay have a device
signature which means 're good so
do a couple things go into memory and
load up the Arduino VL file just
got now program that to this chip
do this takes a couple seconds
oh it's done okay you have to do a few

댓글 0개

등록된 댓글이 없습니다.

본 사이트의 컨텐츠는 명시적으로 공유기능을 제공하고 있는 공개된 자료를 수집하여 게시하고 있습니다.

저작권, 강의등록, 광고, 제휴등은 "관리자에게 문의"로 메세지 주시면 확인후 답변드립니다.