Microcontroller, 68HC11A1, 68HC11, 68HC811, HC11...
Orgler electronic
"Applications with microcontroller HC11"


toc1.GIF OUTPUT COMPARE

tocout.gif The simplest output compare programm
	ORG	$B600

LDAA #01010101B
STAA $1020 (Register TCTL1)
LOOP JMP LOOP
Programm nr. 2
TCTL1	EQU	$1020
TFLG1	EQU	$1023
TOC2	EQU	$1018
TOC2
	ORG	$B600
	LDAA	#01010101B	Toggle PA6,PA5,PA4,PA3
	STAA	TCTL1
LOOP	LDAA	#01000000B
CHECK	BITA	TFLG1
	BEQ	CHECK		Wait until TCNT == TOC2
	STAA	TFLG1		Clear TFLG1 with WRITE-Operation
	LDD	TOC2
	ADDD	#20000		20000 * 0,5 micro = 10 msec
	STD	TOC2		
	BRA	LOOP
*********************************

Ocilloscope on PORTA-Outputs
tocoszi.gif

tic1.gif INPUT CAPTURE