The following program is used to write data to a printer using
the SPP protocol showed below.
void PutChar(unsigned char c)
{
while ((PTJ & 0x02) !=0 );
PTH = c;
PTJ = PTJ & ~0x01;
NOP;
//....
NOP;
PTJ = PTJ | 0x01;
}
How many NOP statements must be used to insure the
STRB# line is low for the minimum amount of time
if n = 0.5
?s and the processor takes
5clock tick(s) per instruction with a clock of
10.0 MHz?
We can see that we have to make it low for 0.5 sec and each clock cycle is 1/10*10^6=100 ns
where ns is nano secs
Then each instruction takes 5*100=500 ns
And Hence 0.5=500ns*n where n is the number of nop instructions
Hence we have
=10^6 instructions
Or 10^6 NOP statements
The following program is used to write data to a printer using the SPP protocol showed...
The following program is used to write data to a printer using the SPP protocol showed below void PutChar (unsigned char c) while ((PTJ & 0x02) !#0 ) ; PTH c PTJ PTJ&0x01; NOP NOP STRB # ACK# BUSY ::: : min.; min. min mi. How many NOP statements must be used to insure the STRB# line is low for the minimum amount of time l n-0.5 μs and the processor takes 3 clock tick s) per instruction with a...