Show Posts
Pages: [1] 2 3 ... 5
1  Products / Arduino Due / Re: Arduino due in low power mode on: February 15, 2014, 08:24:59 am
I've done a few experiments measuring power consumption on DUE.  Running blink sketch (4s period) and power by USB, DUE consumes  115.1ma/116.5ma (board LED off/on).  If I power via Vin, I measure 79.2/80.2 (off/on ma)

Powered via Vin, pmc_enable_backupmode() consumes 18.6ma,  pmc_enable_sleepmode(0) in loop() consumes 60.5 ma, presumably coming out of sleep by timer interrupts.  pmc_enable_waitmode() consumes 78.3ma, so it doesn't seem to be reducing power?

DUE specs suggest ARM chip:  sleep(29ma),wait(23ua),backup(2.5ua)
Of course DUE board has ATMEGA16US, voltage reguators and various LEDs
2  Using Arduino / Installation & Troubleshooting / DUE programming port no longer working on: February 13, 2014, 07:22:03 pm
DUE programming USB port no longer working -- native USB port OK.  Orginally posted on DUE thread
  http://forum.arduino.cc/index.php?topic=216547.0
3  Products / Arduino Due / Re: bad DUE programming port USB on: February 10, 2014, 07:00:33 am
Sorry for not providing enough detail.  No drivers to install.  Host machines are Ubuntu 12.04 and 12.10 and using IDE 1.5.5
it's looking like a hardware problem on DUE connector ...
4  Products / Arduino Due / Re: bad DUE programming port USB on: February 09, 2014, 09:05:46 am
Nope, that incantation did not help.

sometimes it also says  " SAM-BA operation failed"
5  Products / Arduino Due / bad DUE programming port USB on: February 09, 2014, 07:51:44 am
The IDE no longer recognizes the programming port on my DUE (ttyACM0 not found).  If I move the cable to the Native port, everything works.  In the programming port, I do see power LEDs on, but it won't upload and a sketch won't print to the monitor.  I assume one or more of the pins in the connector must have lost connection??   Any magic that might be applied?

I have tried another cable and tried hooking to a different computer ... no luck.

(at least, it works with the Native port)
6  Products / Arduino Due / CC3000 wifi on DUE on: January 18, 2014, 01:27:48 pm
Here are some initial test results of TI's CC3000 wifi chip on the Adafruit breakout board:
    https://www.adafruit.com/products/1469
The Adafruit CC3000 library (github) was recently updated to include support of DUE.  Results for some UDP and TCP tests on DUE (12 mhz SPI) and on Teensy 3.0 and 3.1 (8 mhz SPI) and mega2560 (8 mhz SPI) can be found at
     https://github.com/manitou48/DUEZoo/blob/master/cc3000.txt

(To support big buffers, required patch to SPI.transfer loop in ccspi.cpp to use uint16_t loc )
7  Products / Arduino Due / Re: Arduino due / ppm on: December 06, 2013, 04:45:54 pm
Hmmm, I guess you wanted to go from servos to PPM.  Here is another untested DUE snippet that reads 6 servo channel pins and outputs a PPM stream.  You need to order the servo channels so the PPM output is what the PPM receiver expects.  The loop() is busy doing the PPM output.  If you have other work to do, you can use stimmer's code above to generate the PPM stream in the background.

Code:
// generate a ppm stream from 6 channels of "servo" input, e.g. RC receiver
//  you'll need to know servo order that ppm receiver is expecting
// PPM output on pin 3, servos in order pins 4-9

#define MAX_SERVOS 6
uint32_t servos[MAX_SERVOS];   // pulse width in microseconds

#define PW 400
#define W 24000

#define PPM_PIN 3

void handler1() {
static uint32_t prev=0;
uint32_t width,t;
t = micros();
if (digitalRead(4) == LOW) servos[0] = t - prev;  // fallen
prev = t;
}

void handler2() {
static uint32_t prev=0;
uint32_t width,t;
t = micros();
if (digitalRead(5) == LOW) servos[1] = t - prev;  // fallen
prev = t;
}

void handler3() {
static uint32_t prev=0;
uint32_t width,t;
t = micros();
if (digitalRead(6) == LOW) servos[2] = t - prev;  // fallen
prev = t;
}

void handler4() {
static uint32_t prev=0;
uint32_t width,t;
t = micros();
if (digitalRead(7) == LOW) servos[3] = t - prev;  // fallen
prev = t;
}

void handler5() {
static uint32_t prev=0;
uint32_t width,t;
t = micros();
if (digitalRead(8) == LOW) servos[4] = t - prev;  // fallen
prev = t;
}

void handler6() {
static uint32_t prev=0;
uint32_t width,t;
t = micros();
if (digitalRead(9) == LOW) servos[5] = t - prev;  // fallen
prev = t;
}

void setup() {
int i;

for(i=0;i<MAX_SERVOS;i++) servos[i] = 1500;  //  idle
pinMode(PPM_PIN,OUTPUT);
attachInterrupt(4,handler1,CHANGE);
attachInterrupt(5,handler2,CHANGE);
attachInterrupt(6,handler3,CHANGE);
attachInterrupt(7,handler4,CHANGE);
attachInterrupt(8,handler5,CHANGE);
attachInterrupt(9,handler6,CHANGE);
}

