Arduino Due and ADK 2012

Thanks. Is it possible to output Audio from ADK2011 board?

Got following error when I compiled your code above on ADK2012 IDE or Arduino 1.5.1r2.

C:\Users\user\AppData\Local\Temp\build5437525985664053003.tmp\sketch_jan11a.cpp.o sketch_jan11a.ino:4: fatal error: ADK.H: No such file or directory compilation terminated.

It looks like it might be a file name issue. Try changing “ADK.H” to “adk.h”. If that doesn’t work, check your “hardware/arduino/sam/libraries/USBHost/” directory. If the “adk.h” exists, something else might be wrong.

Please pardon the ignorance, as I'm just now getting started with this piece of the Arduino world (ADK on Due).

I noticed that in http://arduino.cc/blog/category/arduino/adk/ the author mentions: "The ADK2012 is based on the upcoming Arduino Due platform" - This seems to imply that ADK2012 should be directly compatible with the Due... has this not proven to be true?

djjoshuad: Please pardon the ignorance, as I'm just now getting started with this piece of the Arduino world (ADK on Due).

I noticed that in http://arduino.cc/blog/category/arduino/adk/ the author mentions: "The ADK2012 is based on the upcoming Arduino Due platform" - This seems to imply that ADK2012 should be directly compatible with the Due... has this not proven to be true?

I'm by no means an expert on that so someone with more knowledge of the matter should feel free to correct me.

The Due hardware is close to, if not exactly, identical to the ADK2012 kit if you take away all the bells and whistles. I've managed to get the Due working with the ADK2012 app, albeit with some latency issues. This is probably due to the 1.5.1r2 libs not supporting the newer ADK features.

The problem I've had, to my limited understanding, is that the version of the Arduino IDE that they're using for the ADK2012 resources doesn't take into account some of the quirks of the Due (eg. the 1200bps pulse prior to flashing). With the standard Arduino IDE (1.5.1r2), the libs are currently supporting the 2011 protocol. They're similar but there may be some extra functionality that will need to be added in. Trying to use Google's libs in the beta IDE fails since the ADK class names conflict and, fixing that, there's some issues with the conflicting of UOTGHS_Handler to be handled.

I know it's not meant to be exactly 1:1 functional with the ADK hardware but being able to use some of the functionality of that kit would be handy, especially the USB Audio parts. I've tried making some attempts at it but I don't know enough about the hardware to make any sort of real effort at porting all of the functionality over. Some idea about how the ADK libs function would be helpful to those of us wanting to attempt this.

Thanks for the reply. I may put some effort into this as well, although I'm (obviously) less in-the-know than you are. I have two Due boards on my bench that are just begging to become android-controlled thermostats for my house. There has been some great work done over at androidthermostat.com and while they have focused on the IOIO, I plan to port the accessory interface of their app to ADK2012 and (hopefully) the Due.

After doing a bit of digging around, it looks like a successful and familiar way to do this would be to use Processing for both the android side and the arduino side. Have you tried this combo or had any luck getting it to work?

Thanks. I resoved it. I should choose correct board--Arduino Due. Compiled successfully after I choosed board--Arduino Due.

Succeeded to upload your code into the Due. But the Nexus 7 or GS3 can't recognize the Due with ADK 2012/2011. Can you do it? Thanks.

The GS3 and the Nexus 7 can both recognize the Due with ADK 2012, I've tested with both. Are you running a custom ROM or kernel? Perhaps one that leaves out USB accessory mode?

djjoshuad: The GS3 and the Nexus 7 can both recognize the Due with ADK 2012, I've tested with both. Are you running a custom ROM or kernel? Perhaps one that leaves out USB accessory mode?

I use stock rom with rooted. The GS3/Nexus 7 recognized the Due as "connected to a USB accessory". But ADK 2012 couldn't recognize the Due. Connection: PC-->USB Cable-->Programming Port on Due Nexus 7/GS3-->USB Cable-->OTG-->Native Port on Due.

In that case it must be the way the Due is representing itself. What sketch have you loaded on the Due?

djjoshuad: In that case it must be the way the Due is representing itself. What sketch have you loaded on the Due?

ADK 2012 should recognize the Due on Nexus 7. But waited a long time more than 5 minutes, ADK 2012 could not start correctly, it was forced stopped. GS3 still could not recoginze the Due. I have loaded the sketch from Ardroid on this post.

ADK2012 is looking for a specific device, namely the ADK demo board that they handed out at I/O. The device identifies itself by sending strings to android. If you use the constants in the example from mikepparks, adk2012 should "see" the board... although of course none of the testing features will work by default since none of those circuits exist (unless you put them there).

amberjack1394: Hi all, I just confirmed upload of modified ADK2012 to DUE on both Mac and Win in my desk. Mac: Macbook Pro 10.6 with JDK 6 DUE: program port Win: Windows7 64bit DUE: native port (BOSSA Program port (COM**)) Thanks to aleu and jamgofei and all.

Why don't the mac/windows tools use the same port for programming?

they do. rather, they can. This is just how he did it.

I have my Due working with sound from a Galaxy Nexus but the quality is pretty poor. I put a 1KHz tone on my phone and played it through the Due and it quickly becomes apparent that there is something wrong. There are gaps in the audio which don't seem to be periodic. On the scope I see small gaps about a millisecond long. The gaps happen about every 100msec (or so). After the gap, the output continues at the same voltage which makes me think the dac might be sending the same value during the gap until more data is available. Anyone else observe this?

nwscfox1: I have my Due working with sound from a Galaxy Nexus but the quality is pretty poor. I put a 1KHz tone on my phone and played it through the Due and it quickly becomes apparent that there is something wrong. There are gaps in the audio which don't seem to be periodic. On the scope I see small gaps about a millisecond long. The gaps happen about every 100msec (or so). After the gap, the output continues at the same voltage which makes me think the dac might be sending the same value during the gap until more data is available. Anyone else observe this?

Can you control volume when audio out via Due? I could not adjust volume when output audio via Due.

The volume over the usb seems to be fixed but there is a line in the code on Due that claims to be a volume adjustment; after combining the left and right channel, they multiply by a value and the comment is something about volume adjustment.

ardroid:

jangofei:
Great! I have the following questions:

  1. Which Arduino IDE do you use? arduino-1.5.1r2? or adk2012_ide-win32-20120629?
  2. What app do you use on Nexus 7 to transfer data to Due?
  3. Is DC to supply power a must? Arduino Due can’t work when I use a DC–3.3V & 2.0A. What DC do you use?
  1. Used ADK2012 IDE from Google
  2. This Terminal App, http://labs.arduino.cc/uploads/ADK/ArduinoTerminal/ThibaultTerminal_ICS_0001.apk
  3. You can use computer’s USB power and I’ve tested 12V DC external power also. It works either way. (Arduino DUE has some issue with USBVSB (USB Master power control) That’s why usbh.c needs to updated to work properly on DUE.

When use ADK2012 IDE for Due, do you copy board definition from Arduino IDE 1.5.1 to ADK2012 IDE? Since pin array of Arduino Due is different from Google ADK2. For example, Blink sketch will not blink LED if you choose board Google ADK2, because Google ADK2 define PC9 as pin 13, Arduino Due use PB27 as pin 13. I copy directory hardware/arduino/sam/variants/arduino_due_x from Arduino IDE 1.5.2 to ADK2012 IDE and select it as board, but some errors happen during compiling. Do you know have any idea or experience about this issues? Thanks.