summaryrefslogtreecommitdiff
path: root/cmpen472hw10_McDonnell/bin
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2025-04-09 19:59:14 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2025-04-09 19:59:14 -0400
commit964eb5fd879b5ca4b86efd56e13027989705bf0e (patch)
treecb2ea9c643de2d045d2366d7904c9d0155d102bc /cmpen472hw10_McDonnell/bin
parentd1cbc8fb23dfa1b7c3c87962e1c99ab65a77f1d4 (diff)
HW10: Comments
Diffstat (limited to 'cmpen472hw10_McDonnell/bin')
-rw-r--r--cmpen472hw10_McDonnell/bin/Project.absbin11006 -> 11046 bytes
-rw-r--r--cmpen472hw10_McDonnell/bin/Project.abs.s1980
-rw-r--r--cmpen472hw10_McDonnell/bin/main.dbg89
3 files changed, 122 insertions, 47 deletions
diff --git a/cmpen472hw10_McDonnell/bin/Project.abs b/cmpen472hw10_McDonnell/bin/Project.abs
index d82f317..bcca966 100644
--- a/cmpen472hw10_McDonnell/bin/Project.abs
+++ b/cmpen472hw10_McDonnell/bin/Project.abs
Binary files differ
diff --git a/cmpen472hw10_McDonnell/bin/Project.abs.s19 b/cmpen472hw10_McDonnell/bin/Project.abs.s19
index 1799a07..5265976 100644
--- a/cmpen472hw10_McDonnell/bin/Project.abs.s19
+++ b/cmpen472hw10_McDonnell/bin/Project.abs.s19
@@ -2,7 +2,7 @@ S0590000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C43
S123300000000000000000000000000000000000000010000000000000000000000000009C
S123302000000000001000000000000000000000000000000000000000000000000000007C
S1123040000010730000000BB8080000000153DB
-S1233100CF310086F15A03860C5ACBCC00015CC8CE371A1635CE4C3B194C38804C378086CA
+S1233100CF310086F15A03860C5ACBCC00015CC8CE372B1635CE4C3B194C38804C378086B9
S1233120FF5A0310EF863E1635FE86201635FECE3030FD30411635DACE303016333BCE30C3
S123314030FD30411635BF20DC14104D3880CE361E1635CE1636059727FA5A011635FE2096
S1233160F34C378010EFFE302C087E302C8E00C8263FCE00007E302CFE302A087E302A8EF1
@@ -16,7 +16,7 @@ S123324087C7CD300016355036860D1635FE860A1635FE3287F63044F3304C8C0100255401
S1233260C786517A304E204C87F63044CD300016355036860D1635FE860A1635FE32F3307F
S12332804C8C0100252E86747A304E830001202487F63044CD300016355036860D1635FEA9
S12332A0860A1635FE32B3304C8C00002D0686547A304EC77B3044313A3D3B86205A405A0C
-S12332C04C86805A4686005A4DCC0BB8D3445C5A4C4E2086205A4C3A3D36875A4C323D3BE5
+S12332C04C86805A4686005A4DFC3047D3445C5A4C4E2086205A4C3A3D36875A4C323D3B01
S12332E0CC00007C30457A30441632BAB6304B27FB877A304B1631D3FC3045BC304925EC7D
S12333001632D93A3D3BB6304381682605FC3026200C816D2605FC30282003FC302A1633EC
S1233320233A3D3B34CE000A181037B7D4CE000A58585858EAB05B01303A3D3B35A630188B
@@ -26,13 +26,13 @@ S1233380678C0000182D01607C3028A61F813A18260155FC302A3B1634FDB7E48C003C1855
S12333A02401418C0000182D013A7C302AA61F81001826012F877A302C10EF3A3A3A1820CB
S12333C001388168260FE630C100182601247A304318200125816D260FE630C100182601D4
S12333E0117A3043182001128173260FE630C100182600FE7A3043182000FF8171260BE617
-S123340030C100182600EB0631498167182600E2A63081772650E630C100261ECE36641629
-S123342035CE86537A304ECC00017C304C1632DFCE37021635CE182000C0C132182600B2CD
-S1233440E630C100182600AACE36821635CE86537A304ECC00047C304C1632DFCE3702162D
-S123346035CE1820009481742626E630C10018260080CE36A61635CE86547A304ECC000141
-S12334807C304C1632DFCE37021635CE1820006A81711826005CE630C100261ECE36C416C2
-S12334A035CE86717A304ECC00017C304C1632DFCE37021635CE18200040C132182600322F
-S12334C0E630C100262CCE36E01635CE86717A304ECC00047C304C1632DFCE37021635CEC4
+S123340030C100182600EB0631498167182600E2A63081772650E630C100261ECE36751618
+S123342035CE86537A304ECC00017C304C1632DFCE37131635CE182000C0C132182600B2BC
+S1233440E630C100182600AACE36931635CE86537A304ECC00047C304C1632DFCE3713160B
+S123346035CE1820009481742626E630C10018260080CE36B71635CE86547A304ECC000130
+S12334807C304C1632DFCE37131635CE1820006A81711826005CE630C100261ECE36D516A0
+S12334A035CE86717A304ECC00017C304C1632DFCE37131635CE18200040C132182600321E
+S12334C0E630C100262CCE36F11635CE86717A304ECC00047C304C1632DFCE37131635CEA2
S12334E0182000163A7C302A3A7C30283A7C302610EF34CE360E1635CE30313A3D3BCD0012
S123350000E630272EC12B272AC12D2726C12A2722C12F271EC13A271AC1202716C1302DE3
S123352017C1392213C03037CC000A13B7C63319ED20CE87B7023A3D8604B7023A3D3435B3
@@ -42,37 +42,37 @@ S12335808C000026F3B6302F812D26026A60CE301316353E1635CEFD3024CE30131635BFAE
S12335A03A31303D86301635FE3A31303D36862D7A302F3240800150C001C30001209B36DD
S12335C0876A300436FB323D6A300436FB3D36A63027051635FE20F7323D3635341636051F
S12335E027FB810D270A6A301635FE03270220ED860D1635FE860A1635FE3031323D4FCC2A
-S123360080FC5ACF3D4FCC200396CF3D873D496E76616C696420496E7075740D0A000D0AFB
-S1233620436C6F636B2073746F7070656420616E64205479706577726974652070726F6763
-S123364072616D20737461727465642E0D0A596F75206D617920747970652062656C6F770B
-S12336602E0D0A00736177746F6F746820776176652067656E65726174696F6E2E2E2E0DD2
-S12336800A00736177746F6F7468207761766520313235487A2067656E65726174696F6E0A
-S12336A02E2E2E0D0A00747269616E676C6520776176652067656E65726174696F6E2E2E94
-S12336C02E0D0A0073717561726520776176652067656E65726174696F6E2E2E2E0D0A0050
-S12336E0737175617265207761766520313235487A2067656E65726174696F6E2E2E2E0D05
-S12337000A00446F6E652067656E65726174696E6720776176652E0D0A00436F6D6D616E5E
-S123372064733A0D0A67773A2067656E657261746520736177746F6F746820776176652C42
-S1233740207072696E74696E672030207468726F756768203235352C20726570656174657B
-S12337606420666F7220746F74616C203230343820706F696E74730D0A6777323A2067653E
-S12337806E657261746520736177746F6F74682077617665206F6620313235487A2C207708
-S12337A061766520726570656174656420666F7220746F74616C203230343820706F696EF0
-S12337C074730D0A67743A2067656E657261746520747269616E676C6520776176652C20D2
-S12337E07072696E74696E672030207468726F756768203235352C207468656E2032353576
-S123380020646F776E20746F20302C20726570656174656420666F7220746F74616C2032E6
-S123382030343820706F696E74730D0A67713A2067656E65726174652073717561726520C6
-S1233840776176652C207072696E74696E67203020666F72203235352074696D65732C20F9
-S12338607468656E207072696E742032353520666F72203235352074696D65732C207468FF
-S1233880656E20726570656174656420666F7220746F74616C203230343820706F696E7404
-S12338A0730D0A6771323A2067656E6572617465207371756172652077617665206F662032
-S12338C0313235487A2C207761766520726570656174656420666F7220746F74616C203224
-S12338E030343820706F696E74730D0A743A20536574207468652074696D6520696E2066AD
-S12339006F726D61742048483A4D4D3A53530D0A683A20446973706C617920746865206884
-S12339206F757273206F6E207468652037207365676D656E7420646973706C6179730D0A52
-S12339406D3A20446973706C617920746865206D696E75746573206F6E207468652037206B
-S12339607365676D656E7420646973706C6179730D0A733A20446973706C617920746865AC
-S1233980207365636F6E6473206F6E207468652037207365676D656E7420646973706C61AF
-S12339A079730D0A713A2053746F702074686520636C6F636B20616E6420656E7465722051
-S11039C0747970657772697465720D0A0080
+S123360080FC5ACF3D4FCC200396CF3D873D496E76616C696420496E7075740D0A0057615A
+S123362076652047656E657261746F7220616E6420436C6F636B2073746F707065642061E5
+S12336406E64205479706577726974652070726F6772616D20737461727465642E0D0A59DA
+S12336606F75206D617920747970652062656C6F772E0D0A00736177746F6F74682077612A
+S123368076652067656E65726174696F6E2E2E2E0D0A00736177746F6F7468207761766512
+S12336A020313235487A2067656E65726174696F6E2E2E2E0D0A00747269616E676C652029
+S12336C0776176652067656E65726174696F6E2E2E2E0D0A007371756172652077617665E2
+S12336E02067656E65726174696F6E2E2E2E0D0A00737175617265207761766520313235BD
+S1233700487A2067656E65726174696F6E2E2E2E0D0A00446F6E652067656E657261746901
+S12337206E6720776176652E0D0A00436F6D6D616E64733A0D0A67773A2067656E6572616B
+S1233740746520736177746F6F746820776176652C207072696E74696E67203020746872AB
+S12337606F756768203235352C20726570656174656420666F7220746F74616C20323034DF
+S12337803820706F696E74730D0A6777323A2067656E657261746520736177746F6F7468CB
+S12337A02077617665206F6620313235487A2C207761766520726570656174656420666F65
+S12337C07220746F74616C203230343820706F696E74730D0A67743A2067656E6572617452
+S12337E06520747269616E676C6520776176652C207072696E74696E672030207468726F33
+S1233800756768203235352C207468656E2032353520646F776E20746F20302C207265702F
+S1233820656174656420666F7220746F74616C203230343820706F696E74730D0A67713A02
+S12338402067656E65726174652073717561726520776176652C207072696E74696E67209E
+S12338603020666F72203235352074696D65732C207468656E207072696E7420323535208B
+S1233880666F72203235352074696D65732C207468656E20726570656174656420666F7213
+S12338A020746F74616C203230343820706F696E74730D0A6771323A2067656E65726174B4
+S12338C065207371756172652077617665206F6620313235487A2C20776176652072657026
+S12338E0656174656420666F7220746F74616C203230343820706F696E74730D0A743A2086
+S1233900536574207468652074696D6520696E20666F726D61742048483A4D4D3A53530D36
+S12339200A683A20446973706C61792074686520686F757273206F6E2074686520372073E7
+S123394065676D656E7420646973706C6179730D0A6D3A20446973706C6179207468652025
+S12339606D696E75746573206F6E207468652037207365676D656E7420646973706C617960
+S1233980730D0A733A20446973706C617920746865207365636F6E6473206F6E2074686528
+S12339A02037207365676D656E7420646973706C6179730D0A713A2053746F702074686527
+S12139C020636C6F636B20616E6420656E74657220747970657772697465720D0A0092
S105FFE431B234
S105FFF0316179
S9030000FC
diff --git a/cmpen472hw10_McDonnell/bin/main.dbg b/cmpen472hw10_McDonnell/bin/main.dbg
index d635a34..26d5a48 100644
--- a/cmpen472hw10_McDonnell/bin/main.dbg
+++ b/cmpen472hw10_McDonnell/bin/main.dbg
@@ -1,19 +1,20 @@
**************************************************************************
*
-* Title: Calculator Clock
+* Title: Signal Generator
*
-* Objective: CMPEN 472 Homework 9
+* Objective: CMPEN 472 Homework 10
*
* Revision: V1.0
*
-* Date: Apr. 2, 2025
+* Date: Apr. 11, 2025
*
* Programmer: Jacob McDonnell
*
* Company: The Pennsylvania State University
* Department of Computer Science and Engineering
*
-* Algorithm: Simple Serial I/O, Real Time Interrupts for Time Tracking
+* Algorithm: Simple Serial I/O, Real Time Interrupts for Time Tracking, and
+* output compare timer for generating functions.
*
* Register Use: A & B to current byte, etc,
* X & Y holds address of strings and length of string,
@@ -248,6 +249,20 @@ rtiisr bset CRGFLG,%10000000; Clear RTI Interrupt Flag
rtidone jsr PrintTime ; Jump to PrintTime
rtiSkip RTI ; Return from RTI ISR
+;*************************************************************************
+; oc5isr subroutine
+;
+; This subroutine will set a flag after a set number of cycles.
+;
+; Input: interval memory location for the number of cycles between triggers
+; Output: The outputCnt counting the number of triggers, and timeTrigger to
+; signal a timmer trigger.
+; Registers in use: A for setting timeTrigger, D for increasing outputCnt and setting next count.
+; Memory locations in use: Memory Address for oc5 timer, outputCnt, timeTrigger, numPoints, interval
+;
+; Comments: The timer will stop after outputCnt == numPoints
+;
+
oc5isr ldd interval ; Load the interval for the next clock cycle
addd TC5H ; for next interrupt
std TC5H ;
@@ -262,6 +277,23 @@ oc5isr ldd interval ; Load the interval for the next clock c
jsr StopTimerCH5 ; Stop Channel 5 Timer
oc5Done RTI ; Return from interrupt
+;*************************************************************************
+; PrintWave subroutine
+;
+; This subroutine will print a one byte decimal value to the serial console.
+; The outputVal will be incremented by increment. It can follow a square wave,
+; a triangle wave, & a sawtooth wave pattern.
+;
+; Input: waveType to denote the patter, increment to increment the outputVal
+; Output: outputVal printed to the serial console
+; Registers in use: A for finding the wave type, B for reading the outputVal,
+; D for math and checking of outputVal
+; Memory locations in use: waveType to set the patter, outputVal for printing
+; the output value
+;
+; Comments: The timer will stop after outputCnt == numPoints
+;
+
PrintWave
pshd ; Save D to the stack
pshy ; Save Y to the stack
@@ -365,6 +397,20 @@ DonePrint stab outputVal ; Store updated output value
puld ; Restore D from the stack
rts ; Return from Caller
+;*************************************************************************
+; StartTimer5oc subroutine
+;
+; This subroutine will enable & start the oc5 timer.
+;
+; Input: Interval to set the next clock cycle
+; Output: No output other
+; Registers in use: A used for setting up the oc5 timer, D for setting the next trigger
+; Memory locations in use: All memory locations used for the oc5 timer.
+; interval to set the next cycle.
+;
+; Comments: The timer will be enabled only on channel 5 for output compare.
+;
+
StartTimer5oc
PSHD
LDAA #%00100000
@@ -375,7 +421,7 @@ StartTimer5oc
LDAA #%00000000 ; TOI Off, TCRE Off, TCLK = BCLK/1
STAA TSCR2 ; not needed if started from reset
- LDD #3000 ; 125usec with (24MHz/1 clock)
+ LDD interval ; 125usec with (24MHz/1 clock)
ADDD TCNTH ; for first interrupt
STD TC5H ;
@@ -385,6 +431,19 @@ StartTimer5oc
PULD
RTS
+;*************************************************************************
+; StopTimerCH5 subroutine
+;
+; This subroutine will stop and disable the timer.
+;
+; Input: No Input
+; Output: No output other
+; Registers in use: A to disable the timer.
+; Memory locations in use: TIE to disable the timer.
+;
+; Comments: The timer will be disabled on all channels.
+;
+
StopTimerCH5
psha ; Save A to the stack
clra ; Clear A
@@ -392,6 +451,23 @@ StopTimerCH5
pula ; Restore A from the stack
rts ; Return
+;*************************************************************************
+; GenWave subroutine
+;
+; This subroutine will setup the proper variables to generate a wave and wait
+; for the wave to finish generating.
+;
+; Input: No input but the variables for PrintWave are required.
+; Output: No output except for the output of PrintWave
+; Registers in use: A for reading the timeTrigger variable,
+; D for reading outputCnt.
+; Memory locations in use: outputCnt, outputVal, timeTrigger, numPoints.
+;
+; Comments: This subroutine does not have any direct input or output but calls
+; PrintWave so the inputs for PrintWave should be set and the output
+; of PrintWave should be expected.
+;
+
GenWave
pshd ; Save D to the stack
ldd #0 ; Clear D
@@ -400,7 +476,6 @@ GenWave
jsr StartTimer5oc ; Start Timer on CH5
-
genLoop ldaa timeTrigger ; Load timeTrigger into A
beq genLoop ; If A == 0, loop
clra ; Clear A
@@ -966,7 +1041,7 @@ getchar7 clra ; Set A to 0
badInput dc.b 'Invalid Input',CR,LF,NULL ; Invalid Input Prompt
; twMsg: welcome message for typewrite
-twMsg dc.b CR,LF,'Clock stopped and Typewrite program started.',CR,LF
+twMsg dc.b 'Wave Generator and Clock stopped and Typewrite program started.',CR,LF
dc.b 'You may type below.',CR,LF,NULL
; Messages for different waveforms