{"id":14219,"date":"2018-05-02T02:51:07","date_gmt":"2018-05-02T06:51:07","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=14219"},"modified":"2018-08-05T12:01:56","modified_gmt":"2018-08-05T16:01:56","slug":"getting-started-nuvoton-8-bit-microcontrollers","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/getting-started-nuvoton-8-bit-microcontrollers\/","title":{"rendered":"Getting Started with Nuvoton 8-bit Microcontrollers"},"content":{"rendered":"<p style=\"text-align: justify\">Many of us who are involved in the embedded system industry like 8-bit microcontrollers. They are cheap, easy to use and solve most of the common automation problems. 32-bit micros are in that contrast expensive and are mainly intended for advance-level works that cannot be solved with 8-bit micros. Thus, 32-bit micros are not much demanding as the 8-bit ones. In most places, 8051s, AVRs and PICs are the most used 8-bit micros. The popular Arduino platform is mainly based on 8-bit AVR micros. However, these are not the only 8-bit micros of the whole embedded world. <a href=\"http:\/\/www.nuvoton.com\"><strong><em>Nuvoton<\/em><\/strong><\/a> &#8211; a Taiwan-based semiconductor manufacturer, is one such company that has its own flavour of 8-bit and 32-bit micros. The 8-bit micros from Nuvoton are based on the popular 8051 architectures. In this series of articles, we will be discovering Nuvoton <strong><em>N76E003<\/em><\/strong> 1T-8051-based microcontroller.<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/SDK1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-14257\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/SDK1-580x217.png\" alt=\"SDK\" width=\"580\" height=\"217\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/SDK1-580x217.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/SDK1.png 699w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p style=\"text-align: center\"><!--more--><\/p>\n<h1>N76E003 vs STM8S003<\/h1>\n<p style=\"text-align: center\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Hardware-Internals.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14220\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Hardware-Internals.png\" alt=\"Hardware Internals\" width=\"512\" height=\"319\" \/><\/a><\/p>\n<p style=\"text-align: justify\">In terms of outlook, part numbering, pin layout and other basic features, N76E003 looks like a cheap Chinese copy of STMicroelectronics\u2019 STM8S003. However, as we all know, looks can be deceptive. Though several similarities, N76E003 is not a replica of STM8S003 in any way. In fact, in terms of architecture and some hardware features, N76E003 varies a lot from STM8S003. For instance, the processor core of these chips is not same. Even after having same pin layouts, N76E003 has several additional hardware than STM8S003, for instance 8 channel &#8211; 12-bit ADC.<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/ST-Vs-Nu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-14225\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/ST-Vs-Nu-580x478.png\" alt=\"ST Vs Nu\" width=\"580\" height=\"478\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/ST-Vs-Nu-580x478.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/ST-Vs-Nu.png 850w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>The table below summarizes an actual comparison of these chips.<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Features.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-14226\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Features-580x306.png\" alt=\"Features\" width=\"580\" height=\"306\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Features-580x306.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Features.png 682w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p style=\"text-align: justify\">It is a good idea to consider N76E003 as an advanced 8051 micro in STM8S003 form-factor and having several similarities with the STM8S003.<\/p>\n<h1>Hardware Tools<\/h1>\n<p style=\"text-align: justify\">To get started only two things are needed \u2013 a prototyping\/development board and a programmer called NuLink. \u00a0There are two options either you can buy the expensive official NuTiny SDK boards with built-in NULink programmer\/debugger or you can buy the cheap unofficial ones as shown below.<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/programmer-board.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-14223\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/programmer-board-580x391.png\" alt=\"programmer + board\" width=\"580\" height=\"391\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/programmer-board-580x391.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/programmer-board.png 636w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>My personal choice is the unofficial one.<\/p>\n<p>&nbsp;<\/p>\n<h1>Software Tools<\/h1>\n<p style=\"text-align: justify\">Despite Nuvoton being a giant in manufacturing some of the industry\u2019s coolest chips, it greatly lags in terms of software tools. Unlike other manufacturers like STMicroelectronics and Microchip, Nuvoton doesn\u2019t have a free C compiler of its own. To use Nuvoton 8-bit micros, we have to use either <strong><em><a href=\"http:\/\/www.keil.com\/\">Keil Micro Vision<\/a><\/em><\/strong> or <strong><em><a href=\"https:\/\/www.iar.com\/iar-embedded-workbench\/\">IAR Embedded Workbench<\/a><\/em><\/strong>. Both industry-standard tools but are not free. However, there are trial and evaluation versions of these tools.<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/keil-vs-iar.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-14221\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/keil-vs-iar-580x133.png\" alt=\"keil vs iar\" width=\"580\" height=\"133\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/keil-vs-iar-580x133.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/keil-vs-iar.png 933w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>The next stuffs that we will be needing are device datasheet, drivers, GUI for NuLink and sample codes with Nuvoton\u2019s official header and source files. These are available <a href=\"http:\/\/www.nuvoton.com\/hq\/products\/microcontrollers\/8bit-8051-mcus\/low-pin-count-8051-series\/n76e003\/?__locale=en\">here<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">We will also be needing a pin map because there are few pins in N76E003 and they have multiple functions.<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/N76E0031.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-14239\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/N76E0031-580x282.png\" alt=\"N76E003\" width=\"580\" height=\"282\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/N76E0031-580x282.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/N76E0031-1024x499.png 1024w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/N76E0031.png 1269w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<h1>How to get started?<\/h1>\n<p style=\"text-align: justify\">I have made two videos \u2013 one for Keil and the other for IAR. These videos show in details how to start building projects with N76E003 using these compilers.<\/p>\n<p><iframe loading=\"lazy\" width=\"860\" height=\"484\" src=\"https:\/\/www.youtube.com\/embed\/hJ-SyFDZ8go?feature=oembed\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen><\/iframe><\/p>\n<p><iframe loading=\"lazy\" width=\"860\" height=\"484\" src=\"https:\/\/www.youtube.com\/embed\/xZ5gkk6WQpw?feature=oembed\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h1>Nuvoton Files<\/h1>\n<p style=\"text-align: justify\">No matter which compiler you use ultimately, you\u2019ll need the following header (<em>.h<\/em>) and source files (<em>.c<\/em>) to get things done properly. These are available in Keil BSP and IAR BSP zip files.<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Files.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-14227\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Files-580x115.png\" alt=\"Files\" width=\"580\" height=\"115\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Files-580x115.png 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2018\/05\/Files.png 585w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p style=\"text-align: justify\">Now what these files do? These files make up something like a standard peripheral library. They define registers and functions that are needed to simplify coding. These files replace tradition register-level access to meaningful codes. For instance, the <strong><em>Delay<\/em><\/strong> files dictate the software delay functions by using hardware timers. Likewise, <strong><em>SFR_Macro <\/em><\/strong>and <strong><em>Function_Define<\/em><\/strong> files define hardware-based functions and SFR uses. I highly recommend going through the files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many of us who are involved in the embedded system industry like 8-bit microcontrollers. They are cheap, easy to use and solve most of the common automation problems. 32-bit micros are in that contrast expensive and are mainly intended for advance-level works that cannot be solved with 8-bit micros. Thus, 32-bit micros are not much demanding as the 8-bit ones. In most places, 8051s, AVRs and PICs are the most used 8-bit micros. The popular Arduino platform is mainly based on 8-bit AVR micros. However, these are not the only 8-bit micros of the whole embedded world. Nuvoton &#8211; a<\/p>\n","protected":false},"author":5,"featured_media":14228,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1723,1466],"tags":[1646,1722,1721,1720],"class_list":["post-14219","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nuvoton","category-tutorials","tag-8-bit-microcontroller","tag-1722","tag-n76e003","tag-nuvoton"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/14219","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=14219"}],"version-history":[{"count":6,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/14219\/revisions"}],"predecessor-version":[{"id":14258,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/14219\/revisions\/14258"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/14228"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=14219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=14219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=14219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}