The Design and Implementation of Table tennis serving machine 作者:吳委俊、徐億修、吳丞譽、林子揚 系級:電機工程學系 二乙 學號:D0075057、D0073987、D0073779、D0031876 開課老師:何子儀 課程名稱:微處理機系統實習 開課系所:電機工程學系 開課學年:101 學年度 第 2 學期
8051 0~9 關鍵字 關鍵字關鍵字 關鍵字::::
Abstract
Nowadays, table tennis serving machine is very common but not cheap. The main aim of this project is to design and implement a table tennis seving machine based on a microcontroller. Consequently, it can reach the same effects with the effective cost. Since it is a simple and cheap device, most of people can afford as well.
The table tennis serving machine designed in this project is composed of a bucket and a microcontroller-based motor drive. The balls are placed in the bucket and pushed along the gear to a tube. We use the motor to control the gear. There is another motor equipped with a plastic wheel located on the top of the tube. We use 8051 microcontroller to control the speed of motor and shoot the balls. For convenience, there is a simple switch which can control nine speed from low to fast. People can choose the speed to improve skill.
Keyword KeywordKeyword
i Abstract ii iii ... 1 ... 2 ... 3 ………..13 ………..15 ………..19 ………..20 ………..21 ………..27
1. 2. 3.
3.1 274 1.525 76 30 23 2.74 2 1.525 2 1
15.25 15.25 15.25 40 2.7 3.2 (1) (2)8051 (3) (4) (5)BJT (6)PVC (7) 2
3 (DC motor) (AC motor) BLDC ( ) ( ) 1. 2. 3.
4. 8051 4 8051 8051 1 CPU 2 ( ) 3 32 I/O 4 128 RAM 5 16 (8052 ) 6 UART 7 5 ( / ) 8 (Clock) 8051
• 1~8 PORT 1 (P1.0 ~ P1.7 ) • 9 RESET/Vpd • 10~17 PORT 3 (P3.0 ~ P3.7) • 18~19 XTAL2 XTAL1 • 20 Vss • 21~28 PORT 2 (P2.0 ~ P2.7) • 29 PSEN ( )( ) (ROM) • 30 ALE/PROG( ) 8051 • 31 EA/Vdd PC 4096(4K) ROM PC 4096(4K) ROM 8051 ROM • 32~39 PORT 0 (P0.0 ~ P0.7) • 40 Vcc +5V 8051 MOSFET (1N4004) TLP250 IC
MOS MOS TLP250 IC MOSFET 8051 DUTY 0 1 MOS 12V 8051 P1.0 BJT BJT C inverter MOSFET ( HEADER) P1.0 5 3.3 (1) MOSFET (2) 1N4004 (3) TLP250 IC MOSFET
6 MOSFET MOSFET MOSFET 1N4004 " " 7 TLP250 IC IC MOSFET IGBT TLP250 IC PWM MOSFET
8 IC 3.4 9 3.5 BJT B E C (Base, B) (Emitter, E) (Collector, C)
10 BJT
3.6 PVC
11 PVC ( )
(DUTY )
8051 0 1 MOS
V=
11 PVC LAYOUT MOS 8051 MOS 15
16
1
0 1 2 3 4 5 6 7 8 9
40 40 10 200 17 ( 200 )
*1 PVC *1 *1 *1 *1 8051 *1 *1 :10K*1,1K*12,330*8 pnp *12 *2 ( 30pF*2+ 10uF*1) *1 *2 TLP250 *2
2 3 3/13 3/20 3/27 4/3 4/10 4/17 4/24 5/1 5/8 PPT 5/15 PPT Layout Layout 5/22 5/29 PPT WORD 6/5
: : : AutoCAD : … PPT
:
:
:
: : : PVC PVC ... BJT MOS
274 100
:
:
:
PVC
ASM ORG 0000H AJMP MAIN ORG 0003H AJMP CUT0 ORG 0013H AJMP CUT1 ORG 000BH AJMP TIMER0 ORG 001BH AJMP TIMER1 MAIN: MOV P0,#11111110B MOV DPTR,#TABLE SETB EA SETB EX0 SETB EX1 SETB ET0 SETB ET1 SETB IT0 SETB IT1 MOV TMOD,#00010001B MOV TL0,#0C4H MOV TH0,#0FFH MOV TL1,#0B0H ;0.05 SEC MOV TH1,#3CH MOV R0,#0 MOV R5,#0 MOV R6,#0 MOV R7,#0 SETB P3.2
SETB P3.3 SETB P1.1 SETB P1.2 SETB P1.5 SETB P1.6 CLR P1.0 CLR P1.3 CLR P1.4 CLR P1.7 SETB TR0 SETB TR1 LOOP: MOV A,R0 MOVC A,@A+DPTR MOV P2,A AJMP LOOP CUT0: MOV R6,#4 CUT0_0: MOV R7,#255 CUT0_1: DJNZ R7,CUT0_1 DJNZ R6,CUT0_0 JNB P3.2,CUT0 INC R0 CJNE R0,#10,CONTI0 MOV R0,#0 CONTI0: RETI CUT1: MOV R6,#4 CUT1_0:
MOV R7,#255 CUT1_1: DJNZ R7,CUT1_1 DJNZ R6,CUT1_0 JNB P3.3,CUT1 DEC R0 CJNE R0,#255,CONTI1 MOV R0,#9 CONTI1: RETI TIMER0: ;40% CPL P1.0 CJNE R0,#0,ONE MOV TL0,#88H MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#0B0H MOV TH0,#0FFH AJMP BACK ONE: ;45% CJNE R0,#1,TWO MOV TL0,#92H MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#0A6H MOV TH0,#0FFH AJMP BACK TWO: ;50% CJNE R0,#2,THREE MOV TL0,#9CH MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#9CH MOV TH0,#0FFH
AJMP BACK THREE: ;56% CJNE R0,#3,FOUR MOV TL0,#0A8H MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#90H MOV TH0,#0FFH AJMP BACK FOUR: ;62% CJNE R0,#4,FIVE MOV TL0,#0B4H MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#84H MOV TH0,#0FFH AJMP BACK FIVE: ;68% CJNE R0,#5,SIX MOV TL0,#0C0H MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#78H MOV TH0,#0FFH BACK: RETI SIX: ;73% CJNE R0,#6,SEVEN MOV TL0,#0CAH MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#6EH MOV TH0,#0FFH AJMP BACK
SEVEN: ;78% CJNE R0,#7,EIGHT MOV TL0,#0D4H MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#64H MOV TH0,#0FFH AJMP BACK EIGHT: ;84% CJNE R0,#8,NINE MOV TL0,#0E0H MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#58H MOV TH0,#0FFH AJMP BACK NINE: ;90% MOV TL0,#0ECH MOV TH0,#0FFH JB P1.0,BACK MOV TL0,#4CH MOV TH0,#0FFH AJMP BACK TIMER1: INC R5 CJNE R5,#2,STEP0 CPL P1.4 STEP0: CJNE R5,#17,STEP1 MOV R5,#0 CPL P1.4 STEP1:
MOV TL1,#0B0H
MOV TH1,#3CH
RETI
TABLE: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0D8H,80H,98H END
LAYOUT
[1]. AT89S52/8951
2006 6