Samsung 2440 ARM initialization

Publisher:春水碧于天Latest update time:2019-10-30 Source: eefocusKeywords:Samsung Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Use the initialization file that Samsung has already written


1. Create a project folder first
2. Create a project and save it in the new folder
3. Drag the INC and SRC folders in the INIT folder written by ARM Samsung into the new folder.
4. Create a C file, such as LCD1602.c, and write a void xmain() function or a void xxxx() function
5. Add 2440init in SRC to the project.
6. Change the corresponding main function entry in 2440init to the function xmain in LCD1602.c. This is very important so that other functions can be written by adding header files, otherwise they cannot be executed. See the figure below 






2. Write your own initialization
1. Create a project folder first
2. Create a project and save it in the new folder (the path is in English)
3. Create your own initialization function init.s. The initialization file must be written in assembly language. At least the following code is required (this is very important)
                    MPORT name AREA Init,CODE,READONLY
                    ENTRY  
                    bl name
                    end
   Note: name must be the main function name, other functions can be written according to the general writing method of C files, such as the following program code:
#include"2440addr.h" //Defines the address and name of each special function register. This header file must be called to use it./*===
If this header file is not called, the definition name and address statement to be used must be declared before the main program.
#define rGPBCON (*(volatile unsigned *)0x56000010)//Port B control
#define rGPBDAT (*(volatile unsigned *)0x56000014)//Port B data
#define rGPBUP (*(volatile unsigned *)0x56000018)//Pull-up control */    
/* Custom simple delay program */ 
int name(int times)
{
    int i;
    for(i=0;i    return 0;
}

/* Main program */
void xmain(void) //The main function name corresponds to the main function entry address and is defined in 2440init.s
{ //Do not write main or Main at will, check the 2440init.s file (see the figure below)


        rGPBCON |=0x3fc00; //GPB5-8 able output, first let 11 1111 11xx xxxx xxxx
        rGPBCON &=0x157ff; // 00-in 01-out 01 0101 01xx xxxx xxxx
                                         // P8 P6P7 P5P4 P3P2 P1P0
                                               // G GG G x xx xx
while(1)
    {

             rGPBDAT|=0x1e0;//GPB8 output 0 1 111x xxxx
             rGPBDAT&=0xeff;// 0 111x xxxx
             delay(5);//Call the delay program written in assembly language 

             rGPBDAT|=0x1e0;//GPB7 output 0 1 111x xxxx
             rGPBDAT&=0xf7f;// 1 011x xxxx
             delay(5);//Call the delay program written in assembly language 


             rGPBDAT|=0x1e0;//GPB6 output 0 1 111x xxxx
             rGPBDAT&=0xfbf;// 1 101x xxxx      
             delay(5);//Call the delay program written in assembly language 

             rGPBDAT|=0x1e0;//GPB5 output 0 1 111x xxxx
             rGPBDAT&=0xfdf;// 1 110x xxxx       
             delay(5);//Call the delay program written in assembly language 


    }
}

You can also continue to follow the steps below to add
4. Use the header file method to write the sub-functions you need in the form of header files.h. Write as many sub-functions as you need.
5. Write your own main function. The name of the main function should be the same as the name in the initialization function.
6. Add the above files to the project. 

Keywords:Samsung Reference address:Samsung 2440 ARM initialization

Previous article:ARM reads DS1302 assembly program
Next article:ARM 2440 naked implementation of electronic clock

Recommended ReadingLatest update time:2024-11-16 07:41

u-boot-2011.06 supports NandFlash reading and writing in the transplantation based on s3c2440 development board
Since the NandFlash controllers of s3c2410 and s3c2440 are different, the s3c2440_nand.c file cannot be directly applied and needs to be modified appropriately. The main modification is the related registers of s3c2440. First, redefine the registers to be used, remove the macro definitions between lines 27 to 3
[Microcontroller]
s3c2440 bare metal - norflash3 - operating norflash in uboot
Prerequisite: norflash is initialized normally and can be executed normally from nor. The CPU always reads instructions from address 0 to execute the program. When the CPU is set to start with NOR, address 0 corresponds to NOR. When the CPU starts with NAND, address 0 corresponds to SRAM. 1. Read norFlash
[Microcontroller]
S3C2440③ | GPIO Experiment
Experiment 1 - Lighting up an LED 1. Look at the schematic to determine how the hardware is connected The schematic diagram shows the hardware circuit of the chip controlling the LED and how the chip pins are connected to the LED. 2. Check the main chip manual to determine how to control t
[Microcontroller]
S3C2440③ | GPIO Experiment
s3c2440 bare metal - code relocation - 3 - clear bss principle and implementation
1. Introduction of BSS clearing (Why do we need to clear BSS) Let's take an example: #include "s3c2440_soc.h" #include "uart.h" char g_Char = 'A'; //.data char g_Char3 = 'a'; const char g_Char2 = 'B'; //.rodata int g_A = 0; //bss
[Microcontroller]
Sources say Samsung is cooperating with Japanese company MEIKO to develop smart rings
According to reports from Korean media The Elec on July 18, Samsung has reached a cooperation with the Japanese company Meiko Electronics Co., Ltd. (MEIKO) to jointly promote the smart ring project. The report states that Meiko Electronics is responsible for manufacturing the printed circuit board (PCB) of the smart
[Internet of Things]
S3C2440 Initialize Clock
1. S3C2440 clock 1. Clock Tree From the clock tree in the technical manual of s3c2440, we can know that its clock is divided into four blocks: FCLK, HCLK, PCLK, and UCLK. FCLK is mainly used for the operating clock of the CPU, HCLK is mainly used for the clock of some high-speed devices such as memo
[Microcontroller]
S3C2440 Initialize Clock
Linux 2.6.32 ported to arm9 (s3c2440) platform - Title should be long (2)
(1) The code of nand flash part of s3c2440 platform, "Before you figure out why every step of porting the code is necessary, don't do the so-called porting. It's meaningless." *****/arch/arm/plat-s3c24xx/common-smdk.c***** static struct mt
[Microcontroller]
BOE and other four domestic screen giants join forces to declare patent invalidity against Samsung Display
According to The Elec, four Chinese panel companies, including BOE, TCL CSOT, Visionox, and Tianma Micro, filed a patent invalidation trial against Samsung Display in the United States. This is regarded as a request by Chinese panel manufacturers to the United States for patent infringement against Samsung Display. Th
[Semiconductor design/manufacturing]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号