mcs51 training board model catc2016a
TRANSCRIPT
MCS51 Training board Model CATC2016A
Design by Arkhom JODTANGGround Instructor at CATC, Thailand
Schematic Diagram
Reset Circuit and Crystal
LED Row Display, EA pin
Input Switch
External connectionOpen Collector pin
7-Segment Display
PCB (Print Circuit Board)
Top Layer Components
PCB with Components
BOM (Bill of Material)
No.
Devices Quantity
Part Ref. Note:
1 USB Type B terminal female 1 J12 CPU MCS51 Family 1 U1 Such as AT89C52, AT89C513 Zif Socket 40 Pins 1 (U1)4 LED Green 3mm. Or 5mm. ( LED) 1 D Power for Power status display5 LED Red (Display LED) 8 D0 – D7 8 for Row display and 1 for Power status display6 Resistor Pack, 8 + 1 Common, 330 Ohms 1 RP 1 Make sure that: It have 9 pins7 Resistor 330 Ohms 1/4 W. 1 R LED R for Power status display8 Resistor 560 Ohms - 1kOhms 1/4 W. 2 R2, R3 R for 7-Segment display9 Electrolytic Capacitor 10 uF 1 C110 Resistor 8.2 kOhms 1/4 W. 1 R Pulldown Pull-down for reset pin11 Push Button Switch 1 SW RESET 1 for Reset12 Push Button Switch 1 SW LT 1 for Lamp test 13 Push Button Switch 8 SW0 – SW7 8 for Input Switch14 Crystal 11.059 MHz 1 X115 Capacitor Ceramic 33pF 2 C2, C316 IC 7447 (for Common-Anode 7-Segment) 1 U2 Or 7448 if use Common-C on 7-Segment117 7-Segment Common-A, 1 Digit, size 1/2 inch 1 7-Segment1 https://www.circuitspecialists.com/pdf/SC56-11EWA.pdf18 7-Segment Common-A, 1 Digit, size 1/2 inch 1 7-Segment2 (Optional)19 Straight Single Row 8-Pins Header, 2.54mm 3 J2, J3, J420 Straight Single Row 3-Pins Header, 2.54mm 2 JP1, JP2
Other Material and Tools
Copper clad PCB board, 4X5 inches PCB Etching Acid (or Ferric Chloride or Etching Solution) Drill bits (0.8, 1.0, 1.2 and 1.6 mm) USB Cable (Type A Male to Type B Male) Transparent Printing film (or Glossy Photo Paper) Permanent marker
Drilling size
1.6 mm. for USB Terminal Ground pin 1.2 mm. for Zip Socket 40 pin 1.0 mm. for Single Row connector pin 0.8 mm. for Normal other devices pin
Image from: www.aliexpress.com
Mark 5% (Complete Microcontroller Board)Mark 5% (Small Coding Project on your board)Write your Name (First letter of name and
surname) and ID (Last 4 digits) to Copper side. Such as,◦AJ0007◦RS0450
Self WorkshopDrilling Machine2Weeks from the assignment date
Small Coding Project
1. Press switch to show randomly number (0-9) on 7-Segment2. Press switch to show randomly position on LED row.3. Switch control Count-Up display (0-9) on 7-Segment and
Single dot LED walking for each step (TestFile.asm)4. Push switch 1 or 2 to select Count Up or Down display on
7-Segment and Single dot LED walking for each step 5. Push switch 1 or 2 to select Count Up or Down (0-255)
display as Binary on LED row6. Press switch for one walking step LED, when complete
each turn, increase 7-Segment’s number.7. Switch control Count-Up display (0-9) on 7-Segment. Show
number of counted turn in binary format on LED row.
SAMPLECount up 0-9 display on 7-Segment and Single dot LED walking for each step
Solution:If no pressing switch P3 = #11111111B or #0FFHOn Pressing switch P3.0, P3 = #0FEHOn Pressing switch P3.7, P3 = #07FHCondition for detect some switch was pressed is
P3 not equal to #FFHThen, CJNE A,#11111111B, Pressed ; will apply
Each pressing time, program run through main 3 steps are
Rotate P1
Increase P2
Delay 300 ms
Some switch was
pressed
True
Start
P1 = 00000001BP2 = 00H
Some switch was
pressed
Rotate P1
Increase P2
Delay 300 ms
ORG 00HMOV P1,#00000001B ; 8 LEDs MOV P2,#00H; 7-SegmentsWaitSW:
MOV A, P3CJNE A,#11111111B,PressedJMP WaitSW
Pressed:ACALL RotateP1ACALL IncreaseP2ACALL DelayJMP WaitSW
RotateP1:MOV A, P1RR AMOV P1, ARET
IncreaseP2:MOV A,P2INC ACJNE A,#0AH,NoAdjustMOV A, #00H ;Adjust to 0NoAdjust:MOV P2,ARET
Delay: MOV R1,#30DDelayLoop:
SETB TR0NotOver:JNB TF0,NotOver
CLR TR0CLR TF0DJNZ R1,DelayLoopRET
END
WaitSW:
Pressed:
JMP WaitSW
True
Part, Tools and Material Appendix
Warning
You can borrow drilling machine from technician room.
Work in your self workshop area.
Drilling Machine
Image from: qtena.comImage from: ebay.com You can borrow drilling
machine from technician room.
Single side Copper Clad PCBImage from: https://i3micro.org/2013/04/30/steps-of-diy-pcb-making/
Crystal (11.0592 MHz)
Straight Single Row 8-Pins Header, 2.54mm