* Initialization sequence for the Pulse Accumulator timer, 
* so that it gener-ates an interrupt every tenth rising edge 
* of the signal applied on PA7.

INIT_PA	BCLR	DDRA,$80	;PA7 input
	LDAA	#$50		;PAEN=1, PAMOD=0, PEDGE=1
	STAA	PACTL		;write control register
	LDAA	#246	
	STAA	PACNT		;init counter
	BSET	TFLG2,$20	;clear PAOVF if any
	BSET	TMSK2,$20	;enable PAOVF interrupts
	RTS
* INTERRUPT SERVICE ROUTINE

PAOVF_SVC BSET	TFLG2,$20	;clear PAOVF
	LDAA	#246		;write 246 to PACNT
	STAA	PACNT	
	RTI			;return from interrupt

