LPC2103 learning board - digital tube display

Publisher:快乐航程Latest update time:2016-09-06 Source: eefocusKeywords:LPC2103 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
LPC2103 Learning Board - Digital Tube Display - Xiaowen - Xiaowen Electronic Design

 Schematic diagram of the digital tube circuit:

LPC2103 Learning Board - Digital Tube Display - Xiaowen - Xiaowen Electronic Design

 

TRS and TMS use the JTAG port, so the normal IO function cannot be used during debugging. It is necessary to cancel the JTAG mode after the program is burned into the system to work normally.

LPC2103 Learning Board - Digital Tube Display - Xiaowen - Xiaowen Electronic Design
 
Source program:
/**************ARM7(LPC2103) exercise program**************************/
/****************************************************************/
/*****File Function: Digital tube display *****/
/*****Program Author : ClimberWin *****/
/*****MCU: LPC2103F external 12M crystal *****/
/*****Compile Date : 2010/04/01 *****/
/*****Edition Info : V1.0 *****/
/*****************************************************************/
//Compile environment KEIL for ARM 
//Data interface P0.10-P0.17
//Select end P0.25 P0.26 P0.27 P0.28
//Buzzer P0.21
//Note: The digital tube uses the JTAG pin, so JTAG needs to be disabled during operation to do normal IO processing. Otherwise, only two digital tubes can be selected.      
#include
#include
#define uint unsigned int
#define uchar unsigned char

//#define speak (1<<21) //Buzzer pin definition
#define COM1 (1<<25) //Define the enable pin of digital tube 1
#define COM2 (1<<26) //Define the enable pin of digital tube 2
#define COM3 (1<<27) //Define the enable pin of digital tube 3 
#define COM4 (1<<28) //Define the enable pin of digital tube 4

void delayms(unsigned int count);//delay program
void led_display(void);//display program
uchar LED_DATA[16]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E};
/******************Delay program******************/
void delayms(unsigned int count)
{
 unsigned int i,j;
 for(i =0;i  for(j=0;j<1000;j++);
}
void led_display(void)
{
float led_data;
   IO0CLR=0xffffffff; 
       led_data=LED_DATA[4]<<10;
    IO0SET=led_data; 
    IO0CLR=COM1;
    IO0SET=COM2;
    IO0SET=COM3;
    IO0SET=COM4;
   delayms(50);
   IO0CLR=0xffffffff; 
      led_data=LED_DATA[3]<<10;
    IO0SET=led_data; 
    IO0CLR=COM2;
    IO0SET=COM1;
    IO0SET=COM3;
    IO0SET=COM4;
   delayms(50);
  IO0CLR=0xffffffff; 
     led_data=LED_DATA[2]<<10;
    IO0SET=led_data; 
    IO0CLR=COM3;
    IO0SET=COM2;
    IO0SET=COM1;
    IO0SET=COM4;
   delayms(50);
  IO0CLR=0xffffffff; 
     led_data=LED_DATA[1]<<10;
    IO0SET=led_data; 
    IO0CLR=COM4;
    IO0SET=COM1;
    IO0SET=COM2;
    IO0SET=COM3;
   delayms(50);
}
//////////////Main program////////////////////
void main(void)
{
   PINSEL0 |= 0x00000000;           
      PINSEL1 |= 0x00000000;
    IO0DIR=0x1e03fc00; //Configure P0.10-P0.17 P0.25 P0.26 P0.27 P0.28 as output 
 while(1)
 {
  led_display(); 
 }
}

Keywords:LPC2103 Reference address:LPC2103 learning board - digital tube display

Previous article:LPC2103 Learning Board - Buzzer Practice Program
Next article:LPC2103 Learning Board-LED Flowing Light

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
Guess you like

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号