Kommentar: Einfügen von HTML im Kommentar: Link einfügen: <a href="LINKURL" target="_blank">LINKTITEL</a> Bild einfügen: <img src="BILDURL"> Text formatieren: <b>fetter Text</b> <i>kursiver Text</i> <u>unterstrichener Text</u> Kombinationen sind auch möglich z.B.: <b><i>fetter & kursiver Text</i></b> C Quellcode formatieren: <code>Quellcode</code> BASIC Quellcode formatieren: <basic>Quellcode</basic> (Innerhalb eines Quellcodeabschnitts ist kein html möglich.) Wichtig: Bitte mache Zeilenumbrüche, bevor Du am rechten Rand des Eingabefeldes ankommst ! -> I > Hi Torsten, > > So you want to quit the game? That's a pity. > Still I have two remarks. > > 1. It seems that the problem with the dwords only arises with constants. So it might be > circumvented by replacing constants with dword variables. > > 2. I suspected that you did not believe in my solution. Let me therefore prove that it should > work, at least theoretically. > > Suppose the signal period is 131071 (2^16 + 2^16-1) cpu ticks. > Then the capture would read 65535 (2^16-1) cpu ticks. > The slow timer ticks at a rate that is 2^12 times slower than the cpu (and the capture timer). > Then, ideally spoken, the slow timer should indicate 131071/2^12 = 31 slow ticks > (of 0,278 ms each). > In practice, all sort of events block the in time handling of both IRQ functions. Say this causes > an error in the counter of the the slow timer of + or - 1.5 ms, that is about + or - 6 slow ticks. > So in practice, the slow timer will indicate anything between 25 and 37 ticks. > Now perform my calculation with the two extremes: > Overflows = ((25+8)*4096 - 65535) / 65536 = 1 (which is correct) > Overflows = ((37+8)*4096 - 65535) / 65536 = 1 (which is also correct) > > Now suppose the signal period is 131072 (2^16 + 2^16) cpu ticks. > Then the capture would read 0 cpu ticks. > Ideally spoken, the slow timer should indicate 131072/2^12 = 32 slow ticks. > In practice, the slow timer will indicate anything between 26 and 38 ticks. > Perform the calculations with the two extremes: > Overflows = ((26+8)*4096 - 0) / 65536 = 2 (which is correct) > Overflows = ((38+8)*4096 - 0) / 65536 = 2 (which is also correct) > > If you want, try other signal periods. My calculation will always show to be correct. I think it is > only a matter of programming to make it work in practice. Pity we didn't succeed. > > Regards, > Pepe