[an error occurred while processing this directive]
|
;Periphery setup:Init:
ldi temp,(1< < WGM12) | (1< < CS10)
out TCCR1B,temp ;clear on compare match, CK/1ldi temp,(1< < COM1A1)
out TCCR1A,temp ;OC1A clear on compareldi temp,high(FCLK/FUPD-1)
out OCR1AH,temp
ldi temp, low(FCLK/FUPD-1)
out OCR1AL,templdi temp,(1< < OCF1A)
out TIFR,temp ;clear pending timer interrupt
out TIMSK,temp ;enable output compare interruptldi temp,(1< < SPE) | (1< < MSTR) | (1< < CPHA)
out SPCR,temp ;SPI enable, MSB first, masterldi temp,(1< < SPI2X)
out SPSR,temp ;double SPI speed
DacLoad:ldi XL,(1< < COM1A0)
out TCCR1A,XL ;OC1A toggle
ldi XL,(1< < COM1A0) | (1< < FOC1A)
out TCCR1A,XL ;set SCK (OC1A force toggle)
Port_I2SWS_0 ;clear WS
out TCCR1A,XL ;clear SCK (OC1A force toggle)out SPDR,SinH ;---> load DAC high byte
;KURIM
out SPDR,SinL ;---> load DAC low byte
;KURIM
ldi XL,(1< < COM1A0) | (1< < FOC1A)
out TCCR1A,XL ;OC1A force toggle
out SPDR,r0 ;zero data for another DAC channel
Port_I2SWS_1 ;set WS
ldi XL,(1< < COM1A1)
out TCCR1A,XL ;OC1A clear on compare