so you know how I like to buy cheap stuff from China including my stockpile
of arduino z' now one downside of that I've stumbled across is occasionally you
get one that isn't quite as awesome as you'd think but when I get them the
first thing I do is I'll plug them in make sure that they've got the factory
loaded blink sketch in them which these ones do but the these two out of all the
ones have ordered so far don't have a bootloader in them so when I try and
live my own softer on I get an error now the bootloader is just a little bit of
code that hangs out in there permanently that allows you to load new code Ian
easily and quickly just using the USB port now the the 18 mega 328 chip on
there doesn't speak USB but most of these cheap clones have a ch3 80 on the
bottom which ch3 40 which is a USB to serial converter so this USB of serial
is a ch3 40 and that's what I use to load code into my pro mini that's
driving my little sign back there because it doesn't have that on board
which makes them a little bit cheaper cheaper by basically the cost of that
one chip that's a digression but even those guys don't have a bootloader
on them the bootloader is the software that allows you to use just a basic Siri
usb-to-serial to dump onto the chip so these guys for whatever cheap reasons
don't come with that so that's my project de jour
apparently according to my reading there's a couple of different ways you
can load it on there the the one way is to use another Arduino as an insert
programmer now these this little six pin header here and here is called ICSP in
circuit system programmer that will let you dump the the bootloader into the
chip or you can actually just put a sketch directly into the chip bypassing
the whole USB serial thing if you need to use every single byte of memory in
there you don't need the bootloader taking up space you can just do it that
way I'm not gonna do that I'm not writing
that complicated to code so there's six pins on here's power and ground it's two
of them then there's a clock a serial clock and a reset and then there's miso
and mossy master in slave out master out slave in so basically it's a transmit
and receive pin so the out has to be connected to the Eaton in the ian has to
be connected to the out ring in the default demonstration sketches that come
with the Arduino IDE there's a sketch called Arduino as ISP or Arduino ISP
Arduino in circuit so basically this becomes the programmer and this gets the
programming yeah there is a second way of doing it and all using a thing called
a USB ASP this which just it's adapts down it's got a little six pin chip on
it and it just drops straight onto there and into USB boom done I'll do that
later but first I'm going to do this one and I'm gonna do it quick and dirty as
is my style so the first thing is obviously to load the programmer sketch
onto onto the you know which takes very little time then you
got to wire it up according to a million-in-one diagrams
you can find on the internet and I'm just going to pause while I do that just
to make it a little bit quicker and more efficient okay one correction to what I
said before missile and mozzie missile on one board connects to me so in the
other mozzie on the other connects to mozzie
so master out slave in and master in slave out they go straight across there
not TX and rx if you're doing serial TX and rx on pin zero and one then you have
to cross them or if you're doing it like this you have to cross transmit and
receive but hear me so goes to me so mozzie gusta mozzie
okay so I've connected it up and in the sketch it's also got these three LEDs
coming off what is that pin seven eight and nine I think it is
yeah pin 7 8 9 9 is heartbeat 8 is Error and 7 is programming mode so now that
I've got this all connected out but this thing's still doing its it's old blink
sketch that was burned in from the factory this one's got the eye Arduino
as is P so next you go over to tools and select in programmer select our Arduino
as is P then you select the board that is your target board in this case it's
the nano nano check to chug and I'll make sure that I got the right nano 18
mega 328p I do have some 168 but this is a 328 that's correct
and then you just cross your fingers and click burn bootloader and you watch the
lights blinking over here and I got an error while burning bootloader
okay so why do they get that one moment for investigation
so the first troubleshooting step it says is to make sure you got the right
chip 18 mega 328p that's what it says there
and yeah so why is it giving me the wrong one hmm
well that's going to take a bit of troubleshooting it may have something to
do with the software on my laptop or it might be something else so in the
meantime let's try this other method here so I've got this usbasp set up as a
jumper for three volts or 5 volts or it's set to 5 volts means it should be
able to just power that and it is and it's got it sold blink sketch going you
can sort of see it there so let's hold these two guys in place here and zoom in
just a little bit and over the laptop we all change the programmer to a USB aspe
and there's still Nano we're still 386 P let's try burnin things are happening
and it says done okay so now then you should be able to write a program on to
this one let's just power that guy on so there's no sketch in there nothing's
happening there's even a little bit and I've got a sketch written that I it's
basically the blink sketch twice and I change the speeds on half but it's I
called the double blink and I'll upload that notice it says arduino nano 386 p
uploading done uploading
there's my sketch it was the kind of staggering blink so there we go that
worked okay so I declare its USB ASB to be a lot more simplified and or easier
then this method which does work if you got all the right software for some
reason I don't have the right version of AVR dude according to which is part of
the Arduino installation I'm not sure exactly that's code code is messy I
don't like code this does work I've seen people do it but this is so much quicker
more straightforward now then if you don't want the solder pins on you can
still make it happen just by using jumpers from here to the six six
positions mozzie me so serial clock reset power and ground and
actually I think I will do that with this one just to get it done
okay so here's this one set up because the pins from the ICSP header are
duplicated from the standard pins I can just connect it up like that and it
should work the same I've got the same
same set up over here nano is the target you can make it suit you P usbasp and
burn bootloader bang error
so I hit the coop logged into the wrong pin here and just because I pulled the
pins open whatever okay let's give this a try
tools burn boot odor
it was complaining for a little bit it looks like it's done it but the proof is
can I upload my double wink sketch which I modified slightly just now upload
compiling uploading done uploading double blinking woohoo
so this usbasp seems to be the way to go and as I said earlier I could also use
this to directly upload a sketch and I'm not going to do that that's not what I'm
about today this was simply getting these two working so that I can use them
for another project which will be an upcoming video maybe next week maybe
later depending on how good I am thanks for watching if you've never seen this
done I hope you learned from my mistakes so you don't have to repeat them
yourself if you have any questions or comments please leave it down in the
comment section as usual I will talk to you later