NPEDUCATIONS, Electronic circuits development, electronics tutorials, microcontroller tutorials and projects, advanced microcontroller (ARM) based tutorials and projects, Embedded c development, Embedded c for ARM cortex M, Intel IoT based projects, IoT projects, CC3200 launch pad projects, MSP430 Launchpad tutorials and projects, Tiva C launch pad tutorials and projects, 8051 tutorials and projects, sensor interfacing with microcontroller tutorials, data communications and networking tutorials, peripheral interfacing with microcontroller, led message scrolling display, arduino based tutorials and projects, intel galileo based tutorials and project, ADC interfacing tutorials, LED Blinking, LCD interfacing, Embedded System tutorials and projects, B.tech projects, M.tech projects, online Embedded C training

How to Glow an LED using ARM9 Processor Samsung S3C2440


In this tutorial, I am going to show how to glow an LED using ARM9 Processor with ADS V1.2 tool. This tutorial describes how to use ADS integrated Developed Environment (IDE). It includes how to create a new project for ARM9 applications in ADS V1.2 environment, how to configure compiler, linker and Debugger settings, How to generate bin executable file, and finally debugging the application.
Creation of New project in ADS V1.2:

Open ADS V1.2, now click File > New, open a window as shown.

Creating A New Project in ADS V1.2 tool by selecting ARM Executable Image Option
ARM Executable Image: used by the ARM instruction code to generate ELF format images files can be implemented.
After by pressing ok button, the IDE shows project files as LED_Blinking.mcp as shown below.

Creating a New C file:
Now simply click on the new text file button as top Left corner as shown below.


Creating New File
Now Type your program in it..

Embedded C Program: 

#define            GLOBAL_CLK                    1   // This is necessary to refer PCLK variable in the
                                                                // Option.h header file
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
#include "2440slib.h"
#include "mmu.h"
#include "profile.h"

void GenerateDelay(int);
#define LED  (1ul << 1)  
void Main(void)
{
// initialize GPIO port -- PORT J
   rGPJCON = 0x555555;  //All the pins of GPJ port is configured as OUTPUT pins
   rGPJUP  = 0x000000;  //Corresponding bits of the PORTJ, Internal PULLUP is enabled
   rGPJDAT = 0x000000;  //Initially all the port pins are at LOGIC LOW
   while(1)
   {
// Make LED to ON
                                    rGPJDAT |= LED;
                                    GenerateDelay(5000); // This function generates 5000 * 6microseconds as
                                                                        // per simulator, if ARM9 Clk Freq = 12MHz
// Make LED to OFF
                                    rGPJDAT &= ~LED;
                                    GenerateDelay(5000);
            }
  
 }
void GenerateDelay(int value)
{
            for(;value!=0;value--); // the delay function generation 6 micro seconds
}



Now save and add this file to Project LED_Blinking.mcp as shown in below figure
Adding C file to the Project


Now add necessary header files :


Adding All required files


Don’t worry all the code and files shown in this image are uploaded in this site below

Target settings:
Set required fields as shown in the figure.


ARM9 traget settings

ARM Assembler or C compiler Settings:
In this settings > Architecture or processor settings > ARM920T as shown in below figure

Assembler and C compiler settings

Linker Settings:
Set RO base field to 0x30000000 in the Output TAB

Setting RO Base value

Enter Image Entry Point as 0x30000000 in option TAB:

Image Entry point value gives the starting execution address

Enter Object/Symbol in the LAYOUT TAB:


Select Image Map field and mention list file name in the listings TAB:


Map file and List files
Press OK button

Debugger Settings:


Debugging Settings

All The Project Files:


1 comment :

  1. your blogspot is very useful..

    can you tell me same LED blinking for S3C2440A in keil tool.

    I have done in keil for blinking LED in S3c2440A NOR mode.

    but in NAND flash it doesnt working.. how to setup in keil for blinking LED in NAND mode of s3c2440..

    Help me.. am struggling here.

    Thanks in advance..

    ReplyDelete

Thanks for visiting NPEDUCATIONS. We will contact you soon

1 comments :

munees said...

your blogspot is very useful..

can you tell me same LED blinking for S3C2440A in keil tool.

I have done in keil for blinking LED in S3c2440A NOR mode.

but in NAND flash it doesnt working.. how to setup in keil for blinking LED in NAND mode of s3c2440..

Help me.. am struggling here.

Thanks in advance..

Post a Comment

Thanks for visiting NPEDUCATIONS. We will contact you soon

If you really like this tutorial, Don't forget to give the comment or please subscribe to the RSS feed by submitting your E-mail or like our Facebook page.
Related Posts Plugin for WordPress, Blogger...

 
Powered by Blogger