[Menu]>[Circuits Gallery]>[Signboard 2]>[Software]>[Main process]
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
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
As for the contents of operand, refer to "Processing explanation of signboard".
Debug mode specification ;************** Debugging mode setting **************** ;For debugging mode, ";" of next line should be removed. ;#define _debug
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 ********************
Program start ;**************** Program Start ***********************
Initialization process ;**************** Initial Process *********************
Set mode of PORTA and PORTB to output Set edge LED to CW OFF all of the LEDs Main process ;****************** Main Process **********************
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. * ;********************************************************
I put the label definition to use by the display effect processing in these too. Interruption process ;*************** Interruption processing **************
LED control subroutine ;************* LED control Subroutine *****************
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 >>>
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
|