English
Language : 

MC68HC16Z1CAG16 Datasheet, PDF (477/500 Pages) Freescale Semiconductor, Inc – M68HC16Z Series users manual
Freescale Semiconductor, Inc.
AIX #$01
BRA SEND_STRING
;increment IX to point to the next byte
;loop back and do next byte in string
STRING_DONE:
LDE #$FFFF
STE 0,Z
LOOP: DECW 0,Z
BNE LOOP
RTS
;subroutine to implement delay between messages
;load accumulator E with the delay time
;set up the counter
;decrement the counter
;count down to zero
;finish delay loop go back to main
SEND_CH:
LDAA SCSR
ANDA #$01
BEQ SEND_CH
LDAA #$00
STD SCDR
TC_LOOP:
LDAB SCSR+1
ANDB #$80
BEQ TC_LOOP
;subroutine to send out one byte to SCI
;read SCI status reg to check/clear TDRE bit
;check only the TDRE flag bit
;if TDR is not empty, go back to check it again
;clear A to send a full word to SCDR ($FFC0E)
;transmit one ASCII character to the screen
;test the TC bit (transfer complete)
;continue to wait until TC is set
RTS
;finish sending out byte
STRING DC
'I AM A HAPPY EVB16 RUNNING YOUR CODE!!!',0A,0D,00
***** Interrupts/Exceptions *****
BDM: BGND
;exception vectors point here
;and put the user in background debug mode
***** Reserve data and stack space *****
ORG $10000
;start of 1K internal SRAM for data & stack
COUNTER DS
2
;space for delay counter
E.2.4 GPT Programming Example
The following programming example involves demonstrating basic general-purpose
timer module (GPT) functions.
Refer to SECTION 11 GENERAL-PURPOSE TIMER for more information on the
GPT.
E.2.4.1 Example 7 - Basic GPT Functions
*
Description : This program demonstrates some basic GPT functions.
*
*
The 1st demo requires that the pins OC2, IC1, IC2,
*
and IC3 be tied together so that OC2 may drive
*
IC1, IC2, & IC3.
*
*
* In the second demo, the PAI pin should be connected
*
to the PWMA pin. A bell on the dummy terminal
*
will ring when the Pulse Accumulator Counter
M68HC16 Z SERIES
USER’S MANUAL
INITIALIZATION AND PROGRAMMING EXAMPLES
For More Information On This Product,
Go to: www.freescale.com
E-25