Hi all! I'm new to Arduino DUE, and have a couple of them to begin getting familiar with.
I have a short piece of code show below that successfully compiled and uploaded to the MEGA 2560. Before compiling the code in arduino IDE 1.8.8, I first needed to install a library that is supposed to work with a direct digital synthesis module (DDS) .... AD9959 module. So I installed the library zip file from : GitHub - cjheath/AD9959: AD9959 4-channel Direct Digital Synthesis Arduino Library
The code that a compiled, simply named "AD9959_test1.ino" also comes from the above site, which is pasted in the code section below:
#include <SPI.h>
#include <AD9959.h>
class MyAD9959 : public AD9959<
9, // Reset pin (active = high)
10, // Chip Enable (active = low)
31, // I/O_UPDATE: Apply config changes (pulse high)
25000000, // 25MHz crystal (optional)
1000000 //SPI @ 1 MHz
> {};
MyAD9959 dds;
void setup() {
Serial.begin(115200);
dds.reset();
dds.setClock(15, 0); // multiplier: 15, calibration: 0
dds.setFrequency(MyAD9959::Channel1, 50000000UL); // 50.0 MHz
dds.setAmplitude(MyAD9959::Channel2, 1023); // Maximum amplitude value
dds.setPhase(MyAD9959::Channel2, 16383); // Maximum phase value (same as -1)
dds.update();
}
void loop() {
}
No problems at all compiling and uploading to the MEGA 2560. This is nice, as I should be able to use the MEGA 2560 to get everything done.
Now ---- switching to the Arduino DUE, I attempted to compile the same code when using the arduino IDE with board settings for the Arduino DUE (in "Programming Port" mode), I see messages like:
AD9959_test1\AD9959_test1.ino: In member function 'void AD9959<ResetPin, ChipEnablePin, UpdatePin, reference_freq, SPIRate, SPIClkPin, SPIMISOPin, SPIMOSIPin>::reset(AD9959<ResetPin, ChipEnablePin, UpdatePin, reference_freq, SPIRate, SPIClkPin, SPIMISOPin, SPIMOSIPin>::CFR_Bits) [with unsigned char ResetPin = 9u; unsigned char ChipEnablePin = 10u; unsigned char UpdatePin = 31u; long unsigned int reference_freq = 25000000ul; long int SPIRate = 1000000l; unsigned char SPIClkPin = 13u; unsigned char SPIMISOPin = 12u; unsigned char SPIMOSIPin = 11u]':
AD9959_test1:16:13: error: invalid conversion from 'int' to 'AD9959<9u, 10u, 31u, 25000000ul, 1000000l>::CFR_Bits' [-fpermissive]
dds.reset();
At the moment, it looks like this sort of error is over my head. So would like to ask if there's something that I can alter in the code in order to address that error. I don't understand what that error means right now, and was googling phrases like "error: invalid conversion from 'int', but didn't get anywhere yet! Any tips for pointing me in the right direction will be really greatly appreciated! Thanks in advance!