






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Notes; Professor: Giurgiutiu; Class: MICROCNTROLLRS MECH ENGR; Subject: Mechanical Engineering; University: University of South Carolina - Columbia; Term: Unknown 1989;
Typology: Study notes
1 / 11
This page cannot be seen from the preview
Don't miss anything!
FLOWCHART AND CODE
Define variables START Divide T1 by 100 and store in T1_ Divide T2 by 100 and store in T2_ Use repeated addition to calculate TOVFL (time taken by overflows, in 100s of cycles) T_100=TOVFL+T2_100-T1_ SWI N_100_HEX=2000000*60/100/100/T_ Convert N_100_HEX to N_100_BCD (^) Load lower part of N_100_HEX in accA (^) JSR HEX_BCD (^) STAA N_100_BCD Load $0000 in accD Store accD to TOVFL NOF=0? N LABEL5 Load TOVFL in accD Add ($10000)/ Store accD into TOVFL Decrement NOF Branch back if NOF> LABEL Y Load T1 in accD Load 100 in X IDIV Load T2 in accD Load 100 in X IDIV Overflow counter, NOF1 (1 byte) 1 st^ capture, T1 (2 bytes) 2 nd^ capture, T2 (2 bytes) T1_100=T1/100 (2 bytes) T2_100=T2/100 (2 bytes) T_100=(total time)/100 (2 bytes) N_100_HEX=N in 100 rpm (hex) (2 bytes) N_100_BCD=N in 100 rpm (BCD) (1 byte) Big-picture Flowchart Detailed Flowcharts
Table 1 Memory list after Example 1 data has been entered NOF $0000 $ T1 $0001 $ $0002 $ T2 $0003 $ $0004 $0c T1_100 $0005 $ff $0006 $ff T2_100 $0007 $ff $0008 $ff TOVFL $0009 $ff $000a $ff T_100 $000b $ff $000c $ff N_100_HEX $000d $ff $000e $ff N_100_BCD $000f $ff
Table 2 Memory list after the calculation of T1_100 and T2_ NOF $0000 $ T1 $0001 $ $0002 $ T2 $0003 $ $0004 $0c T1_100 $0005 $ $0006 $ T2_100 $0007 $ $0008 $2b TOVFL $0009 $ff $000a $ff T_100 $000b $ff $000c $ff N_100_HEX $000d $ff $000e $ff N_100_BCD $000f $ff
Table 3 Memory list after the calculation of TOVFL NOF $0000 $ T1 $0001 $ $0002 $ T2 $0003 $ $0004 $0c T1_100 $0005 $ $0006 $ T2_100 $0007 $ $0008 $2b TOVFL $0009 $ $000a $8f T_100 $000b $ff $000c $ff N_100_HEX $000d $ff $000e $ff N_100_BCD $000f $ff
Table 4 Memory list after the calculation of T_ NOF $0000 $ T1 $0001 $ $0002 $ T2 $0003 $ $0004 $0c T1_100 $0005 $ $0006 $ T2_100 $0007 $ $0008 $2b TOVFL $0009 $ $000a $8f T_100 $000b $ $000c $ba N_100_HEX $000d $ff $000e $ff N_100_BCD $000f $ff
EXAMPLE 2
Table 7 Memory list after Example 2 data has been entered NOF $0000 $ T1 $0001 $ff $0002 $fd T2 $0003 $ $0004 $ T1_100 $0005 $ff $0006 $ff T2_100 $0007 $ff $0008 $ff TOVFL $0009 $ff $000a $ff T_100 $000b $ff $000c $ff N_100_HEX $000d $ff $000e $ff
N_100_BCD $000f $ff
Table 8 Memory list after the calculation of T1_100 and T2_ NOF $0000 $ T1 $0001 $ff $0002 $fd T2 $0003 $ $0004 $ T1_100 $0005 $ $0006 $8f T2_100 $0007 $ $0008 $2b TOVFL $0009 $ff $000a $ff T_100 $000b $ff $000c $ff N_100_HEX $000d $ff $000e $ff N_100_BCD $000f $ff
Table 9 Memory list after the calculation of TOVFL NOF $0000 $ T1 $0001 $ff $0002 $fd T2 $0003 $ $0004 $ T1_100 $0005 $ $0006 $8f T2_100 $0007 $ $0008 $2b TOVFL $0009 $ $000a $1e T_100 $000b $ff $000c $ff N_100_HEX $000d $ff $000e $ff N_100_BCD $000f $ff
Table 12 Memory list after the calculation of N_100_HEX NOF $0000 $ T1 $0001 $ $0002 $ T2 $0003 $ $0004 $0c T1_100 $0005 $ $0006 $ T2_100 $0007 $ $0008 $2b TOVFL $0009 $ $000a $8f T_100 $000b $ $000c $ba N_100_HEX $000d $ $000e $ N_100_BCD $000f $ WHAT YOU HAVE LEARNED