Build a single board computer with a 8051-compatible microcontroller, ATMEL 89S52.
MTK51 is a single board computer that uses the ATEML 89S52 microcontroller as the CPU. The board provides a 32kB RAM (code memory) for user program and a 32KB ROM for monitor program. The board is designed for studying the microcontroller hardware and instruction coding. We can enter HEX code directly to the code memory and test the code with single step running, check the result of the operation with user registers. The kit also provides more devices interfacing, e.g. ADC, EEPROM, RTC, RELAY, Programmable Port, serial ports RS232, and RS485. The MCU can run both single chip or expand modes as well.
Block Diagram of the MTK51 8051 Microcontroller Trainer.
Offset byte calculation for relative addressing mode,
Insert AJMP and ACALL hex code to the code memory,
Insert byte and delete byte,
Clear code memory,
Quick home location key.
Schematic of the MTK51 8051 Microcontroller Trainer.
Simple program demos entering the machine code and execution with single step.
The code shown below will increment the accumulator content by one. The hex code for this simple program has only 3 bytes, i.e. 04 01 00. The video shows how to enter the hex code, how to insert the AJMP instruction and how to run it with key STEP. We will see the right-hand 8-bit LED (GPIO3) counting up.
ADDRESS
HEX CODE
LABEL
INSTRUCTION
COMMENT
9000
04
MAIN
INC A
A=A+1
9001
01 00
AJMP MAIN
go back main
Running full speed with forever loop program
Another sample is the forever loop running. The accumulator contents will write to GPIO3 using indirect mode through DPTR, then increment and the delay subroutine will be called. The program is repeated forever with AJMP MAIN instruction. The subroutine DELAY is simple delay code by counting two registers, R7 and R6.
ADDRESS
HEXCODE
LABEL
INSTRUCTION
COMMENT
9000
90 04 00
MAIN
MOV DPTR,#400H
DPTR=400H
9003
F0
MOVX @DPTR,A
A->GPIO3
9004
04
INC A
A=A+1
9005
11 09
ACALL DELAY
CALL DELAY
9007
01 00
AJMP MAIN
goback main
9009
7F 00
DELAY
MOV R7,#0
900B
7E 00
INNER
MOV R6,#0
900D
DE FE
DJNZ R6,$
900F
DF FA
DJNZ R7,INNER
9011
22
RET
See the video, how to enter the hex code and run with key RUN. To end and get back to monitor program, press RESET key.