void loop() {
int i,t;

t=0;
for (i=0; i< MAX_SERVOS; i++){ // PPM out
digitalWrite(PPM_PIN,HIGH);
delayMicroseconds(PW);
digitalWrite(PPM_PIN,LOW);
delayMicroseconds(servos[i]-PW);
t += servos[i];
}
digitalWrite(PPM_PIN,HIGH);   // idle fill
delayMicroseconds(PW);
digitalWrite(PPM_PIN,LOW);
delayMicroseconds(W-t);
}
8  Products / Arduino Due / Re: Arduino due / ppm on: December 06, 2013, 01:12:22 pm
Here is an untested (but compiled) DUE snippet that reads PPM on pin 7 and drives 6 servos (pins 8-13).

Code:
// take RC tranmsitter PPM on pin 7, drive servos on pins 8-13
#include <Servo.h>

#define PPM_PIN 7
#define PPM_IDLE 3000
#define MAX_CHANNELS 6
uint32_t channels[MAX_CHANNELS];

Servo servos[MAX_CHANNELS];

// PPM interrupt
void handler() {
static uint32_t prev=0,chno=0;
uint32_t width,t;

t = micros();
width = t - prev;
if (width > PPM_IDLE) {
chno = 0;   // next pulse is channel 0
} else if (chno < MAX_CHANNELS) {
servos[chno].writeMicroseconds(width);
channels[chno++] = width;    // for printing
}
prev = t;
}

void setup() {
int i, pin=8;
Serial.begin(9600);
for (i=0; i<MAX_CHANNELS; i++) {
servos[i].attach(pin++);
}
    attachInterrupt(PPM_PIN,handler,RISING);
}

void loop() {
int i;

delay(3000);
for (i=0; i<MAX_CHANNELS; i++) Serial.println(channels[i]); //debug
}
9  Products / Arduino Due / Re: Due Integrated RTC time drift on: December 05, 2013, 06:02:31 am
here are some data on drift of MCU crystals and RTC's including DUE
 https://github.com/manitou48/crystals

crystals.txt has the drift data.  drift is affected by voltage, temperature, age, and capacitance.
 your mileage may vary.

Here are specs for MCU crystal and RTC from the DUE schematic/bom
   Y1,12MHz KX-7 20pF     CRYSTAL-3.2-2.5           CRYSTAL-3.2-2.5  probably 30ppm
   Y2,32.768Khz,RESONATOR_EPSON_FC_145,RESONATOR_EPSON_FC_145   20ppm 12.5pf
10  Products / Arduino Due / Re: Arduino due / ppm on: December 04, 2013, 09:31:37 am
there is a blog dedicated to RC and Arduino, visit
  http://rcarduino.blogspot.com/
they have examples of using timer interrupt to capture PPM and then using Servo lib (or decade counter) to pulse servos.  Not sure how many DUE examples though ...
11  Products / Arduino Due / Re: Arduino due / ppm on: December 03, 2013, 04:48:18 pm
The code you have (as noted) is UNO (AVR) specific.  The ARM IO architecture is radically different.

So why not use the provided Arduino Servo library?  It does what you want on both UNO and DUE.

For your edification, you could peek at the DUE's PWM code in
 hardware/arduino/sam/cores/arduino/wiring_analog.c
12  Products / Arduino Due / DUE interrupt latency on: March 29, 2013, 06:13:14 am
Bill Grundmann's Blog (http://billgrundmann.wordpress.com/2009/03/02/the-overhead-of-arduino-interrupts/) has a nice discussion of interrupt overhead on AVR 168. I ran a simple DUE sketch with pin 13 tied to pin 2 to measure number of cycles (systick) to enter and exit an interrupt ISR using standard attachInterrupt() ISR and a version where I modified the core ISR handler. I ran similar sketches on maple and teensy3. The results are in isrperf.txt and the DUE sketch is isrperf.ino at the following github site

https://github.com/manitou48/DUEZoo
13  Products / Arduino Due / DUE IRremote proof of concept on: March 15, 2013, 12:41:01 pm
As a proof of concept, I developed a simple sketch to test basic components of IRremote services on DUE.  I used PWM on pin 6 to drive an IR LED (38kHz to 40kHz), and used timer 1 (TC1 channel 0) to sample the input every 50us from an IR receiver  (Sharp GP1UX311QS).  The main logic for parsing the TV remote signals is from Ken Shirriff's IRremotelib.  The sketch actually can receive its own transmits. The sketch is in the directory IRtest at
  https://github.com/manitou48/DUEZoo

It is left as an exercise for the reader to add the DUE changes to  Ken's IRremote lib  smiley
 
Ken's lib   http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html

Paul's IRremote support on teensy (including ARM teensy 3.0)
  http://www.pjrc.com/teensy/td_libs_IRremote.html

An earlier port to ARM Maple
  https://github.com/manitou48/maple-IRremote
 
14  Products / Arduino Due / Re: I2C + DMA on: March 11, 2013, 10:11:36 am
I don't think DMA is being utilized in DUE TWI functions. As noted in the ADC PDC example in this thread, somewhere there needs to be code that is setting the PDC address and byte-count registers for the DMA transfer.  I think your interrupted print, only shows that a TWI interrupt occurred after a byte transfer.  DMA can send many bytes, requiring only one interrupt when all of the bytes have been transferred.

Though the Maple and DUE share the ARM CPU architecture, the peripheral architecture (I2C, DMA, etc) are radically different.  So my maple I2C DMA code would not be very enlightening.  Eventually, I may make a github page for some of my maple hacks...
15  Products / Arduino Due / Re: DUE I2C speed on: March 11, 2013, 08:37:19 am
Ooops, 100 Khz read column for DUE I2C test above is wrong.  It has been corrected, current performance results are  in I2Cperf.txt at

  https://github.com/manitou48/DUEZoo
Pages: [1] 2 3 ... 5