;********************************************************************** ; * ; Filename: DUT.asm * ; Date: 2007 Oct 26 * ; * ; Author: JR7DUT * ; * ;********************************************************************** list p=12f629 ; list directive to define processor #include ; processor specific variable definitions errorlevel -302 ; suppress message 302 from list file __CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT ;***** VARIABLE DEFINITIONS (変数の定義) TimerP EQU 0x21 ; for DOT(Point) TimerD EQU 0x22 ; for DASH TimerS EQU 0x23 ; for Space TimerPx EQU 0x24 ; for DOT(Point) TimerDx EQU 0x25 ; for DASH TimerSx EQU 0x26 ; for Space TimerPy EQU 0x27 TimerDy EQU 0x28 TimerSy EQU 0x29 ;********************************************************************** ORG 0x000 ; processor reset vector nop ; nop required for icd goto main ; go to beginning of program ORG 0x01c ; interrupt vector location main nop ; LEDへの出力をI/O2に設定 bcf STATUS,RP0 bcf GPIO,2 bsf STATUS,RP0 bcf TRISIO,2 bcf STATUS,RP0 callsign NOP ; 最初は 'VVV’ call Po ; 短点出力のサブルーチン'Po'を呼ぶ call SP ; 短点1つ分の空白のサブルーチン'SP'を呼ぶ call Po call SP call Po call SP call DASH ; 長点出力のサブルーチン'DASH'を呼ぶ ; ここまでで,'V'1個の出力完了 call SP call SP call SP ; SP3個で,短点3個分の1スペース call Po call SP call Po call SP call Po call SP call DASH call SP call SP call SP call Po call SP call Po call SP call Po call SP call DASH call SP call SP call SP call SP call SP call SP call SP call SP call SP ; ここは'DE' DE call DASH call SP call Po call SP call Po call SP call SP call SP call Po call SP call SP call SP call SP call SP call SP call SP call SP call SP ; ここからが'JR7DUT' call Po call SP call DASH call SP call DASH call SP call DASH call SP call SP call SP call Po call SP call DASH call SP call Po call SP call SP call SP call DASH call SP call DASH call SP call Po call SP call Po call SP call Po call SP call SP call SP call DASH call SP call Po call SP call Po call SP call SP call SP call Po call SP call Po call SP call DASH call SP call SP call SP call DASH call SP call SP call SP call SP call SP call SP call SP call SP call SP goto DE ; DE以降を繰り返す ;Subroutines ;for DOT(Point) 短点1個を出力するサブルーチン ; 内臓の4MHzクロックにより約90msec Po bsf GPIO,2 movlw 004h movwf TimerPy CPy movlw 055h movwf TimerP CP movlw 0ffh movwf TimerPx CPx decfsz TimerPx,1 goto CPx decfsz TimerP,1 goto CP decfsz TimerPy,1 goto CPy return ;for DASH 長点1個を出力するサブルーチン 約270msec DASH bsf GPIO,2 movlw 004h movwf TimerDy CDy movlw 0ffh movwf TimerD CD movlw 0ffh movwf TimerDx CDx decfsz TimerDx,1 goto CDx decfsz TimerD,1 goto CD decfsz TimerDy,1 goto CDy return ;for Space 空白(短点1個と同じ長さ)1個を出力するサブルーチン SP bcf GPIO,2 movlw 004h movwf TimerSy CSy movlw 055h movwf TimerS CS movlw 0ffh movwf TimerSx CSx decfsz TimerSx,1 goto CSx decfsz TimerS,1 goto CS decfsz TimerSy,1 goto CSy return END ; directive 'end of program'