AtomSoft
Well-Known Member
hey guys im playing with some avr code and am really confused about the MIPS thing.
I found out that the TINY13 can do 9.6 MHZ easy. Now in a PDF from ATMEL they claim there 9.6 MHZ is 9.8 MIPS which i dont care.
Now if its 9.8MIPS if i divide it by 1000 (1 second) that makes it
9800 Instructions for 1 millisecond correct?
So 200 Milliseconds should be 9800 * 200 = 1,960,000 Instructions
So 200mS = 1,960,000 instructions right?
How come in AVR Studio im doing a loop for 200mS using the below code
This should only delay about 4788 Instructions. This seems to give me about 202mS of delay time which is ok but why is the above math wrong?
in the Cycle Counter it says the delay took 19253 Cycles to complete.
Is the clock split in anyway? or what am i missing here?
I found out that the TINY13 can do 9.6 MHZ easy. Now in a PDF from ATMEL they claim there 9.6 MHZ is 9.8 MIPS which i dont care.
Now if its 9.8MIPS if i divide it by 1000 (1 second) that makes it
9800 Instructions for 1 millisecond correct?
So 200 Milliseconds should be 9800 * 200 = 1,960,000 Instructions
So 200mS = 1,960,000 instructions right?
How come in AVR Studio im doing a loop for 200mS using the below code
Code:
Delay200mS: ;delay 202mS at 9.6mhz
ldi d2, 0x13
repeatd2:
dec d2
ldi d1, 0xFC
delay200ms_1:
dec d1
cpi d1,0x00
brne delay200ms_1
cpi d2,0x00
brne repeatd2
ret
This should only delay about 4788 Instructions. This seems to give me about 202mS of delay time which is ok but why is the above math wrong?
in the Cycle Counter it says the delay took 19253 Cycles to complete.
Is the clock split in anyway? or what am i missing here?