Submit a pdf of your work by the due date. Show your work!!!! Assume XTAl=10MHz.
ID: 3689610 • Letter: S
Question
Submit a pdf of your work by the due date. Show your work!!!! Assume XTAl=10MHz. Find TMROH, TMROL value needed to generate a time delay of 2 ms. Use 16-bit mode, no prescaler mode. Assume XTAL=10MHz. Find TMROH, TMROL value needed to generate a time delay of 5 ms. Use 16-bit mode and the largest prescaler possible. Assume XTAL=10MHz, and we are generating a square wave on pin RB7, find the lowest square wave frequency that we can generate using TIMERO in 16-bit mode. Repeat Problem 3 for 8-bit mode.Explanation / Answer
1.Assume that XTAL = 10 MHz. Find the TMR0H, TMR0L value needed to generate a
time delay of 2 ms. Use 16-bit, no prescaler mode.
ANS:Given data is 10 MHz/4 = 2.5 MHz,
1/2.5 MHz = 0.4 us,
2 ms/0.4 us = 5000,
65536 – 5000 = 60536 = 0xEC78,
TMR0H is
TMR0H = 0xEC,
TMR0L is
TMR0L = 0x78
2. Assume that XTAL = 10 MHz. Find the TMR0H, TMR0L value needed to generate a
time delay of 5 ms. Use 16-bit mode, and the largest prescaler possible.
ANS:Given data is 10 MHz/4 = 2.5 MHz,
1/2.5 MHz = 0.4 us,
5 ms/0.4 us = 12500,
12500/256 = 49
65536 – 49 = 65487 = 0xFFCF,
TMR0H is
TMR0H = 0xFF,
TMR0L is
TMR0L = 0xCF
1.Assume that XTAL = 10 MHz. and we are generating a square wave on pin RB7 fiond the lowest square wave frequency we can generate using TIMER in 16-bit mode.
Ans:
we are generating a square wave on pin RB7
10 MHz / 4 = 2.5 MHz,
2.5 MHz / 256 = 9765.625Hz,
1 / 9765.625 Hz =102.4s,
102 4. s * 65536 =6.7108864 s,
6.7108864 s * 2 = 13.4217728 s,
1 / 13.4217728 = 0.0745058 Hz
the lowest frequency is equal to 0.0745058HZ.