1、led led cpuramrom/: 12345-8051i/omcs51ledled- 1. -2. c 3. 1. 2.led 3.- ledledp1.0led1p1.0p1.0led1p1.0p1.1p1.77ledled1led- at89c51p18ledc2.1 led-at89c51 1at89c514k128ram32i/o216/5at89c510hz-cpuram/ram at89c51 2ledled p23.2 led- ledled 1101de2ledde2ledstep14-5-6-7-8-9-4-5-6-7-8-9-41. 50mhz1hzquartusve
2、rilog hdl50mhz1hzin50mhzout1hz2. 7419194qdqcqbqa101074191dcba=0100quartuslab054-9ledledledde2ledledled-88-7-6-5-4-3-2-1-8-7-6-5-4-3-2-174191jk8quartus8181led-ledde218led2ledledledledled50mhz12hzverilogverilog50mhz-12hz74900-97442led7442de2led- 101 -ledlight emitting diodeledpnp-nppled-p-n 330 105/40
3、0v 390 18 4 8 led - led led - rxd txd 1 led 1 ., - led led led1. 2.3.- 4. 5.6. 7.-proteusproteus-1s.sc5204keilproteus-1. 8led74hc573p00 12. 8d74hc573 1 2 3474hc5733. sc5204-1. keil8led 1 21 2.hex3.proteus-.hex 4.stc-ispsc5204-*.asmu1. *.asm 2.proteus-3.*.asm4.5.1. 2. ,:;0o3. -12mhz4. 0000h5. 2.1clr
4、p0.5org 0000h ljmp main org 0100hmain: setb p1.1mov p0,#0xffclr p1.1 ; setb p1.3mov p0,#0x00clr p1.3 ;setb p1.2 ;led clr cmov r0,#01h ;chongzhuang: mov r3,#14 ;r3 xunhuan:mov a,r0cpl a ; mov p0,a acall yanshi mov a,r3subb a,#8 ; jnc left ;leftmov a,r0 rr amov r0,a ;r0- ajmp again left: mov a,r0rl am
5、ov r0,a again: dec r3mov a,r3 clr cjz chongzhuang ;r3 ajmp xunhuan ;-yanshi: ;mov r4,#5 ys0: mov r2,#0ffh ys1: mov r1,#0ffh ys2: djnz r1,ys2 djnz r2,ys1 djnz r4,ys0 retendledmcs-51 proteusled1proteus-2keilcc512proteus-1windows2proteus3keilc80518led 30isis-1keilc2-4play,cpuat89c51mcs-51cpucrystalcapa
6、citors22pfcap-elecgenelect10u16vminres10kminres330rbuttonledled-blue/red/yellowdiode-led.c#include reg52.h#define uint unsigned int#define uchar unsigned charconst tab1=0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f, /*/0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe,0xff,;/*/const tab2=0xff,0x00,0xff,0x00,0xff,0x00,;void delay()uint i,j;for(i=0;i256;i+)for(j=0;j256;j+);void int1() interrupt 0uchar i;for (i=0;i6;i+) p0=tab2i;delay();void main(void)ex0=1;it0=1;ea=1;while(1)uchar x;for(x=0;x15;x+) p0=tab1x;delay();keilproteus-