ATMega328 Programmer - Page 1
Forum section: electronics / beginners

author: JDemo
author_rank: Contributor
timestamp: September 01, 2018, 08:37:29 am
content: So lately I've been trying to teach myself engineering and I've come to love working with Arduinos. I've moved on to creating breadboarded arduinos as I tend to run out of Unos and theyre a bit more pricey. I also hate having to setup a breadboard every time I need to program one of those chips. To solve that and learn in the process I'm trying to make a programming tool that'll have a screen and what not and basically allow me to drop a 328P into a ZIF socket, press a button, and boom it's programmed with a saved sketch and / or the bootloader. I've created what I believe is a valid schematic for the programming bit, this doesn't include all of the bells and whistles like the screen just the 2 atmega chips (one, the main board one is a TQFP package). Was wondering if anyone could make sure this looks correct and recommend anything to make it better. Thanks a bunchEDIT: Basically it'll be running (the main chip) off of the ArduinoISP sketch. U1 is the on-board 328 and U3 is the DIP 328 that'll be in the ZIF socket.EDIT2: Yes, I know there are plenty of ready-made easier options but as I say above, the point isn't to make things quick and easy. This is all for a learning experience. I generally learn by doing and that's what I'm trying to do here.

author: firewalker
author_rank: Super Contributor
timestamp: September 01, 2018, 08:51:21 am
content: How do you plan to load the "to be programmed" firmware to the programmer?Alexander

author: Pirateguy
author_rank: Regular Contributor
timestamp: September 01, 2018, 09:20:15 am
content: These are cheap as dirt and both have worked for me:https://www.ebay.com/itm/USBASP-USBISP-AVR-Programmer-Module-For-Arduino-USBISP-USB-ASP-ATMEGA8-ATMEGA128/253775424002?hash=item3b1631aa02:g:~2QAAOSwejdbWC9Rhttps://www.ebay.com/itm/5V-Micro-USB-Tiny-AVR-ISP-ATtiny44-USBTinyISP-Programmer-For-Arduino-Bootloader/322924720403?hash=item4b2fd03113:g:fbwAAOSwzppaJ1DX

author: picandmix
author_rank: Frequent Contributor
timestamp: September 01, 2018, 09:24:08 am
content: Hi,QuoteIt sounds like you are using genuine Arduino boards which are expensive, but surely buying the cheap clone boards would be a cheaper and more complete option than the cost of a 328 dip chip plus crystal etc.A clone Nano board will plug straight in to a breadboard and has all the extra parts ready fitted so you just download the sketch as normal via USB.

author: JDemo
author_rank: Contributor
timestamp: September 01, 2018, 09:35:12 am
content: Quote from: firewalker on September 01, 2018, 08:51:21 amHey, I plan on adding in either a USB port and what nots or using an FTDI chip or something alike.Quote from: picandmix on September 01, 2018, 09:24:08 amQuote from: Pirateguy on September 01, 2018, 09:20:15 amYeah I'm aware of all of those things but the reason I'm choosing to do it this way (I guess the harder way) is more for a learning experience as well. I'm quite fine with spending the money to build. I enjoy the challenge as well.Thanks for the replies

author: JDemo
author_rank: Contributor
timestamp: September 01, 2018, 09:37:50 am
content: Quote from: picandmix on September 01, 2018, 09:24:08 amAlso to add more to that, generally speaking the crystal isn't totally necessary for 328s (at least from what I've been reading) also I can use a resonator but in all honesty all of those options are relatively cheap. I'd likely go the clone nano board route for permanent projects but things like perfboard and breadboarding projects I generally just use a 328 or something smaller if need be. This is 50% a learning experience 50% a time saving thing when prototyping. If I didn't need the learning experience then yeah I'd just buy a bunch of clone boards. Thanks for the info though!

author: picandmix
author_rank: Frequent Contributor
timestamp: September 01, 2018, 10:29:37 am
content: Hi,As @Pirateguy mentioned the little USB programmers are easy enough.However think this is what you are after doing - like most things arduino , its been done before, just a case of finding it.https://www.instructables.com/id/Arduino-UNO-as-AtMega328P-Programmer/

