Show Posts
Pages: 1 [2] 3
16  Products / Arduino Due / Re: Due pinout diagram on: February 03, 2013, 06:58:48 pm
the drawing is definitely pretty and hopefully accurate but i have one suggestion. the readability is quite good on the computer but when printed with a (pretty decent) color laser printer, it is extremely difficult to read the dark colored tags. i could photoshop it myself but why not just reduce the density on the background colors? BTW. i was a professional cartographer (a million years ago) and dealt with printing and readability issues all the time.
17  Products / Arduino Due / Re: Quadrature Encoder full resolution for Arduino Due on: February 03, 2013, 01:55:04 pm
any progress on this. i really need a decent quad decoder.
18  Products / Arduino Due / Re: Due and the ITDB02 Display shield on: February 03, 2013, 02:46:28 am
does anyone know the model to specify for the SainSmart 3.2" touch screen version with mega shield for use on the DUE? i can not find (typical with SainSmart) any info that suggests what it really is. it uses the SSD1289 controller according to the link in the original post in this thread. my guess is that the model should be the ITDB02-3.2S because it uses the same controller and the S stands for "shield" ???

if anyone has used this and has any new information or corrections please advise.
19  Products / Arduino Due / getting IR remote to work on: February 02, 2013, 02:49:29 pm
i have tried to get the IR remote library (from the IDE specifically for the DUE) to run but can not because there is an include for interrupt.h that only exists as an AVR specific file. is there an interrupt.h for the SAM or is there some other way around this.
20  Products / Arduino Due / Re: nunchuck library ??? on: February 02, 2013, 02:04:44 pm
found the basic wire code needed and can read the nunchuck but it is horribly slooooow and also gets garbage every second read. does anyone have experience with this and know if this is "normal" i have tried to find documentation on what the nunchuck wants for initialization and have found various suggestions but nothing works any better. here is s simple sketch that does not use a library. all the nunchuck functionality is in the sketch with wire function. i am connecting clock and data lines to pins 21 and 20 and using 3.3 volt power, not analog pin power.

 * NunchuckPrint
 * 2007 Tod E. Kurt,
 * The Wii Nunchuck reading code is taken from Windmeadow Labs
#include <Wire.h>

void setup()
//  nunchuck_setpowerpins(); // use analog pins 2&3 as fake gnd & pwr
  nunchuck_init(); // send the initilization handshake
  Serial.print ("Finished setup\n");

void loop()
  if (nunchuck_get_data()) nunchuck_print_data();
//  nunchuck_print_data();
// Nunchuck functions

static uint8_t nunchuck_buf[6];   // array to store nunchuck data,

// initialize the I2C system, join the I2C bus,
// and tell the nunchuck we're talking to it
//void nunchuck_init()
//  Wire.begin();                   // join i2c bus as master
//  Wire.beginTransmission(0x52);   // transmit to device 0x52
//  Wire.write(0x40);      // sends memory address
//  Wire.write(0x00);      // sends sent a zero. 
//  Wire.endTransmission();   // stop transmitting
void nunchuck_init() // another suggestion for init
  Wire.begin();                   // join i2c bus as master
  Wire.beginTransmission(0x52);   // transmit to device 0x52
  Wire.write(0xF0);      // sends memory address
  Wire.write(0X55);      // sends 55 
  Wire.write(0xFB);      // sends memory address
  Wire.write(0x00);      // sends 0   
  Wire.endTransmission();   // stop transmitting

// Send a request for data to the nunchuck
// was "send_zero()"
void nunchuck_send_request()
  Wire.beginTransmission(0x52);   // transmit to device 0x52
  Wire.write(0x00);      // sends one byte
  Wire.endTransmission();   // stop transmitting

// Receive data back from the nunchuck,
int nunchuck_get_data()
    int cnt=0;
