NAME: u2440mon.c
DESC: u2440mon entry point,menu,download
****************************************************************/
#define GLOBAL_CLK 1
//头文件
#include
#include
#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
#include "2440slib.h"
#include "mmu.h"
#include "profile.h"
#include "memtest.h"
#include "clock.h"
void Isr_Init(void);
//******************************************
//Test function
void test_led(U32 i)
{
rGPBDAT =~ (1<
}
//延时
void delay(U32 i)
{
U32 del;
while(i--)
{
for(del=0;del<1000000;del++);
}
}
/****************************************Main function********************************************/
void Main(void)
{
/******************************************************************************
Hardware initialization
**********************************************************************/
MMU_Init(); //Initialize MMU
Port_Init(); //Initialize I/O portIsr_Init
(); //Disable all
interruptscal_cpu_bus_clk(); //Clock division 1:4:8, FCLK = 400MHZ, HCLK = 100MHZ, PCLK = 50MHZ, UCLK=48MHZ
Uart_Init( 0,115200 ); //Initialize serial port 0, baud rate 115200
Uart_Select( 0 ); //Select serial port 0, pass global parametersUart_SendByte
('\n');
Uart_Printf("GT2440 TEST \n");
Uart_Printf("*******************Init clock :*******************\n\n");
Uart_Printf("HCLK= %d ,PCLK= %d, FCLK= %d\n\n",HCLK,PCLK,FCLK);
Uart_Printf("*******************Init uart0 :*******************\n\n");
Uart_Printf(" Enter= 0 ,RATE= 115200 \n\n");
//---------------------------------------------------------------------------
/********************************************************************************
User test program
****************************************************************************/
//GPB5: LED1, GPB6: LED2, GPB7: LED3, GPB8: LED4
//00: input, 01:
outputrGPBCON = (0X01<<5*2)+(0X01<<6*2)+(0X01<<7*2)+(0X01<<8*2);
//GPDAT = 1, output high
levelrGPBDAT = 0Xff<<5;
while(1)
{
test_led(5); //LED1 is on
delay(10);
test_led(6); //LED2 is on
delay(10);
test_led(7); //LED3 is on
delay(10);
test_led(8); //LED4 is on
delay(10);
test_led(7); //LED7 is on
delay(10);
test_led(6); //LED6 is on
delay(10);
}
}
/**********************Interrupt setting****************************/
void Isr_Init(void)
{
rINTMOD=0x0; // All=IRQ mode
rINTMSK=BIT_ALLMSK; // All interrupt is masked.
}
Previous article:S3C2410 Interrupt Register
Next article:Design of GPRS network electric energy meter
Recommended ReadingLatest update time:2024-11-15 14:52
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- How Smart Battery Fuel Gauges Can Effectively Improve Battery Life in Continuous Glucose Monitors
- Are 51 single-chip microcomputers still used now? I used this single-chip microcomputer when I was in college.
- [Mill Edge AI Computing Box FZ5 Review] VCU with DP interface plays mp4 video
- MSP430 CPU and MSP430X CPU
- EMC conducted emission receiver coupling method
- Showing off the goods + the board that got me into it
- EEWorld 15th Anniversary Tool DIY Event Summary
- I need help from the experts on a question about proteus8
- [Solved] How to start DSP on ARM
- Recruitment position in Xiamen IC design company: MCU product development engineer