05.02.2008, 12:25 PM
..and now for something different..
prinzip: dds loop für mega48:
; main loop
;
; r28,r29,r30 is the phase accumulator
; r24,r25,r26 is the adder value determining frequency
;
; add value to accumulator
; load byte from current table in RAM
; output byte to port
; repeat
;
LOOP1:
add r28,r24 ; 1
adc r29,r25 ; 1
adc r30,r26 ; 1
ld r0,Z ; 3
out PORTB,r0 ; 1
rjmp LOOP1 ; 2 => 8 cycles !!
bei 20mhz clock -> max. 2,5 M sampels out
prinzip: dds loop für mega48:
; main loop
;
; r28,r29,r30 is the phase accumulator
; r24,r25,r26 is the adder value determining frequency
;
; add value to accumulator
; load byte from current table in RAM
; output byte to port
; repeat
;
LOOP1:
add r28,r24 ; 1
adc r29,r25 ; 1
adc r30,r26 ; 1
ld r0,Z ; 3
out PORTB,r0 ; 1
rjmp LOOP1 ; 2 => 8 cycles !!
bei 20mhz clock -> max. 2,5 M sampels out
Don't worry about getting older. You're still gonna do dump stuff...only slower