Proteus and Keil Cx51 microcontroller simulation (flowing light)

Publisher:TranquilBreezeLatest update time:2015-12-25 Source: eefocusKeywords:proteus  keil  Cx51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Proteus circuit diagram

Keil Cx51 program:

#include
sbit VD9=P0^0;  sbit VD10=P0^1; 
sbit VD11=P0^2; sbit VD12=P0^3;
sbit VD13=P0^4; sbit VD14=P0^5;
sbit VD15=P0^6; sbit VD16=P0^7;
sbit VD1=P1^0; sbit VD2=P1^1;
sbit VD3=P1^2; sbit VD4=P1^3;
sbit VD5=P1^4; sbit VD6=P1^5;
sbit VD7=P1^6; sbit VD8=P1^7;
sbit VD17=P3^0;  sbit VD18=P3^1;
sbit VD19=P3^2; sbit VD20=P3^3;
sbit VD21=P3^4; sbit VD22=P3^5;
sbit VD23=P3^6; sbit VD24=P3^7;
sbit VD25=P2^0; sbit VD26=P2^1;
sbit VD27=P2^2; sbit VD28=P2^3;
sbit VD29=P2^4; sbit VD30=P2^5;
sbit VD31=P2^6; sbit VD32=P2^7;
void delay(){unsigned char i,j;
for(i=0;i<255;i++)
for(j=0;j<255;j++);}
void main()
{
while(1)

//P1口循环亮
VD32=1;VD1=0;delay();
VD1=1;VD2=0;delay();
VD2=1;VD3=0;delay();
VD3=1;VD4=0;delay();
VD4=1;VD5=0;delay();
VD5=1;VD6=0;delay();
VD6=1;VD7=0;delay();
VD7=1;VD8=0;delay();
//P0口循环亮
VD8=1;VD9=0;delay();
VD9=1;VD10=0;delay();
VD10=1;VD11=0;delay();
VD11=1;VD12=0;delay();
VD12=1;VD13=0;delay();
VD13=1;VD14=0;delay();
VD14=1;VD15=0;delay();
VD15=1;VD16=0;delay();
//P3口循环亮
VD16=1;VD17=0;delay();
VD17=1;VD18=0;delay();
VD18=1;VD19=0;delay();
VD19=1;VD20=0;delay();
VD20=1;VD21=0;delay();
VD21=1;VD22=0;delay();
VD22=1;VD23=0;delay();
VD23=1;VD24=0;delay();
//P2口循环亮
VD24=1;VD25=0;delay();
VD25=1;VD26=0;delay();
VD26=1;VD27=0;delay();
VD27=1;VD28=0;delay();
VD28=1;VD29=0;delay();
VD29=1;VD30=0;delay();
VD30=1;VD31=0;delay();
VD31=1;VD32=0;delay();
}
}

Keywords:proteus  keil  Cx51 Reference address:Proteus and Keil Cx51 microcontroller simulation (flowing light)

Previous article:Summary of 51 MCU timer counter interrupt
Next article:Microcontroller simulation of proteus and keil Cx51 (button lighting)

Recommended ReadingLatest update time:2024-11-16 17:37

Use Keil2 software to simulate the time of delay statement
First click option for target 'target1' under project Change the crystal frequency to 11.0592MHz, which is consistent with the crystal frequency on the TX-1C test board Then click the start/stop debug session button under debug to debug The delay code is as follows #include reg52.h //Int integer variables are
[Microcontroller]
Use Keil2 software to simulate the time of delay statement
How to solve the error when using JLink in Keil
What should I do when an error occurs when using JLink with STM32 under Keil?  I have been studying the porting of STM32 and ucos recently, using the keil u4 version as the development environment. The emulator is a jlink purchased for 80 yuan. After learning about the STM32 firmware library and the ucos kernel and
[Microcontroller]
How to solve the error when using JLink in Keil
MCU + ADC0832 simple digital voltmeter proteus simulation and program source code
The ADC0832 voltmeter simulation schematic is as follows The source program of the microcontroller voltmeter is as follows: #include reg52.h #include intrins.h #define uint unsigned int #define uchar unsigned char          sbit CS =P3^4; //Chip select enable terminal sbit DI =P1^1; //Data signal input terminal, s
[Microcontroller]
MCU + ADC0832 simple digital voltmeter proteus simulation and program source code
Add ASM code to Keil C51 function
Using C51 to program a microcontroller is a much easier and more efficient way to do it, but for many algorithmic and compiling problems, it is often more convenient and efficient to use ASM code. But for some reason, Keil is much more troublesome than SDCC in implementing C51 mixed with ASM code. The method is as foll
[Microcontroller]
Microcontroller simulation of proteus and keil Cx51 (button lighting)
Circuit diagram C program: #include reg51.h sbit K01=P1^4; sbit K02=P1^5; sbit K03=P1^6; sbit K04=P1^7; sbit VD17=P3^0; sbit VD18=P3^1; sbit VD19=P3^2; sbit VD20=P3^3; void delay() {unsigned char i,j;for(i=0;i 255;i++)for(j=0;j 255;j++);} //Delay program void main() { while(1) { if(K01==0)//P1
[Microcontroller]
ARM9 key interrupt problem under keil
I have been struggling with the fact that the startup file that comes with MDK cannot be interrupted. I thought the file was missing some configurations, and there was a lot of discussion online about it! ! ! ! ! ! ! Actually it is not true!!! With the help and inspiration of a kind teacher, I found that as long as IR
[Microcontroller]
Keil5 tutorial
1. Create a project   First, create a folder on the desktop, then open KEIL5 and select: project- new μVision project- select the created folder and name it- select the main control chip model- OK   When selecting the chip model, if it is a 51 chip, select the generic type under Generic. If it is a 32 microcontrolle
[Microcontroller]
Keil5 tutorial
Make KEIL have both 51 and ARM compilation functions
Install 51 and ARM KEIL separately, they are in different folders, in order to extract the C51 folder. Then the question is, can they be installed in the same folder? Theoretically it works, but I haven't tried it. It's actually very simple, here are the steps: 1. First, move the folder named C51 in the KEIL C51 insta
[Microcontroller]
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号