In: Electrical Engineering
(CO 3) If an event is captured at a reading of 0x52BA, what will the counter value be if the next event occurs after 1 ms? The E-clock is 12 MHz.
Group of answer choices
a) 0xD06C
b) 0x72AC
c) 0x819A
d) 0xF020
The reading in TCNT register gets incremented for every clock pulse. When an event happens, the event time is recorded in a 16-bit (TCNT - Timer Counter) register. Physical time is represented by count in TCNT register.
Suppose the clock frequency is 'F'. If an event is captured and at the time of capture TCNT register reading is 'X'. The next event is captured and at the time of capture TCNT register reading is 'Y'. The time difference between events is calculated as follows: (Remember that 'X' and 'Y' are hexadecimal values in TCNT register)
In our question,
Reading of first event X = 0x52BA;
time difference (Td) = 1ms = 10-3 seconds.
Frequency (F) = 12MHz = 12*106 Hz.
Now convert X in hexadecimal to decimal system. (0x52BA)16 = (21178)10. So t1 = 21178.
Apply formula as (t2 - t1)/F = Td
(t2 - 21178) = (12 * 106) * (10-3)
(t2 - 21178) = 12000
t2 = 12000 + 21178 = 33178
We got t2 = (33178)10. But we need Y. So convert t2 into hexadecimal system which gives the answer. The value (33178)10 = (819A)16.
Therefore answer = (819A)16 = 0x819A.
The counter value for the next event will be 0x819A. Hence option-c is correct.