author: JDemo
author_rank: Contributor
timestamp: September 01, 2018, 10:49:42 am
content: Quote from: picandmix on September 01, 2018, 10:29:37 amRight, I'm sure they are easier. That's not the point though. The reason I'm doing this is because it gives me a cool opportunity to learn more about things like this.Essentially that link is what I'm trying to do. The few differences would be I want it to all be one PCB with no Arduino Uno and it will also have a few added features (the few of which are easy for me) I just wanted to make sure that my nets in the schematic look like they're going to the right places and make sure I didn't miss anything. I believe all is okay with it but it doesn't hurt to have a fresh and more experienced set of eyes take' a look.

author: LukeB
author_rank: Contributor
timestamp: September 01, 2018, 12:07:33 pm
content: just thought id put my 2 cents in. I am also an electronics tinkerer and have used arduino a lot in the past but also realise that arduinos are a bit expensive. Have you thought of using an attiny85. It is a smaller simpler arduino and is very cheap. It will help to teach you how to program the arduino chips and a lot of other arduino stuff. You can learn to program it using your other arduinos.

author: LukeB
author_rank: Contributor
timestamp: September 01, 2018, 12:09:01 pm
content: Oh sorry one more thing. What is to stop you just programming the chip using an arduino uno you already have. Just swap the chip for the one you want to program, and take it out once programmed.

author: firewalker
author_rank: Super Contributor
timestamp: September 01, 2018, 12:28:16 pm
content: OK. It will be great learning exprience!First off all add to the schematic everything. You are going to use a USB<->Serial chip? Add it.Select what protocol you want to use for programming the AVR. STK500 is simple enough.Tuxgraphics has an open source, hardware STK500 compatible programmer. USB <-> FTDI <---UART---> ATmega8 <---ISP---> Target AVR.Alexander.

author: JDemo
author_rank: Contributor
timestamp: September 01, 2018, 12:39:43 pm
content: Quote from: firewalker on September 01, 2018, 12:28:16 pmAwesome, thanks for the advice. Yeah I've just started adding some of those parts, basically the above was just a baseline. I'll get to checking out the STK500 protocol.Quote from: LukeB on September 01, 2018, 12:09:01 pmI was doing this for a while but eventually I bent a bunch of the DIP pins and had to sit there straightening them and that's what made me want to get an AVR programmer or something then I figured I'd use this as a good opportunity to learn a thing or two about actually designing PCBs and such. Thanks for that though!Quote from: LukeB on September 01, 2018, 12:07:33 pmAs for the ATTiny I have seen and heard a lot of good about it. This board will include a few buttons, some storage, and an LCD in the near future and as I'm not familiar with that chip I might be wrong here but I don't think it has enough IO for this. I do want to work on some other projects and hopefully use the 85. Seems like a damn good chip.

author: JDemo
author_rank: Contributor
timestamp: September 01, 2018, 12:41:59 pm
content: Quote from: firewalker on September 01, 2018, 12:28:16 pmOh and another thing the on-board TQFP 328 will only be programmed once (in theory) it'll just act as an ArduinoISP (and control a few other things) which will then program the inserted DIP. The only issue is programming the TFQP 328 initially which is where your suggestion really comes in handy since I want this to be a standalone thing rather than needing another board (such as an FTDI board) to do the initial programming. Thanks again!

author: anishkgt
author_rank: Frequent Contributor
timestamp: September 01, 2018, 01:47:11 pm
content: I've been doing the same. A standalone Arduino bootloader/programmer. I've not tested mine but here is how it looks.

author: JDemo
author_rank: Contributor
timestamp: September 01, 2018, 02:54:29 pm
content: Quote from: anishkgt on September 01, 2018, 01:47:11 pmVery cool! So far it's been pretty fun. I have most of the schematic done, just have to add a few more things then it's on to PCB layout.