Introduction of XL2000 experimental
system ebay
store Shipped by UPS/ to USA/worldwide, (about 3-5 days)
Chapter VI of the single-chip experiment with
examplesLimited
by the space of this manual, here we provide several typical c51
application examples. To facilitate the novice to learn programming
C51, we will show the source code, running photo, line connection
method and principle schema for each examples. Of course, XL2000 is
not limited by the examples presented here, thanks for the module
design of this experimental instrument, user can configure the
hardware modules with most flexibility and program against the
configuration. By this way, user can have a comprehensive of C51
programming and designing.
For more asm and C sources, please refer to the examples in
the CD shipped with the package, as well as the latest update at: www.8951.com!
Experiment
1: The simplest eight way marquee program In
this experiment, delay subroutines, clr, lcall, ajmp instrunctions
will be used. Over these program elements, we can see eight lights
flashing in turn through P1.0 to P1.7 port. User can learn from this
example and have a initial grasp of the IO port programming. Practice
1: How to make the time of delay subroutine a bit shorter or longer? Practice 2: How to use P0, P2 and P3 ports to implement the same
control of 8-way lights? Practice 3: how to implement different patterns in the light
flashing? Related
schema:


reference
program: org 0000h
;start ajmp LOOP; jump to LOOP label org 0080h; get to 0030h to reserve some space LOOP: mov p1,#0ffh; turn off all lights clr p1.0
;turn on light at p1.0 lcall delay ;delay
for a while clr p1.1 ;turn
on light at p1.1 lcall delay clr p1.2
; lcall delay clr p1.3
; lcall delay clr p1.4
; lcall delay | clr p1.5 ; lcall delay clr p1.6
; lcall delay clr p1.7
; lcall delay AJMP LOOP; jump to LOOP and restart to run delay:
mov r5,#20 ; delay number。 d1: mov
r6,#40 d2: mov
r7,#248
djnz r7,$
djnz r6,d2
djnz r5,d1
ret end |
Connection methods:
connect P1 port (JP44) of the CPU with eight-way lights(JP32)
with one 8PIN cable. The connecting and program running photo like
below: (8 lights turn on/off one by one).
SHEN ZHEN XUELIN ELECTRONIC TECHNOLOGY
CO.,LTD. |
ADD:A302,XingJingYuan
,NanKeng,BanTian,SHENZHEN,GUANGDONG P.R.CHINA |