{"id":8787,"date":"2014-12-24T00:40:57","date_gmt":"2014-12-24T05:40:57","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=8787"},"modified":"2016-12-18T19:45:50","modified_gmt":"2016-12-19T00:45:50","slug":"atxmega-primer","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/atxmega-primer\/","title":{"rendered":"ATXMega Primer"},"content":{"rendered":"<p>The XMega series is a powerful addition to the existing arsenal of Atmel\u2019s AVR-core micros. As much as I have personally studied about it so far and felt, the XMega series incorporates many features of conventional 32-bit ARM micros like alternate I\/O pin mapping functionalities, sophisticated clock options and data buses, multiple communication platforms that have several uses, variety of capture-PWM options, 12-bit ADCs and DACs, DMA controller, USB hardware, etc. with the good old AVR core. Thus you get one hell of an 8\/16 bit MCU that can fulfil your wildest micro desires. In terms of unit cost, resources and user flexibilities this family of micro can beat any present day micro in most of the scenarios. Unlike other manufacturers who design chips as to fit specific applications, there\u2019s no limit for XMega series. It is one controller with unlimited possibilities that can fit into any application. Indeed it is a true Atmel slogan now:<\/p>\n<p>\u201c<i>My microcontroller can beat the hell out of your microcontroller<\/i>.\u201d<\/p>\n<p>There are several things that are should be known. XMega is still a relatively new breed of micro. There\u2019s literally nothing similar to it in the market no matter which manufacturer you can name. As I said Atmel added literally everything that can be imagined. Initial XMega devices had several hardware flaws and were unstable. They had problems related to power and operational stability. However these shortcomings are no longer there as they were. Atmel dramatically improved this new line of devices and are yet doing a lot of R&amp;D on it. The older successful AVR Mega series micros are not as same as XMegas and so what can be applied to Mega AVR can\u2019t be applied for the XMegas. There are significant differences both in terms of hardware and software but still there are similarities.<br \/>\n<!--more--><br \/>\nAt present we have different families of XMega devices. Of these many we are focused toward the AU series only throughout this post and its following ones. I&#8217;ll explain later why I\u2019m interested in this series. This is the first post of a series of posts that I&#8217;ll be publishing time-to-time. Well I should admit that making tutorial notes is not my favourite hobby but it helps me to keep documentations for future uses, reference, etc. and at the same time help others to get an easy access that I have crossed with lot of difficulties. I must also say that I&#8217;m not a good author when it comes to books, notes or other form of documentation and so if anywhere throughout the series should you find something wrong please don&#8217;t hesitate to inform me. Through these posts, I\u2019ll try to explain as much as possible but I\u2019ll suggest the readers to go through XMega manuals available at Atmel\u2019s website <a href=\"http:\/\/www.atmel.com\/\">http:\/\/www.atmel.com<\/a> before starting to play with the chips themselves. These manuals are way too large to explain down to every bits and pieces and so, at least at the time of writing this doc, there are very few resources available in the internet in a scattered fashion. Very few people have worked with XMegas and not everyone shared their collective knowledge. Even at this time there\u2019s no book on this micro family. It should also be noted that due to XMega\u2019s unavailability in DIP versions, complex internal hardware and lack of support in popular simulator software like the Proteus VSM, the XMega series is still not that much popular amongst hobbyist and DIYers. Arduino developers even moved to ARM micros rather than choosing XMega. XMega MCUs are also relatively new and form a different family of micros that are only of their kind. Hardly can I find any other 8\/16 bit MCU with so much robustness and agility. All these are just the opposite for the popular PIC or Mega\/Tiny AVR micros. For basic questions on XMega vs Mega AVR and baseline info refer to this doc: <a href=\"http:\/\/www.atmel.com\/Images\/doc8169.pdf\">http:\/\/www.atmel.com\/Images\/doc8169.pdf<\/a>.<\/p>\n<p><i><span style=\"text-decoration: underline\">XMega Features<\/span><\/i><\/p>\n<p>These are what Atmel\u2019s website have to say about XMega family in short.<\/p>\n<ul>\n<li><b>High-precision analog peripherals<\/b>\u00a0\u2014 12-bit ADCs with gain stage and combined throughput of 4MSPS. Fast 12-bit DACs with high drive strength, as well as other functions that reduce the need for external components.<\/li>\n<li><b>Real-time performance<\/b>\u00a0\u2014 The Event System facilitates inter-peripheral signalling with 100% predictable response time.<\/li>\n<li><b>Atmel picoPower\u00ae technology<\/b>\u00a0\u2014 True 1.6V operation, and down to 100nA RTC operation with full SRAM retention for fastest possible wake-up time.<\/li>\n<li><b>High integration<\/b>\u00a0\u2014 AVR XMEGA devices integrate Advanced Encryption Standard (AES) and Data Encryption Standard (DES) crypto modules, up to 32 pulse-width modulation (PWM) outputs, 8 UARTs, 4 TWI (I2C) and 4 serial peripheral interface (SPI) channels, DMA, a cyclic redundancy check (CRC) generator module and more.<\/li>\n<li><b>Atmel QTouch\u00ae Sensing<\/b>\u00a0\u2014 Capacitive touch-based buttons, track pointers and interface inputs can be realized with XMegas.<\/li>\n<li><b>USB connectivity<\/b>\u00a0\u2014 Delivers full-speed operation without the need for external crystals, 31 endpoints, and a special multi-packet function that maximizes data transfer rates while minimizing CPU load.<\/li>\n<li><b>XMEGA Custom Logic (XCL)<\/b>\u00a0\u2014 The XMega E devices feature an innovative XMega Custom Logic module (XCL) consisting of two independent 8-bit timers\/counters and two lookup tables used for defining glue logic. It is designed to reduce bill of material (BOM) and PCB size as the XCL can replace external circuitry such as delay elements, RS-latches, D-latches, D-flip-flops chip-select logic, AND, NAND, OR, NOR, XOR, XNOR, NOT, MUX AND\/OR\/XOR logic gates. In addition, it can, together with the USART, enable customized communication protocols.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><i><span style=\"text-decoration: underline\">Hardware-Software Tools<\/span><\/i><\/p>\n<p>First things first. What we\u2019ll need to get started.<\/p>\n<ul>\n<li>An XMega chip embedded in a DIP converter\/Plug-in-Module (PIM) or an XMega development board. Any XMega chip will do but I prefer the A4U series, specifically ATXMega32A4U or ATXMega128A4U as they have USB support for DFU bootloader and most of the common internal hardware found XMega micros. These chips are like flagships of the XMega series while at the same time cheap. I&#8217;ll be using the\u00a0XMega32A4U along with my custom made development board.<a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/4\/\" rel=\"attachment wp-att-8791\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8791\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/4.png\" alt=\"4\" width=\"278\" height=\"252\" \/><\/a><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/2\/\" rel=\"attachment wp-att-8788\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8788\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/2.png\" alt=\"2\" width=\"294\" height=\"135\" \/><\/a><\/li>\n<li>\u00a0A programmer that supports PDI\/JTAG interface. I say that you get an official Atmel programmer. JTAG ICE or AVR ISP MKII will suffice. Refer to device manuals and check which interfaces can be used to program your XMega. For instance the chip that I\u2019ll be using \u2013 XMega32A4U supports only PDI interface while other XMegas support both PDI and JTAG. You&#8217;ll not need a programmer if your XMega chip was shipped with the XMega bootloader or if you don&#8217;t need to alter fuse settings. Be careful about buying these official Atmel programmers because there are many fake copies of them that don&#8217;t work as they should. Buy them from a genuine Atmel distributor.\u00a0<a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/5\/\" rel=\"attachment wp-att-8792\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8792\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/5.png\" alt=\"5\" width=\"228\" height=\"182\" \/><\/a><\/li>\n<li>Software that we\u2019ll need include MikroC PRO for AVR, Atmel AVR Studio (for programmer only), <a href=\"http:\/\/www.atmel.com\/microsite\/atmel_studio6\/\">http:\/\/www.atmel.com\/microsite\/atmel_studio6\/<\/a> and Atmel Flip (for bootloader application), <a href=\"http:\/\/www.atmel.com\/tools\/flip.aspx\">http:\/\/www.atmel.com\/tools\/flip.aspx<\/a>. Of course we can use AVR Studio, Codevision AVR, BASCOM, etc for coding XMegas but I\u2019m not going for any one of them. Name it a personal choice or something else. I\u2019ll stick to MikroC as I\u2019m using the same tool for ARM too. Changing a compiler IDE and my entire establishment for just a family of micro sounds like crazy ride to me.<\/li>\n<li>Rest of the stuffs that will be needed include basic lab tools like multimeters, power supplies, an oscilloscope, a signal generator, connecting wires, bread boards, etc. A well regulated DC power supply is a must. The other tools may be ignored but I recommend having them during work.<\/li>\n<li>Additionally download the XMega AU manual from here:\u00a0<a style=\"font-size: 0.95em;line-height: 1.6em\" href=\"http:\/\/www.atmel.com\/images\/atmel-8331-8-and-16-bit-avr-microcontroller-xmega-au_manual.pdf\">http:\/\/www.atmel.com\/images\/atmel-8331-8-and-16-bit-avr-microcontroller-XMega-au_manual.pdf<\/a><span style=\"font-size: 0.95em;line-height: 1.6em\"><span style=\"font-size: 0.95em;line-height: 1.6em\"><span style=\"font-size: 0.95em;line-height: 1.6em\">.<\/span><\/span><\/span><\/li>\n<\/ul>\n<p><i><span style=\"text-decoration: underline\">The Bootloader<\/span><\/i><\/p>\n<p>The ability of XMega32A4U to get programmed via the XMega USB DFU bootloader makes it very easy to get hands on it without worrying about an external programmer hardware. Most chips are shipped with this bootloader. However not all are shipped this way. In this section, I\u2019ll explain how to get the bootloader into a fresh bootloader-less XMega chip and what steps will required to be done. Please download the XMega32A4U bootloader file supplied in this post.<\/p>\n<p>Unlike traditional AVRs like the ATMega32A which typically use SPI-based ISP for programming, XMegas generally use PDI interface.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/6\/\" rel=\"attachment wp-att-8793\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8793\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/6.png\" alt=\"6\" width=\"376\" height=\"152\" \/><\/a><\/p>\n<p>As can be seen there\u2019s no similarity between PDI and SPI-based ISP. PDI interface is somewhat like I2C because it use two wires for data communication \u2013 PDI-data and PDI-clock. At this point I&#8217;ll not go further about PDI interface as it is beyond the scope of this post. For further info on PDI refer to: <a href=\"http:\/\/support.atmel.com\/bin\/customer.exe?=&amp;action=viewKbEntry&amp;id=683\">http:\/\/support.atmel.com\/bin\/customer.exe?=&amp;action=viewKbEntry&amp;id=683<\/a>.<br \/>\nBefore you go ahead keep in mind that XMegas don\u2019t operate at 5V. They need 3.3V power supply. Thus unless you are using a development platform\/board I would recommend that you wire up your basic setup in a decent manner and use a regulated 3.3V power supply. If you are using USB port to power your XMega be sure to use a 3.3V LDO regulator. \u00a0I also recommend applying 100nF \u2013 10uF tantalum capacitors adjacent to the power supply pins of the XMega chip. Keep those caps as close as possible to the VDD-GND pins of the micro. This will ensure stable and noise free power source for the chip. It\u2019s also worth noting that the official Atmel programmers like the AVR ISP MKII which I\u2019ll be using, don&#8217;t power the target micro unlike other programmers like the Microchip PICKIT2 or PICKIT3 or even the clone USBASPs. This is where, according to me at least, official Atmel programmers suck. Thus before using an official programmer make sure that your target chip is powered. Alternatively you can add a switchable power supply (3.3V-5V) to your official Atmel programmer. Refer to this video on this by EEVBlog\u2019s Dave: \u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=ICQXqVy3Hpc\">https:\/\/www.youtube.com\/watch?v=ICQXqVy3Hpc<\/a>. See how he modified his MKII ISP.<\/p>\n<p>Below is the schematic of a minimal level XMega board. You can use it if you wish.<br \/>\n<a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/7\/\" rel=\"attachment wp-att-8794\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8794\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/7.png\" alt=\"7\" width=\"521\" height=\"880\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/7.png 521w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/7-384x650.png 384w\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" \/><\/a><\/p>\n<p>Check how the PDI interface is connected (pin no. 34 and 35). You should also connect it this way and hook up your programmer according to pin names. Hooking the programmer PDI port the other way around or wrongly won&#8217;t cause any serious issue but you&#8217;ll get errors and your programmer won&#8217;t find your target MCU. Be very careful about this.<\/p>\n<p>Provided that everything has been done properly and your setups are ready to go, connect your programmer with your PC and open AVR Studio IDE. Power your XMega and connect it with your programmer\u2019s PDI interface properly. Refer to pages 30 \u2013 35 of the XMega AU manual for info on fuse and lock bit settings before changing them. In most cases you won&#8217;t have to mess with fuse and lock bits. In the AVR Studio IDE go to <b><i>Tools <\/i><\/b>and then select <b><i>Device Programming<\/i><\/b>. This will check for tools available for programming and will also provide an interface to use the connected programmer.<br \/>\n<a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/8\/\" rel=\"attachment wp-att-8795\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8795\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/8.png\" alt=\"8\" width=\"602\" height=\"335\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/8.png 602w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/8-550x306.png 550w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/9\/\" rel=\"attachment wp-att-8797\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8797\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/9.png\" alt=\"9\" width=\"618\" height=\"285\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/9.png 618w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/9-550x253.png 550w\" sizes=\"auto, (max-width: 618px) 100vw, 618px\" \/><\/a><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/10\/\" rel=\"attachment wp-att-8796\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8796\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/10.png\" alt=\"10\" width=\"620\" height=\"273\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/10.png 620w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/10-550x242.png 550w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><br \/>\nA new window will pop up.<a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/11\/\" rel=\"attachment wp-att-8798\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8798\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/11.png\" alt=\"11\" width=\"601\" height=\"559\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/11.png 601w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/11-550x511.png 550w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/a><\/p>\n<p>Select your programmer, the target chip and if needed the interface. Press apply and the programmer will detect your target chip. Optionally you can read the device\u2019s signature and power supply voltage.\u00a0 Make sure that you downloaded the XMega zip file.<\/p>\n<p>Go to the <b><i>Memories<\/i><\/b> option of the new window and then browse and locate the bootloader file. It is like any other MCU hex file and has the <b><i>.hex<\/i><\/b> extension. Press the program button after loading the bootloader hex file. This will flash the bootloader into the micro. Optionally you can verify the flash. However this is not the end of the story. We\u2019ll have to make some changes in the fuse byte.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/12\/\" rel=\"attachment wp-att-8799\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8799\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/12.png\" alt=\"12\" width=\"602\" height=\"547\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/12.png 602w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/12-550x499.png 550w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Now go to the <b><i>Fuses<\/i><\/b> option. Selecting the <b><i>Fuse<\/i><\/b> option will automatically make the programmer read the fuses set on it. Edit the fuses as per your need. With these settings you can change some critical hardware settings just like in any other MCU. You can configure the watchdog timer, brownout reset voltage level, etc. However whatever you do make sure that the Boot Reset fuse (<b><i>BOOTRST<\/i><\/b>) is programmed with <b><i>BOOTLDR <\/i><\/b>option. Only this will ensure that the XMega will enter into the bootloader portion of the flash memory after reset before loading the actual application coded in it. It is same as what you\u2019ll see in an Arduino board where the bootloader runs before the application after reset. After setting the fuses as per need hit the program button to set them in your target chip. I have set the fuses as shown below:<br \/>\n<a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/13\/\" rel=\"attachment wp-att-8800\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8800\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/13.png\" alt=\"13\" width=\"601\" height=\"546\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/13.png 601w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/13-550x499.png 550w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/a><\/p>\n<p>Optionally you can verify and read back the fuses that you set to check if they were set correctly.<\/p>\n<p>There\u2019s no need to set lock bits at this point if security is not as issue. Since we are just learning to play with the XMega, I don\u2019t see any good reason to raise the security level. We are, at least this time, not making a commercially valuable good with the XMega. Thus I leave the lock bits and other options for future and up to the reader. Fuse and lock bits are retained even if the bootloader application erases the application flash.<\/p>\n<p>We are now done with the bootloader now. Close the AVR Studio IDE and disconnect the programmer. Install Atmel Flip. Connect the XMega to your PC via a USB port. Upon connecting the PC will attempt to install drivers for the new DFU device.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/14\/\" rel=\"attachment wp-att-8801\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8801\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/14.png\" alt=\"14\" width=\"601\" height=\"320\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/14.png 601w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/14-550x292.png 550w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>However it will not succeed to install a driver for it. You\u2019ll have to manually install the driver. The driver for the XMega device is located in the installation location of the Atmel Flip software.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/15\/\" rel=\"attachment wp-att-8802\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8802\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/15.png\" alt=\"15\" width=\"285\" height=\"227\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Locate and manually install the driver as shown:<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/16\/\" rel=\"attachment wp-att-8803\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8803\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/16.png\" alt=\"16\" width=\"601\" height=\"576\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/16.png 601w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/16-550x527.png 550w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/17\/\" rel=\"attachment wp-att-8804\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8804\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/17.png\" alt=\"17\" width=\"329\" height=\"184\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Run Atmel Flip software.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/18\/\" rel=\"attachment wp-att-8805\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8805\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/18.png\" alt=\"18\" width=\"363\" height=\"305\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>To activate the bootloader programming mode, reset the target micro while keeping PortC.3bit low. In the Flip software, select the device and select the communication medium.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/19\/\" rel=\"attachment wp-att-8806\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8806\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/19.png\" alt=\"19\" width=\"377\" height=\"318\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Since we\u2019ll be using the USB bootloader, we&#8217;ll select USB communication method.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/20\/\" rel=\"attachment wp-att-8807\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8807\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/20.png\" alt=\"20\" width=\"353\" height=\"296\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>When there\u2019s successful communication between the PC and USB DFU device the software will show <b><i>USB ON <\/i><\/b>at the bottom right, changing from <b><i>Communication OFF<\/i><\/b>.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/attachment\/21\/\" rel=\"attachment wp-att-8808\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8808\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/06\/21.png\" alt=\"21\" width=\"366\" height=\"306\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Now you can load your hex code, do blank check, erase the MCU and do other stuffs with Flip and the bootloader.<\/p>\n<p>That\u2019s all for now till the next post release. Happy playing with the XMega family.<\/p>\n<p>Attachment zip file:<br \/>\n<a href=\"http:\/\/embedded-lab.com\/blog\/atxmega-primer\/xmega\/\" rel=\"attachment wp-att-8812\">XMega<\/a><\/p>\n<p><i>Author: Shawon M. Shahryiar<\/i><\/p>\n<p><a href=\"https:\/\/www.facebook.com\/groups\/microarena\/\"><i>https:\/\/www.facebook.com\/groups\/microarena\/<\/i><\/a><\/p>\n<p><a href=\"https:\/\/www.facebook.com\/MicroArena\"><i>https:\/\/www.facebook.com\/MicroArena<\/i><\/a><i><\/i><\/p>\n<p><a href=\"mailto:sshahryiar@gmail.com\"><i>sshahryiar@gmail.com<\/i><\/a><i><\/i><\/p>\n<p><i>+8801970046495 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The XMega series is a powerful addition to the existing arsenal of Atmel\u2019s AVR-core micros. As much as I have personally studied about it so far and felt, the XMega series incorporates many features of conventional 32-bit ARM micros like alternate I\/O pin mapping functionalities, sophisticated clock options and data buses, multiple communication platforms that have several uses, variety of capture-PWM options, 12-bit ADCs and DACs, DMA controller, USB hardware, etc. with the good old AVR core. Thus you get one hell of an 8\/16 bit MCU that can fulfil your wildest micro desires. In terms of unit cost, resources<\/p>\n","protected":false},"author":5,"featured_media":8788,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1466,792],"tags":[415,644,62,800,11,423],"class_list":["post-8787","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-xmega","tag-advanced-microcontrollers","tag-atmel","tag-atmel-programmer","tag-atxmega32a4u","tag-avr","tag-avr-xmega"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=8787"}],"version-history":[{"count":8,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8787\/revisions"}],"predecessor-version":[{"id":12839,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8787\/revisions\/12839"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/8788"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=8787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=8787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=8787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}