//    nunchuck_send_request();  // send request for next data payload
    Wire.requestFrom (0x52, 6);   // request data from nunchuck
    while (Wire.available ()) {
      // receive byte as an integer
//      nunchuck_buf[cnt] = nunchuk_decode_byte(;
      nunchuck_buf[cnt] =;
    nunchuck_send_request();  // send request for next data payload
    // If we recieved the 6 bytes, then go print them
    if (cnt >= 5) {
     return 1;   // success
    return 0; //failure

// Print the input data we have recieved
// accel data is 10 bits long
// so we read 8 bits, then we have to add
// on the last 2 bits.  That is why I
// multiply them by 2 * 2
void nunchuck_print_data()
  static int i=0;
  int joy_x_axis = nunchuck_buf[0];
  int joy_y_axis = nunchuck_buf[1];
  int accel_x_axis = nunchuck_buf[2]; // * 2 * 2;
  int accel_y_axis = nunchuck_buf[3]; // * 2 * 2;
  int accel_z_axis = nunchuck_buf[4]; // * 2 * 2;

  int z_button = 0;
  int c_button = 0;

  // byte nunchuck_buf[5] contains bits for z and c buttons
  // it also contains the least significant bits for the accelerometer data
  // so we have to check each bit of byte outbuf[5]
  if ((nunchuck_buf[5] >> 0) & 1)
    z_button = 1;
  if ((nunchuck_buf[5] >> 1) & 1)
    c_button = 1;

  if ((nunchuck_buf[5] >> 2) & 1)
    accel_x_axis += 2;
  if ((nunchuck_buf[5] >> 3) & 1)
    accel_x_axis += 1;

  if ((nunchuck_buf[5] >> 4) & 1)
    accel_y_axis += 2;
  if ((nunchuck_buf[5] >> 5) & 1)
    accel_y_axis += 1;

  if ((nunchuck_buf[5] >> 6) & 1)
    accel_z_axis += 2;
  if ((nunchuck_buf[5] >> 7) & 1)
    accel_z_axis += 1;

//  Serial.print("joy:");
//  Serial.print(joy_x_axis,DEC);
  Serial.print("Y ");
  Serial.println(joy_y_axis, DEC);
  Serial.print("  \t");

//  Serial.print("acc:");
//  Serial.print(accel_x_axis, DEC);
//  Serial.print(",");
//  Serial.print(accel_y_axis, DEC);
//  Serial.print(",");
//  Serial.print(accel_z_axis, DEC);
//  Serial.print("\t");

//  Serial.print("but:");
//  Serial.print(z_button, DEC);
//  Serial.print(",");
//  Serial.print(c_button, DEC);
//  Serial.print("\r\n");  // newline

// Encode data to format that most wiimote drivers accept
// only needed if you use one of the regular wiimote drivers
char nunchuk_decode_byte (char x)
  x = (x ^ 0x17) + 0x17;
  return x;
21  Products / Arduino Due / nunchuck library ??? on: February 02, 2013, 05:24:30 am
i can not get any of the libraries that get data from the Wi nunchuck to work on the DUE. does anyone have a library that works on the DUE or some suggestions as to how to use I2C to communicate with it?
22  Products / Arduino Due / Re: reliable startup? on: February 01, 2013, 12:31:45 am
re the USB problem: i changed the USB socket i plug the DUE into and also found a "better" USB cable. the better cable alone was not enough to fix the problem but changing sockets seems to be what was needed. i don't know if this is a Toshiba computer problem or a win 7 problem but using the high current USB socket was the problem. the Toshiba notebook has two sockets with 500 MA USB power and one with something like 1000 or 1500 ma. i chose the higher current one because i have an LCD display and a couple of encoders connected to the development "shield" so wanted all the power i could get. well... it works just fine on the lower power sockets and extremely unreliably on the high current socket.
23  Products / Arduino Due / Re: reliable startup? on: January 31, 2013, 06:12:38 pm
have been programming with the programming port. using a cheapie cable that came with a phone. maybe i should get a short one of better quality. the only good ones i have are mini, not micro. all the USB ports on the computer work well with everything else including external hard drives from which i have copied many TB. hard to imagine that something as simple as a 9600 baud serial connection would pose a greater problem. will try a different cable tonight and also try a different USB port. who knows?
24  Products / Arduino Due / Re: reliable startup? on: January 31, 2013, 04:37:30 pm
do you have a recommendation for a real simple power on reset chip? does this look like the simplest solution?   texas instruments TLC7705 it will hold the reset line low until system voltage reaches 5 volts and the time delay (set by external cap) has expired. also has inverted reset output.
25  Products / Arduino Due / Re: reliable startup? on: January 31, 2013, 12:13:38 pm
i have done nothing in software to change the default behavior. pressing the restart button always fixes the problem and the program can run for hours with no problems. it is difficult to believe that no one else is having the problem.

on another annoying problem that i mentioned on another thread with no answers:
windows is an absolute horror in terms of connecting to serial ports. some times i need to erase restart unplug and replug the DUE several times and wait unknown periods of time before i can get a serial port (USB) connection. i have found but not tried some serial port utilities. any ideas on how to eliminate this? i spend more time plugging and unplugging and restarting and waiting for code to eventually not upload due to no serial connection than i do programming.

if i just knew what the rules were (wait a certain period or ???) i could handle it but having every connection a frustrating resetting replugging over and over is getting really old. could this be caused by the same problem as the powerup? is the computer not seeing the connected device properly? i do get the confirmation sound when i plug into the USB port.
26  Products / Arduino Due / Re: reliable startup? on: January 31, 2013, 01:22:04 am
there is even an occasional non-start when i plug into the USB power which is already high. is there some way to force the DUE to restart until it successfully runs the program? i don't want to have the user press a reset button.
27  Products / Arduino Due / Re: reliable startup? on: January 30, 2013, 04:04:50 am
i haven't looked at the way the power starts on a scope. i just know that the first time the power is turned on the DUE usually will not start. i can certainly design external circuitry to do a time delay or use a power sequencing chip that has all that stuff built in but was hoping that the  DUE had some built in capability so it could do it itself. since it probably doesn't what is the simplest solution? i can think of a million ways to do it but do not tend to come up with the simplest solutions.

most of the machine runs off a large power supply but the DUE and other logic level stuff is powered by a tiny 5 volt supply. my guess is that it comes up very slowly as it charges its filter cap.
28  Products / Arduino Due / reliable startup? on: January 30, 2013, 01:21:18 am
i have a DUE that runs in a machine with a power supply that takes a little time to get up to voltage. the DUE will not boot reliably when the power is first turned on. it always does the second time when there is probably some voltage in the filter caps.

is there any way to insure that the DUE re-boots if it encounters a slow start voltage?
29  Products / Arduino Due / Re: Due pinout diagram on: January 29, 2013, 01:22:35 am
i got the original picture but the link for the new one is broken.

i printed the original and found it to be quite useful but do have some suggestions re color use. there are some tags (especially the ones for the SPI connector) that have bad combinations of background and text colors that make it virtually impossible to read when printed. i could make no sense out of the SPI connections and had to sharpie them in on my printed copy. using a color laser at original size scaled to fit an 8.5 x 11 inch page
30  Products / Arduino Due / windows 7 USB serial port annoyances on: January 29, 2013, 01:17:46 am
i have had this problem with other IDEs chipkit and Arduino but it is most severe with the DUE. trying to debug a program, connecting and disconnecting the DUE from the USB port and getting windows to make the serial connection is an exercise in madness. works some times, other times i need to press erase and reset many times, unplug replug etc etc. it seems that windows waits a random amount of time to release a serial connection. some times it is a very long time.

i some times need to remove the DUE to connect to the hardware it is running 20 to 50 times a day as i test various code options. i find i am spending more time screwing around with getting windows to make the connection than i spend in programming.

is there some secret that i need to know? is there some hidden registry setting that will release the serial port immediately when the USB connection is broken. or is this just another of the joys of using windows?
Pages: 1 [2] 3