| ??? 01/31/00 06:33 Read: times |
#1355 - RE: Calculate time of the loop: |
Hi Babar,
if you have count the number of cycles, you have the reverse problem: Make a delay loop for the new crystal with a different count of cycles. I have the following macro (using Keil assembler) as solution for easy changing the crystal. Peter mdelay macro value, rx, ry ;cycle, used register(s) local m____1 if( value < 5 ) rept value nop endm elseif( value < 515 ) mov rx, #low((value-1)/2) djnz rx, $ if((value and 1) = 0) nop endif else mov rx, #high(value/2+253) mov ry, #low(value/2-2) m____1: djnz ry, m____1 djnz rx, m____1 if(value and 1) nop endif endif endm |
| Topic | Author | Date |
| Calculate time of the loop: | 01/01/70 00:00 | |
| RE: Calculate time of the loop: | 01/01/70 00:00 | |
| RE: Calculate time of the loop: | 01/01/70 00:00 | |
| RE: Calculate time of the loop: | 01/01/70 00:00 | |
| RE: Calculate time of the loop: | 01/01/70 00:00 | |
RE: Calculate time of the loop: | 01/01/70 00:00 |



