
Zitat von
pebisoft
ich finde nichts darüber welcher interrupt genutzt wird wenn ein ....... auch der waitbefehl macht mir schaffen mit dem interrupt. der "waitus 1" z.b dauert über 1,8 us in der realen welt beim ablauf, das darf nicht sein.
in der beschreibung steht nur allgemeines basicgeplänkel für den totalen anfänger, geht aber nicht auf besonderheiten der speziellen bascomroutinen ein, die ihren eigenen weg gehen und nicht den man vermutet.
mfg pebisoft
Also, das Du nichts findest ist nun wirklich Dein ganz persönliches Problem.
Was bitte ist unklar an:
No accurate timing is possible with this command.
In addition, the use of interrupts can slow this routine.
The minimum delay possible is determined by the used frequency.
The number of cycles that are needed to set and save registers is 17.
When the loop is set to 1, the minimum delay is 21 uS. In this case you can better use a NOP that generates 1 clock cycle delay.
At 4 MHz the minimum delay is 5 uS. So a waitus 3 will also generate 5 uS delay.
Above these values the delay will become accurate.
und:
ASM
WaitMS will call the routine _WAITMS. R24 and R25 are loaded with the number of milliseconds to wait.
Uses and saves R30 and R31.
Depending on the used XTAL the asm code can look like :
Code:
_WaitMS:
_WaitMS1F:
Push R30 ; save Z
Push R31
_WaitMS_1:
Ldi R30,$E8 ;delay for 1 mS
Ldi R31,$03
_WaitMS_2:
Sbiw R30,1 ; -1
Brne _WaitMS_2 ; until 1 mS is ticked away
Sbiw R24,1
Gleiches gilt auch für die Comport Arie. Steht alles da, zugegeben, bisweilen muss man etwas suchen.
Henrik
Lesezeichen