[Menu]>[Circuits Gallery]>[Signboard 2]>[Software]>[Main process]


Processing explanation
of Main process for Signboard 2



Title

;********************************************************
;
;           The signboard control 2 processing
;
;                                 Author : Seiichi Inoue
;********************************************************

    I wrote the title of the program using the comment( ; ).



LIST and INCLUDE directive

        list            p=pic16f84a
        include         p16f84a.inc
    Processor type is set by LIST directive.
    The standard label definition of PIC16F84A is read by the INCLUDE directive.
    As for the change of the standard label definition of PIC16F84A, refer to "Processing explanation of signboard".
    Or you can use ERRORLEVEL directive to suppress the Warning messages.



Configuration Word

 __config _hs_osc & _wdt_off & _pwrte_on & _cp_off
    Configuration Word can be set when writing a program by the programmer. However, it is automatically established when using CONFIG directive.
    As for the contents of operand, refer to "Processing explanation of signboard".

    ItemContentsField nameBit(s)
    Code ProtectionOFFCP1111111111
    Power-up TimerONPWRTE(inv)0
    Watchdog TimerOFFWDTE0
    Oscillator SelectionHSFOSC1 and FOSC010




Debug mode specification

;**************  Debugging mode setting  ****************
;For debugging mode, ";" of next line should be removed.
;#define  _debug
    It sometimes had better modify the part of the processing step when debugging software.
    This time, the steps for timer is skiped for the debugging.
    For the details, refer to "Debugging of Count-down timer".




Label definition

;**************** Label Definition ********************
    The labels for common use are defined.




Program start

;**************** Program Start ***********************
    Instruction is executed from Zero addresses of the program memory when making the power ON of the PIC. When there is interruption processing, processing is begun from the addresse 4.



Initialization process

;**************** Initial Process *********************
    The following processings are done as the initialization processing after the turning on.
    Set mode of PORTA and PORTB to output
    Set edge LED to CW
    OFF all of the LEDs





Main process
;****************** Main Process **********************
    In the main processing, various display effect subroutines are called in the order.
    It makes display continuously in returning to the head with the last step.



Display effect process
;********************************************************
;*    Required effect processings are put below.        *
;********************************************************


;********************************************************
;*    Required effect processings are put above.        *
;********************************************************
    The display effect processings are put on above-mentioned among two titles.
    I put the label definition to use by the display effect processing in these too.



Interruption process
;*************** Interruption processing **************
    In the processing this time, interruption processing isn't used. So, an interruption is ended in the RETFIE instruction.



LED control subroutine
;************* LED control Subroutine *****************
    The contents of the screen table are controlled on the left from the right.
    The control of PORTB is done by the byte unit. As it kept RB7 (The rotation data for the edge LED), it is rewriting only 7-bit data.
    I put a wait in the about 100-u seconds to guarantee the operating time of the hardware after setting the data to PORTB and PORTA. This waiting time depends on the operation speed of CPLD.



Timer subroutine
;       <<< Timer  Subroutine for 10MHz clock  >>>
    The following timer is preparatory as the software timer subroutine.
    LED control waiting timer
    1-msec timer
    100-msec timer
    500-msec timer
    1-sec timer

    As for the timer subroutine, refer to "Processing explanation of LED flasher".




End of coding

;********************************************************
;          END of signboard control processing
;********************************************************

        end
    At the end of coding, END directive is used.