; infoglobe.ASM source code ; Version 3.00 ; Created 6-01-05 ; Last modified 6-16-05 ; Infoglobe effects browser. Data loaded into the program is for the purpose of ; browsing the various (38) transition effects the Infoglobe has to offer. This ; is useful in designing messages to display. ; Pressing the button cycles through the effects, including the off position. When ; the desired effect is seen, select it by pressing and holding the button for 2+ ; seconds. "Off" will be displayed. Press the button again briefly, and "Effect xx" will ; be displayed with xx as the effect ASCII code and the selected effect will be demonsrated. ; Pressing the button again will display "Off" and again will repeat the effect. To go back ; into the browse mode, press and hold the button for 2+ seconds. ; Text generator for Infoglobe clock/CID ; Written by: ; Andrew R. Morris ; 3531 Olympic Drive ; Green Cove Springs, FL 32043 ; Phone: 904.529.8357 ; Fax: 904.284.2655 ; Cell: 386.546.4468 ; PORTA,0 (RA0) is DATA_LED_OUT ; PORTA,1 (RA1) is BASE_DISABLE ; PORTA,2 (RA2) is TP1 ; PORTA,3 (RA3) is not used ; PORTA,4 (RA4) is not used ; PORTB,0 (RB0) is not used ; PORTB,1 (RB1) is PUSHBUTTON_N ; PORTB,2 (RB2) is not used ; PORTB,3 (RB3) is not used ; PORTB,4 (RB4) is not used ; PORTB,5 (RB5) is not used ; PORTB,6 (RB6) is serial programming clock (if used) ; PORTB,7 (RB7) is Serial programming data (if used) ; This code was written for a PIC16F84 with 4.0 MHz resonator master oscillator. LIST P=16F84 include c:\progra~1\mplab\P16F84.inc __CONFIG _CP_OFF & _PWRTE_ON & _WDT_OFF & _HS_OSC ;Register equates LCVR1 EQU 0C ;Loop count variable register 1 LCVR2 EQU 0D ;Loop count variable register 2 LCVR3 EQU 0E ;Loop count variable register 3 LCVR4 EQU 0F ;Loop count variable register 4 DREG EQU 10 ;Data byte register MSG_CNTR EQU 11 ;Determines which is the current message. STAT EQU 12 ;Status register LAST_MSG EQU 13 ;Location of last message TEMP EQU 14 ;Temporary storage register ;Initialization equates INIT_A EQU B'00000000' ;Initialize PORTA INIT_B EQU B'00000010' ;Initialize PORTB CFG_A EQU B'00000000' ;Configure PORTA CFG_B EQU B'00000010' ;Configure PORTB OPTINI EQU B'00000000' ;Initialize option register ;Bit equates MSB EQU 7 ON_OFF_MODE EQU 0 ;Parameter equates Dbnce EQU D'40' ;Pushbutton debounce count (255 is 324mS) ZERO_TWEAK EQU D'3' ;Adjust TP1 for 8mS per byte sending all zeros. ONE_TWEAK EQU D'76' ;Adjust TP1 for 8mS per byte sending all ones. MSG_AVAIL EQU D'39' ;Number of messages available + 1. ;Number of messages displayed limited to 254 or by memory. PB_HLD_TIME EQU D'6' ;How long to hold button down to change modes (3 counts per second) ;I/O pin equates ;PORTA DATA_LED_OUT EQU 0 ;Data LED output BASE_DISABLE EQU 1 ;Disables data to rotor from base TP1 EQU 2 ;Test point 1 ;PORTB PUSHBUTTON_N EQU 1 ;Pushbutton (active low) ; ----------------------------------------------------------------------------- ORG 0 ;reset vector rolls over to here CLRF PCLATH ;ensure page bits are cleared GOTO Boot ;go to beginning of program ; ----------------------------------------------------------------------------- ORG 4 RETFIE ;return from interrupt ; ----------------------------------------------------------------------------- SEND ;Sends the character in DREG out to the LED. MOVLW D'8' ;8 bits per byte (character) MOVWF LCVR4 SHFT_LP BTFSC DREG,MSB ;Test MSB for one or zero GOTO ONE_OUT ZERO_OUT MOVLW D'38' MOVWF LCVR1 LP_CNT BSF PORTA,DATA_LED_OUT ;Turn on LED for 13mS. MOVLW D'3' MOVWF LCVR2 ON_LP DECFSZ LCVR2,F GOTO ON_LP NOP NOP BCF PORTA,DATA_LED_OUT ;Turn off LED for 13mS. MOVLW D'2' MOVWF LCVR2 OFF_LP DECFSZ LCVR2,F GOTO OFF_LP NOP NOP DECFSZ LCVR1,F GOTO LP_CNT MOVLW ZERO_TWEAK ;Tweak parameter for fine-tuning ZERO timing. Adds MOVWF LCVR3 ; a little time between bytes. LP3 DECFSZ LCVR3,F GOTO LP3 NXT_BIT RLF DREG,F ;Shift left, decrement loop count. DECFSZ LCVR4,F GOTO SHFT_LP RETLW 0 ;returns for the next character. ; ONE_OUT just turns off the LED and waits exactly 1mS, including the clock cycles ; required to do the job. ONE_OUT BCF PORTA,DATA_LED_OUT ;Turn off LED MOVLW D'255' MOVWF LCVR1 LP1 DECFSZ LCVR1,F GOTO LP1 MOVLW ONE_TWEAK ;Tweak parameter for fine-tuning ONE timing. Adds MOVWF LCVR1 ; a little time between bytes. LP2 DECFSZ LCVR1,F GOTO LP2 GOTO NXT_BIT TOGGLE_ON_OFF ;Toggles on/off mode. BTFSS STAT,ON_OFF_MODE GOTO SET_ON_OFF_MODE BCF STAT,ON_OFF_MODE RETLW 0 CHG_MODE BTFSS STAT,ON_OFF_MODE GOTO SET_ON_OFF_MODE BCF STAT,ON_OFF_MODE RETLW 0 SET_ON_OFF_MODE BSF STAT,ON_OFF_MODE RETLW 0 DEBOUNCE_LO ;Verify PB is reliably on (low). MOVLW Dbnce MOVWF LCVR1 LP4 MOVLW D'255' MOVWF LCVR2 TST_PB BTFSC PORTB,PUSHBUTTON_N GOTO DEBOUNCE_LO DECFSZ LCVR2,F GOTO TST_PB DECFSZ LCVR1,F GOTO LP4 RETLW 0 DEBOUNCE_HI ;Verify PB is reliably off (high). MOVLW Dbnce MOVWF LCVR1 LP5 MOVLW D'255' MOVWF LCVR2 TST_PB1 BTFSS PORTB,PUSHBUTTON_N GOTO DEBOUNCE_HI DECFSZ LCVR2,F GOTO TST_PB1 DECFSZ LCVR1,F GOTO LP5 RETLW 0 Boot ; Initialize I/O ports BSF STATUS, RP0 ;Select bank 1 MOVLW CFG_A ;Select direction of PORTA bits MOVWF TRISA ;Write selection to PORTA data ;direction register MOVLW CFG_B ;Select direction of PORTB bits MOVWF TRISB ;Write selection to PORTB data ;direction register BCF STATUS, RP0 ;Select bank 0 MOVLW INIT_A ;Initialize PORT A MOVWF PORTA MOVLW INIT_B ;Initialize PORT B MOVWF PORTB CLRF STATUS CLRF TMR0 ;Reset TMR0 and prescaler CLRF INTCON BSF STATUS, RP0 ;Select bank 1 (Preselector is in ;bank 1) CLRWDT ;Reset watchdog timer MOVLW OPTINI ;Initialize option register MOVWF OPTION_REG ;Put selection in option register BCF STATUS, RP0 ;Select bank 0 MOVLW 1 MOVWF MSG_CNTR CLRF STAT Start ;The program actually starts here. CALL DEBOUNCE_HI CALL DEBOUNCE_LO MOVLW PB_HLD_TIME ;Verify PB is held down long enough MOVWF LCVR1 ; to change modes (3 counts per second) PB_LP1 MOVLW D'255' MOVWF LCVR2 PB_LP2 MOVLW D'255' MOVWF LCVR3 PB_LP3 BTFSC PORTB,PUSHBUTTON_N GOTO CONTINUE DECFSZ LCVR3,F GOTO PB_LP3 DECFSZ LCVR2,F GOTO PB_LP2 DECFSZ LCVR1,F GOTO PB_LP1 CALL TOGGLE_ON_OFF CONTINUE BTFSS STAT,ON_OFF_MODE GOTO BROWSE_MODE BTFSC PORTA,BASE_DISABLE ;ON/OFF mode here GOTO OFF BSF PORTA,BASE_DISABLE CALL MSG_SND MOVF LAST_MSG,W GOTO MSG_SEL BROWSE_MODE BSF PORTA,BASE_DISABLE MOVF MSG_CNTR,W ;Determines the current message MOVWF LAST_MSG DECFSZ MSG_CNTR,F ; and increments for the next GOTO MSG_FIX ; button push. MOVLW MSG_AVAIL MOVWF MSG_CNTR GOTO OFF ;Turns off after last message. MSG_FIX MOVWF TEMP ;Saves the number currently in W in order to call a routine to send CALL MSG_SND ; "Effect ", which will put new numbers in W. The saved number MOVF TEMP,W ; for the W register is then used to select the next msg to send. GOTO MSG_SEL MSG_SND MOVLW H'00' ;Scroll MOVWF DREG CALL SEND MOVLW A'E' ;Effect(sp) MOVWF DREG CALL SEND MOVLW A'f' MOVWF DREG CALL SEND MOVLW A'f' MOVWF DREG CALL SEND MOVLW A'e' MOVWF DREG CALL SEND MOVLW A'c' MOVWF DREG CALL SEND MOVLW A't' MOVWF DREG CALL SEND MOVLW A' ' MOVWF DREG CALL SEND RETLW 0 MSG_SEL ADDWF PCL,F NOP NOP GOTO MSG38 GOTO MSG37 GOTO MSG36 GOTO MSG35 GOTO MSG34 GOTO MSG33 GOTO MSG32 GOTO MSG31 GOTO MSG30 GOTO MSG29 GOTO MSG28 GOTO MSG27 GOTO MSG26 GOTO MSG25 GOTO MSG24 GOTO MSG23 GOTO MSG22 GOTO MSG21 GOTO MSG20 GOTO MSG19 GOTO MSG18 GOTO MSG17 GOTO MSG16 GOTO MSG15 GOTO MSG14 GOTO MSG13 GOTO MSG12 GOTO MSG11 GOTO MSG10 GOTO MSG9 GOTO MSG8 GOTO MSG7 GOTO MSG6 GOTO MSG5 GOTO MSG4 GOTO MSG3 GOTO MSG2 GOTO MSG1 OFF MOVLW H'01' ;Centered, stationary display MOVWF DREG CALL SEND MOVLW A'O' ;Off MOVWF DREG CALL SEND MOVLW A'f' MOVWF DREG CALL SEND MOVLW A'f' MOVWF DREG CALL SEND BCF PORTA,BASE_DISABLE GOTO START MSG1 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'00' ;00 MOVWF DREG CALL SEND GOTO START MSG2 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'01' ;01 MOVWF DREG CALL SEND GOTO START MSG3 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'02' ;02 MOVWF DREG CALL SEND GOTO START MSG4 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'33' ;3 MOVWF DREG CALL SEND MOVLW H'03' ;03 MOVWF DREG CALL SEND GOTO START MSG5 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'34' ;4 MOVWF DREG CALL SEND MOVLW H'04' ;04 MOVWF DREG CALL SEND GOTO START MSG6 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'35' ;5 MOVWF DREG CALL SEND MOVLW H'05' ;05 MOVWF DREG CALL SEND GOTO START MSG7 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'36' ;6 MOVWF DREG CALL SEND MOVLW H'06' ;06 MOVWF DREG CALL SEND GOTO START MSG8 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'37' ;7 MOVWF DREG CALL SEND MOVLW H'07' ;07 MOVWF DREG CALL SEND GOTO START MSG9 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'38' ;8 MOVWF DREG CALL SEND MOVLW H'08' ;08 MOVWF DREG CALL SEND GOTO START MSG10 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'39' ;9 MOVWF DREG CALL SEND MOVLW H'09' ;09 MOVWF DREG CALL SEND GOTO START MSG11 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'41' ;A MOVWF DREG CALL SEND MOVLW H'0A' ;0A MOVWF DREG CALL SEND GOTO START MSG12 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'42' ;B MOVWF DREG CALL SEND MOVLW H'0B' ;0B MOVWF DREG CALL SEND GOTO START MSG13 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'43' ;C MOVWF DREG CALL SEND MOVLW H'0C' ;0C MOVWF DREG CALL SEND GOTO START MSG14 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'44' ;D MOVWF DREG CALL SEND MOVLW H'0D' ;0D MOVWF DREG CALL SEND GOTO START MSG15 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'45' ;E MOVWF DREG CALL SEND MOVLW H'0E' ;0E MOVWF DREG CALL SEND GOTO START MSG16 MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'46' ;F MOVWF DREG CALL SEND MOVLW H'0F' ;0F MOVWF DREG CALL SEND GOTO START MSG17 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'10' ;10 MOVWF DREG CALL SEND GOTO START MSG18 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'11' ;11 MOVWF DREG CALL SEND GOTO START MSG19 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'12' ;12 MOVWF DREG CALL SEND GOTO START MSG20 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'33' ;3 MOVWF DREG CALL SEND MOVLW H'13' ;13 MOVWF DREG CALL SEND GOTO START MSG21 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'34' ;4 MOVWF DREG CALL SEND MOVLW H'14' ;14 MOVWF DREG CALL SEND GOTO START MSG22 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'35' ;5 MOVWF DREG CALL SEND MOVLW H'15' ;15 MOVWF DREG CALL SEND GOTO START MSG23 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'36' ;6 MOVWF DREG CALL SEND MOVLW H'16' ;16 MOVWF DREG CALL SEND GOTO START MSG24 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'37' ;7 MOVWF DREG CALL SEND MOVLW H'17' ;17 MOVWF DREG CALL SEND GOTO START MSG25 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'38' ;8 MOVWF DREG CALL SEND MOVLW H'18' ;18 MOVWF DREG CALL SEND GOTO START MSG26 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'39' ;9 MOVWF DREG CALL SEND MOVLW H'19' ;19 MOVWF DREG CALL SEND GOTO START MSG27 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'41' ;A MOVWF DREG CALL SEND MOVLW H'1A' ;1A MOVWF DREG CALL SEND GOTO START MSG28 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'42' ;B MOVWF DREG CALL SEND MOVLW H'1B' ;1B MOVWF DREG CALL SEND GOTO START MSG29 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'43' ;C MOVWF DREG CALL SEND MOVLW H'1C' ;1C MOVWF DREG CALL SEND GOTO START MSG30 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'44' ;D MOVWF DREG CALL SEND MOVLW H'1D' ;1D MOVWF DREG CALL SEND GOTO START MSG31 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'45' ;E MOVWF DREG CALL SEND MOVLW H'1E' ;1E MOVWF DREG CALL SEND GOTO START MSG32 MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'46' ;D MOVWF DREG CALL SEND MOVLW H'1F' ;1F MOVWF DREG CALL SEND GOTO START MSG33 MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'30' ;0 MOVWF DREG CALL SEND MOVLW H'20' ;20 MOVWF DREG CALL SEND GOTO START MSG34 MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'31' ;1 MOVWF DREG CALL SEND MOVLW H'21' ;21 MOVWF DREG CALL SEND GOTO START MSG35 MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'22' ;22 MOVWF DREG CALL SEND GOTO START MSG36 MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'33' ;3 MOVWF DREG CALL SEND MOVLW H'23' ;23 MOVWF DREG CALL SEND GOTO START MSG37 MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'34' ;4 MOVWF DREG CALL SEND MOVLW H'24' ;24 MOVWF DREG CALL SEND GOTO START MSG38 MOVLW H'32' ;2 MOVWF DREG CALL SEND MOVLW H'35' ;5 MOVWF DREG CALL SEND MOVLW H'25' ;25 MOVWF DREG CALL SEND GOTO START END