Welcome and enjoy, the first of many Microprocessor based posts. So, why did I create this? Because, I wanted a simple Serial UPDI Programmer and I was not find any good source of them right now. So, here is my version.
Microchip UPDI protocol
Hey, what is UPDI? Well, put simply it is the latest programming protocol for some Microchip processors. For example, latest ATTiny are UDPI programmable. Also, it only takes three wires to program chips that are UPDI compliant.
Simple
Simple, that is what I was after with this example. There is so many examples out on the web. However, how do I know what works. So, I wanted this post to go from start to finish and keep it simple on how to build this programmer. Oh, it is also very low cost! That is a plus!
Parts Needed
- CH340G – USB to Serial output. Here on ebay.
- Schottky Diode – Surface mounted worked great. Here is the one I used.
- 510 Ohm Resistor – I used what I had and could not find a 470 ohm. Range 100 ohm to 1 Kohm resistor on rx.
That is it, only three components and it works! See, the thing is awesome! I am trying to remember the exact site I found this on and I think it was this site.
Building
Ok, so I will have more detailed photos if I build another one. So, If you want one I will build you one. Post below and I will send you my paypal to work out payment details. Cost $20 USD direct from here 25 on eBay. Please see my ebay.com if you want one that way.
Solder Schottky Diode between Rx and Tx with cathode (Side with White Mark) towards Tx.


Solder Resistor to Rx line
I do not have a image of this directly but it is under the shrink tube on Rx pin.
Solder GND wire to GND pad
Note, best way to do this would be to solder to the GND pin. Next version I am going to build a socket to do this so I no longer have to modify the USB adapter. I will have photos of that when I get it built.
Solder wire to 5v pad
Also, solder the 5 volt wire to the 5v pad on the bottom of the USB Adapter.
Wrap it all in heat shrink Tubing
Simply add protection and help keep the wires from breaking as easy.


Schematic

Pretty simple, Just three components. Like stated in build v 2.0 will be a socket that can be plugged onto the CH340G USB adapter. Also, I will add 5v and 3.3v properly in next circuit.
Using Programmer with Arduino
Its time, now that is built it is time to try it on Arduino. First however, it is required to setup Arduino if you have not set it up with Arduino IDE. Oh, if you do not have Arduino IDE the download it here.
Add megaTinyCore
Add http://drazzy.com/package_drazzy.com_index.json
to Arduino. This is done via File->Preferences menu

Add megaTinyCore via Boards Manager
See below, that is how to add board managers to Arduino IDE.

Install megaTinyCore manager

Note, the Install button is on there, but I already have it installed. Anyway press it and let it install.
Setup megaTinyCore Board
So, this is my setup please adjust for your ATTiny chip. Anyway this is the best settings that I am currently Running.

Setup Chip

Select Com Port
Remember, you have to have USB UPDI adapter plugged into computer. Also, the port will very and mine was COM8 yours may be different.

Select Programmer IMPORTANT
Ok, so whole point of this post here. Now, select the correct programmer type from programmer options. Note, one important point the fastest CH340 programmer works for me. However any of the CH340 seem to work fine.

Example Code
Below, is an example sketch to do the Blink at 500 ms on and 500 ms off. Note, for my chip pin 8 is PIN 10 on the physical chip. That is, the bottom left pin on the ATTiny1626.
void setup() {
// put your setup code here, to run once:
pinMode(8, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(8, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
digitalWrite(8, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
}
Other Resources
Final Thoughts
Thanks, this is the first working version of the UPDI interface. I will be building more complete versions of this circuit in the future. Stay tuned! Thanks for reading!!! PS, I am using the ATTiny1626 in my Wideband Controller here.
[…] I have wired the initial prototype breadboard. Well, now it is time to write the software. Oh, here is a post on the programmer for the ATTiny1626 chip that I am using. Wow, by the end of next week I […]