![]() ![]() The interruption time = (4/OSC freq) x Prescaler x Hard timer count x Soft countĪbove-mentioned value is a value with few errors and little interruption time. The interruption time can be calculated by the following formula. Processing since then is repeatedly executed until there is a time-out.Īt the time of the time-out, it returns to the initialization processing. It sets an interruption possible condition. ![]() The set value of the soft counter : It sets for an error to be minimized. The count value of the hard timer : I set for an error to be minimized. I set a maximum to make the interruption number of times little. The oscillator frequency : I use 10-MHz oscillation. To decide the interruption time of the timer, there is a following element. It is necessary to make have interruption in 1 second as correctly as possible. It executes the initialization of the interruption timer. The following processing is executed when detecting that the start switch became ON with the timer stand-by process. It checks the condition of the start switch. It sets the 6th port of port B to the input mode. It outputs the contents of the counter to the LED. ![]() It sets the set value of the BCD switch to the count value. In the condition that the count-down of the timer hasn't started, the following processing is repeatedly executed. It sets a non-time-out condition to the time-out display memory (the flag). It writes the lighting-up pattern of 7 segments in the RAM memory. It sets the output of the 3rd port at port A to '1'. It sets the condition of the timer start-up. It uses the 4th port for the input port of the STOP key.Īs for the pull-up function, refer to "The specification of B port ( RB0-RB3 )". It sets four of port A from the 0th to the 3rd to the output port and it sets the 4th to the input port. The following processings are done as the initialization processing after the turning on. It makes each processing jump with the GOTO instruction. When there is interruption processing, processing is begun from the addresse 4. Instruction is executed from Zero addresses of the program memory when making the power ON of the PIC. However, this time, I was made to be able to change the part to assemble by the definition of the '_debug' label.įor the details, refer to "Debugging of Count-down timer". This time, the initial value of the counter value, the set value of the timer, the condition of the stop switch are set for the debugging. It sometimes had better modify the part of the processing step when debugging software. For debugging mode, " " of next line should be removed. The pattern definition of the 7 segment LED is specified by the EQU, too. The standard label of PIC16F84A is read in INCLUDE directive. The definition of the label constant to use by the processing is done. However, it is automatically established when using CONFIG directive.Īs for the contents of operand, refer to "Processing explanation of signboard". _config _hs_osc & _wdt_off & _pwrte_on & _cp_offĬonfiguration Word can be set when writing a program by the programmer. Or you can use ERRORLEVEL directive to suppress the Warning messages.Ĭonfiguration Word is specified using CONFIG directive. The standard label definition of PIC16F84A is read by the INCLUDE directive.Īs for the change of the standard label definition of PIC16F84A, refer to "Processing explanation of signboard". I wrote the title of the program using the comment( ). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |