can someone help me to port this code
http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/
to YUN
can someone help me to port this code
http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/
to YUN
Can you be more specific about your problem? We can't help you porting the entire code, we can help you with problems you face. But to face problems you have to start the work by yourself
basicaly
somehow (a friend help me) i have build the circuit and it seems to work, tested with
arduino UNO and headphones (we don't have an oscilloscope)
i have understood how phase accumulator works
my board is YUN and I don't want to buy UNO only for this
i'm just an enthusiastic beginner
thanks for your reply
The timer that has the same features on the Atmega32u4 is the Timer0 because you need Clear on Compare Match and Phase correct PWM mode.
You can see a description of Timer0 in the Atmega 32u4 datasheet http://www.atmel.com/Images/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf
at section 13 page 85.
Usually you need to rename every register of the timer changing the number. For example the standard format for the register OCR2A is OCRxA where you put the number that identifies the timer instead of x, so in this case it will be OCR0A.
You have to do this for every register.
Also you have to check if the Prescaler configuration and Phase Correct PWM has the same register cofiguration in both Atmegas.
Read carefully the Atmega32u4 datasheet timer section and check if the bit configuration is the same as the one used in the sketch ( with the name of the register changed).
FYI: sbi and cbi functions are macros to Set the BIt and Clear the BIt so if you need to set the CS00 in the TCCR0B to 1 you write
sbi(TCCR0B,CS00)