Programmer for the tinyAVR family based on the cheap Chinese converter CH340
3r3141. Unified Program and Debug Interface (UPDI) 3r3142. - This is a single-wire interface for programming /debugging new Atmel 8-bit microcontrollers, replacing the two-wire PDI interface used to program AVR XMEGA microcontrollers. 3r3178. 3r3185. 3r3178. 3r3185.
3r311. 3r3186.
3r3144. 3r3178. 3r3185. So, the regiment of Atmelov's protocols arrived - ISP, JTAG, debugWIRE, TPI, aWire, PDI, now here is UPDI. At the same time, the situation with the AVR ecosystem is still very poor, so we were going to completely abandon their use, but the latter tendency pleased us a little, which is why this article was written. 3r3178. 3r3185. 3r3178. 3r3185. The UPDI protocol can only be used by the happy owners of the Atmel ICE programmer, which is not very convenient to use due to the rather strange choice of the connector, and it is not that cheap to afford to purchase it on an industrial scale. In addition, it requires the installation of Atmel Studio, which periodically refuses to work with it, because according to the policy of our company, most computers do not have access to the Internet, and the studio periodically climbs there for drivers, then for some libraries, as a result moments when the programmer was visible in the system, that is, the drivers were installed correctly, but it was not noticed by the studio itself until it got access to the network and was not updated forcibly. 3r3178. 3r3185. 3r3178. 3r3185. Therefore, immediately after we began to use the new and quite convenient ATTiny1616 microcontroller (about its merits later) in our developments, there was a need for a tool that we could use to write to the primary loader controller in production. Without <{full}> 3r3188. 3r3-31. Unified Program and Debug Interface (UPDI) 3-333140. - This is a single-wire interface for programming /debugging new Atmel 8-bit microcontrollers, replacing the two-wire PDI interface used to program AVR XMEGA microcontrollers. 3r3176. 3r3188. 3r3176. 3r3188. 3r3184. 3r311. 3r3142. 3r3176. 3r3188. So, the regiment of Atmelov's protocols arrived - ISP, JTAG, debugWIRE, TPI, aWire, PDI, now here is UPDI. At the same time, the situation with the AVR ecosystem is still very poor, so we were going to completely abandon their use, but the latter tendency pleased us a little, which is why this article was written. 3r3176. 3r3188. 3r3176. 3r3188. The UPDI protocol can only be used by the happy owners of the Atmel ICE programmer, which is not very convenient to use due to the rather strange choice of the connector, and it is not that cheap to afford to purchase it on an industrial scale. In addition, it requires the installation of Atmel Studio, which periodically refuses to work with it, because according to the policy of our company, most computers do not have access to the Internet, and the studio periodically climbs there for drivers, then for some libraries, as a result moments when the programmer was visible in the system, that is, the drivers were installed correctly, but it was not noticed by the studio itself until it got access to the network and was not updated forcibly. 3r3176. 3r3188. 3r3176. 3r3188. Therefore, immediately after we began to use the new and quite convenient ATTiny1616 microcontroller (about its merits later) in our developments, there was a need for a tool that we could use to write to the primary loader controller in production. Of course, without
SMS and registration Internet access. 3r3176. 3r3188. 3r3176. 3r3188. After a bit of searching, I discovered the project [b] on Github. pyupdi (https://github.com/mraardvark/pyupdi) - UPDI protocol implementation on Python, and this implementation is based on the usual UART protocol, except without level converters, which is actually more convenient because it allows using standard microcircuits converters from FTDI or their Chinese counterparts CH340 /341. 3r3176. 3r3188. 3r3176. 3r3188. The project was downloaded and tested, it went quite cheerfully. But after a couple of days it became clear that he still didn’t really fit us. Reasons:
3r3188. 3r3176. 3r3188. 3r3151. 3r3188. 3r3168. It requires the installation of Python and a whole group of packages (I remind you that we are talking about computers without access to the Internet), I had to download and manually install almost a dozen different packages that depended on each other. Yes, in principle, you can make an executable file on another computer from a Python script, this somehow solved the problem, but the list of problems did not end with 3r3169. 3r3188. 3r3168. there is almost no error checking in the script, any error ends with an interruption indicating heaps of files referring to each other, which is not very clear to ordinary personnel. 3r3188. 3r3168. It is impossible to read the contents of the controller's memory, which makes it impossible to finally test the recording process 3r31616. 3r3188. 3r3168. There is no way to read the fuses
3r3188. 3r3168. the speed of the script leaves much to be desired, 16 kb are written for almost a minute, this is due to the absence of any optimization in the transfer process, everything is built on tight timings 3r31616. 3r3188. 3r3168. no indication of the recording process 3r3r169. 3r3188. 3r3168. The project does not support a range of processors that could be supported by 3r3169. 3r3188. 3r3168. The project is in a half-dead state and does not respond to requests 3r3-3169. 3r3188. 3r3171. 3r3176. 3r3188. Problems were solved within the framework of Python for some time, but after any fixation I had to reassemble the project, test it, so that there was a desire to rewrite the script on something more familiar and fast, that is, on C. We are embeds, after all! 3r3176. 3r3188. 3r3176. 3r3188. Now briefly about the merits of the tinyAVR 1-Series new family:
3r3188. 3r3176. 3r3188. 3r3151. 3r3188. 3r3168. real unification of the periphery and address space in the range from 2 kb to 32 kb
3r3188. 3r3168. convenient bootloader configuration (at the beginning of the memory!) 3r3r1616. 3r3188. 3r3168. a significant simplification of the ISP (In-System-Programming) algorithm 3r31616. 3r3188. 3r3168. transition to von Neumann architecture 3r3r169. 3r3188. 3r3168. up to 32 kb of flash memory in a small package (3x3mm) with 24 terminals, of which up to 22 (!) can be used as IO
3r3188. 3r3168. the presence of an internal oscillator at 16/20 MHz 3r3-3169. 3r3188. 3r3168. less dependency on fusion configuration (eternal AVR headache)
3r3188. 3r3168. Analog part excellent for a small controller (ADC /DAC /Comparators with the possibility of both internal and external switching of inputs /outputs) 3r3169. 3r3188. 3r3168. single-wire programming and debugging
3r3188. 3r3168. extremely low price in retail (from € 0.6 for 16 kb)
3r3188. 3r3171. 3r3176. 3r3188. As an iron part of the programmer, we took the already existing USB-UART TTL converter based on the Chinese CH340 chip, like this:
3r3188. 3r3176. 3r3188. 3r3115. 3r3176. 3r3188. 3r3176. 3r3188. For programming, it is enough to connect two of its outputs RX and TX, since they are already equipped with an output resistor of 1.5k, if there is no resistor in your converter model, then it should be added. The combined output is connected to the UPDI pin on a programmable chip, the transmitter ground must also be connected to the controller ground. If there is an external power supply, you need to pay attention only to whether it corresponds to the power supply used by the converter (3.3V or 5V). If there is a need, it is possible to power the circuit with the controller from the converter itself, which can be very convenient for primary programming. 3r3176. 3r3188. 3r3176. 3r3188. 3r3124. 3r3176. 3r3188. 3r3176. 3r3188. Attention! 3r33140. The resistor is optional, it needs to be soldered only if your converter does not have any protective resistors at the output. 3r3176. 3r3188. 3r3176. 3r3188. The only problem associated with the CH340 chip is that it did not work in my Linux version of the program, because the parity bit in the programming protocol and the CH340 driver in my kernel version do not work correctly with this bit. Perhaps the problem will be fixed soon, so far I have not had the patience to do this. 3r3176. 3r3188. 3r3176. 3r3188. As a result of the work and experiments in IDE Code :: Blocks, the program 3r3139 was written and debugged. updiprog , 3r3141. the source codes of which are laid out on Github
. 3r3176. 3r3188. 3r3176. 3r3188. What has been implemented in this version of the program: 3r3176. 3r3188. 3r3176. 3r3188. 3r3151. 3r3188. 3r3168. Added the ability to read the contents of the controller's flash memory in the
hex file. 3r3188. 3r3168. Added the ability to read the status of all fusions of the controller
3r3188. 3r3168. whenever possible, error handling has been added with corresponding messages 3r3169. 3r3188. 3r3168. Added indication of the write /read process
3r3188. 3r3168. Significantly increased work speed (about 6 seconds to read 16 kb)
3r3188. 3r3168. Added support for all 1-Series
microcontrollers. 3r3188. 3r3171. 3r3176. 3r3188. The initial size of the program is about 25 kb in comparison with 5 kb of MB for the compiled source Python script. 3r3176. 3r3188. 3r3176. 3r3188. I hope that the work done will be useful to someone. I will be glad to feedback and suggestions. 3r3184. 3r3188. 3r3188. 3r3181. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r3182. 3r3188. 3r3184. 3r3188. 3r3188. 3r3188. 3r3188.
It may be interesting
weber
Author23-10-2018, 06:14
Publication DateDevelopment / Programming
Category- Comments: 0
- Views: 438
Helpful information. Fortunate me I discovered your web site accidentally,
and I am stunned why this accident did not happen earlier! I bookmarked it. Thanks, I've recently been looking for information about this topic for [hide]a[https://www.pizzahutcouponcode.com/pizza-hut-coupons-code/
] long time and yours is the greatest I've discovered so far. But, what concerning the conclusion? Are you positive about the source?
entegrasyon programları
entegrasyon programları