COUNTERS Of the three timers in the 16F877A, only Timer0 (an 8-bit timer) and Timer1 (the 16-bit timer) can be used as counters. Timer2 does not have a counter input line. Generally speaking this makes Timer0 suitable for use with small counts and rapid interrupts and Timer1 suitable for larger counts. HOW DOES A COUNTER […]
Continue reading…
Uncategorized
TIMERS AND COUNTERS:Exercises for Timers and Exercises for Counters
Exercises for Timers 1. Write a program to generate a one minute timer clock with a 0.1 second display and then do the following: N Check its accuracy with the time site on the Internet. N Make adjustments to make it accurate to within one second per hour and then per day. Can this be […]
Continue reading…
TIMERS AND COUNTERS:THE WATCHDOG TIMER
THE WATCHDOG TIMER A Watchdog Timer is a timer that sets an interrupt that tells us that for some reason the program has hung up or otherwise gone awry. As such it is expected that in a prop- erly written and compiled program the Watchdog Timer will never set an interrupt. This is accomplished by […]
Continue reading…
TIMERS AND COUNTERS:PRE-SCALERS AND POST-SCALERS
PRE-SCALERS AND POST-SCALERS Pre-scalers and post-scalers can be confusing for the beginner. Here is a simple explanation. A pre-scaler is applied to the system clock and affects the timer by slowing down the system clock as it applies to the timer. Normally the timer is fed by a fourth of the basic clock frequency, which […]
Continue reading…
TIMERS AND COUNTERS:TIMER OPERATION CONfiRMATION
TIMER OPERATION CONfiRMATION To make sure a timer is working, set up a program in which the interrupt routine incre- ments a variable and the main loop displays it. If you see the variable incrementing, the interrupt routine is working. The speed of the incrementing will give you some idea of the rate at which […]
Continue reading…
TIMERS AND COUNTERS
If you have no knowledge about timers, you should read this chapter a few times. However, there is some repetition in the other chapters to allow each part of the book to stand as an independent resource. Most users will find that using the timers and the counters is the hardest part of learning how […]
Continue reading…
CONTROLLING THE OUTPUT AND READING THE INPUT:THE LCD DISPLAY
THE LCD DISPLAY This section describes the use of and interactions with existing hardware connections as they come with the LAB-X1 module. Other wiring schemes can be used with ease as defined in the compiler manual. The LCD is controlled from PORTD, and all eight bits of this port are connected to the LCD. You […]
Continue reading…
CONTROLLING THE OUTPUT AND READING THE INPUT:EXERCISES
EXERCISES Answers to these problems are not provided. Since this is really all about input and output, a comprehensive set of exercises that focus specifically on input and output have been provided. We need to be completely comfortable with these I/O functions before we start on running motors, so you are encouraged to expand on […]
Continue reading…
THE SOFTWARE, COMPILERS, AND EDITORS:Basic Compiler Instruction Set
Basic Compiler Instruction Set The following is a list of the commands provided in the smaller compiler:
Continue reading…
THE SOFTWARE, COMPILERS, AND EDITORS:PICBASIC PRO COMPILER
PICBASIC PRO COMPILER The PICBASIC PRO Compiler (referred to as the PBP hereafter) provides all the func- tions needed to program almost the entire family of PIC microcontrollers in a BASIC- like environment. This means that it allows you to write programs that read the inputs and write to the outputs in a simple and […]
Continue reading…