Microcontrollers: views : 23

Nuvoton basic steps to write code/programming using Keil IDE (Nuvoton beginner tutotial)

To write you first code for your Nuvoton microcontroller chip you need a laptop with Keil IE software installed on it. A hardware that burn your binary (hex code generated from keil IDE) to the microcontroller. Here i am using Nu-Link Plus burner to upload code to microcontroller. Software to download code can be directly from Keil or you can use Nuvoton Numicro ICP programming tool 3.10 8051 T1 series. Here i will tell you basic steps to start coding and downloading hex code to your Nuvoton microcontroller


Start new project in keil IDE

Open Keil IDE software and at to menu,click on project > new uvision project as shown in image below. Next you will ask to name a project to create a file to your folder. Then select your target microcontroller group/series and click ok. Then you will ask to Copy "MS51_STARTUP.A51" to project folder and add file to project, click on "yes".



Add source code file to your project to start writing your code on it

Right click on source group 1 > add new item to source group 1 > select programming language (i am choosing c language here) and name your file anything but commonly named as main.c and click on "add". Then paste this code to the main.c file which is already created and open by you.

/* BLINKY.C - LED Flasher for the Keil MCBx51 Evaluation Board with 80C51 device*/
                  
#include <REG51F.H>

// When you have enabled the option Stop Program Execution with Serial
// Interrupt, the Monitor-51 uses the serial interrupt of the UART.
// It is therefore required to reserve the memory locations for the interrupt
// vector.  You can do this by adding one of the following code lines:

// char code reserve [3] _at_ 0x23;   // when using on-chip UART for communication
// char code reserve [3] _at_  0x3;   // when using off-chip UART for communication

void wait (void)  {                   /* wait function */
  ;                                   /* only to delay for LED flashes */
}

void main (void)  {
  unsigned int i;                     /* Delay var */
  unsigned char j;                    /* LED var */

  while (1) {                         /* Loop forever */
    for (j=0x01; j< 0x80; j<<=1)  {   /* Blink LED 0, 1, 2, 3, 4, 5, 6 */
      P1 = j;                         /* Output to LED Port */
      for (i = 0; i < 10000; i++)  {  /* Delay for 10000 Counts */
       wait ();                       /* call wait function */
      }
    }

    for (j=0x80; j> 0x01; j>>=1)  {   /* Blink LED 6, 5, 4, 3, 2, 1 */
      P1 = j;                         /* Output to LED Port */
      for (i = 0; i < 10000; i++)  {  /* Delay for 10000 Counts */
       wait ();                       /* call wait function */
      }
    }
  }
}
 



Add package for Nuvoton microcontroller

You need to download Nuvoton Microcontroller package for keil IDE. This package is attached below, download it and unzip it get these folders:

  1. Document
  2. MS51DA9AE_MS51BA9AE
  3. MS51FB9AE_MS51XB9AE_MS51XB9BE
  4. MS51FC0AE_MS51XC0BE_MS51EB0AE_MS51EC0AE_MS51TC0AE_MS51PC0AE
  5. LICENSE.txt
  6. NOTICE.txt

Copy these to a new folder name as "library" in your project folder. Then go to the target settings and click of "A51" tab and add link to the folder that contain LibraryDeviceInclude and LibraryStdDriverinc. as show in image bellow



Share this page with your friends
share via Whatsapp

Posted By :
Mahesh Nigam
(Scientist)
2023-05-01 01:51
See Author's other Published Topics

Happy Teacher’s Day of Dear Madam, Thank You For continually Inspiring me to do my best..
Dear Madam, Thank You For continually Inspiring me to do my best..
Happy teachers day of Thank you for teaching me how to read and write, for guiding me to distinguish between what is wrong and what is right. For allowing me to dream and soar as a kite, thank you for being my...
Thank you for teaching me how to read and write, for guiding me to distinguish between what is wrong and what is right. For allowing me to dream and soar as a kite, thank you for being my...
A good teacher is like a candle of A good teacher is like a candle – it consumes itself to light the way for others..
A good teacher is like a candle – it consumes itself to light the way for others..
The teacher who is indeed wise of The teacher who is indeed wise does not bid you to enter the house of his wisdom but rather leads you..
The teacher who is indeed wise does not bid you to enter the house of his wisdom but rather leads you..
Happy World Teachers' Day! of I am proud to let you know that you have been the great teacher in my life! Happy World Teachers' Day!...
I am proud to let you know that you have been the great teacher in my life! Happy World Teachers' Day!...
Happy teachers day of Without you, we would have been lost. Thank you teacher for guiding us, inspiring us And making us..
Without you, we would have been lost. Thank you teacher for guiding us, inspiring us And making us..
Wishing you a Teacher's Day of I was lucky to have a teacher as wonderful as you are. Wishing you a Teacher's Day that’s full of joyous...
I was lucky to have a teacher as wonderful as you are. Wishing you a Teacher's Day that’s full of joyous...
 Happy Teacher's Day! of Teacher, you have always challenged me to work hard and get good grades. I will always remember you. Happy Teacher's Day!...
Teacher, you have always challenged me to work hard and get good grades. I will always remember you. Happy Teacher's Day!...
Happy Teacher's Day! of The best teachers teach from the heart, not from the book. Thank you for being a wonderful teacher. Happy Teacher's Day!..
The best teachers teach from the heart, not from the book. Thank you for being a wonderful teacher. Happy Teacher's Day!..
Happy Teacher’s Day of Happy Teacher’s Day! It has been an honor to get to learn so many...
Happy Teacher’s Day! It has been an honor to get to learn so many...
Wishing you joy and happiness of Wishing you joy and happiness, you are an amazing teacher, and you only..
Wishing you joy and happiness, you are an amazing teacher, and you only..

Peoples

Comments...

Write Your Comment

Related to Microcontrollers

Latest topics




More Categories
latest mobile phones ireps.gov.in irctc.co.in Working Principle Viral Discussion True Love quotes True Love Today is Celebrated For Tips for better life Tips and Hacks Technology News Teachers Day Quotes Study Materials Self Motivating Quotes Science Sad Lines (Sayeri) Romantic shayari quotes Robotics Reviews Results Questions_and_Answers Programming Problem Resolved PHP Codes PCB Design Online Works New Year Quotes Shayari Status My World My Responsibilities Motivational lines Mobile Issues Microcontrollers Lucknow Local News Latest Technology Iphone Homeopathy Historical place in India Heart Touching Love Quotes Health Good Night Quotes Good Morning Quotes GeM.gov.in GST portal Funny Lines (Sayeri) Friendship Quotes Food Recipes Exam Time Table Engineering Project Ideas Electronics Electronic and electrical project making ideas Electricals Educations Desh Bhakti Shayeri Criminal Love Cricket News Corona Updates Christmas Quotes Shayari Status CBSE Updates/Circulars Breaking News Breaking Heart Shayeri Break Up Lines (Sayeri) BirthDay Wishes Best kitchen Tips Best Valentine quotes Shayeri Beauty Hacks Basic Knowledges Attitude quotes shayari Attitude quotes Attitude quotes Assembly Election 2022
Go to top

Important Links

  • Contact Us
  • About Us
  • All copyright © 2020 are reserved by Groomix - designed by Groomix

    MORE

    Microcontrollers >
    latest mobile phones >
    ireps.gov.in >
    irctc.co.in >
    Working Principle >
    Viral Discussion >
    True Love quotes >
    True Love >
    Today is Celebrated For >
    Tips for better life >
    Tips and Hacks >
    Technology News >
    Teachers Day Quotes >
    Study Materials >
    Self Motivating Quotes >
    Science >
    Sad Lines (Sayeri) >
    Romantic shayari quotes >
    Robotics >
    Reviews >
    Results >
    Questions_and_Answers >
    Programming >
    Problem Resolved >
    PHP Codes >
    PCB Design >
    Online Works >
    New Year Quotes Shayari Status >
    My World My Responsibilities >
    Motivational lines >
    Mobile Issues >
    Lucknow Local News >
    Latest Technology >
    Iphone >
    Homeopathy >
    Historical place in India >
    Heart Touching Love Quotes >
    Health >
    Good Night Quotes >
    Good Morning Quotes >
    GeM.gov.in >
    GST portal >
    Funny Lines (Sayeri) >
    Friendship Quotes >
    Food Recipes >
    Exam Time Table >
    Engineering Project Ideas >
    Electronics >
    Electronic and electrical project making ideas >
    Electricals >
    Educations >
    Desh Bhakti Shayeri >
    Criminal Love >
    Cricket News >
    Corona Updates >
    Christmas Quotes Shayari Status >
    CBSE Updates/Circulars >
    Breaking News >
    Breaking Heart Shayeri >
    Break Up Lines (Sayeri) >
    BirthDay Wishes >
    Best kitchen Tips >
    Best Valentine quotes Shayeri >
    Beauty Hacks >
    Basic Knowledges >
    Attitude quotes shayari >
    Attitude quotes >
    Attitude quotes >
    Assembly Election 2022 >

    Peoples

    Latest Comments