Final answer:
To generate a 1ms signal with a 20MHz oscillator using Timer1, one must calculate the suitable prescaler and TMR1 values. Timer1 can function purely as a timer and has a limit on the count value depending on whether a prescaler is used. To create a 1s delay, adjustments might need to be made to the circuit or timer settings.
Step-by-step explanation:
To generate a signal using Timer1 with a period of 1ms on a microcontroller system with an oscillator frequency of 20MHz, you need to determine the appropriate values of prescaler and TMR1 for the given period. The goal is to find the most accurate integer combination for the timing circuit.
First, calculate the number of clock cycles per millisecond (ms): 20MHz means 20,000,000 cycles per second, so for 1ms, there would be 20,000 cycles. To define TMR1 and prescaler values, you need to find a prescaler that, when applied to 20,000, yields a value within the range that TMR1 can count (typically 0-65535 for a 16-bit timer).
Timer1 can be used as a timer only (T).
Timer1 without prescaler can count from 0 to 65535.
The TMR1 with its prescaler can count the number of cycles determined by the prescaler selected and the oscillator frequency.
To make a delay of 1s using Timer1, it may or may not be possible depending on the maximum count value of the timer and the prescaler options. If the timer cannot reach 1 second directly by counting, changing the circuit would involve using a larger prescaler, programming an interrupt service routine to handle the timer overflow to extend the delay, or using an external clock with a lower frequency.