Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Development / Re: Reset to bootloader through sketch on: January 23, 2011, 03:09:01 pm
So there's no way to reset without using a watchdog or physically?
2  Forum 2005-2010 (read only) / Development / Re: Reset to bootloader through sketch on: January 23, 2011, 02:58:55 pm
The
Code:
#ifdef WATCHDOG_MODS
      ch = MCUSR;
      MCUSR = 0;

      WDTCSR |= _BV(WDCE) | _BV(WDE);
      WDTCSR = 0;

      // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
      if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
            app_start();  // skip bootloader
#else
      asm volatile("nop\n\t");
#endif
Section?
3  Forum 2005-2010 (read only) / Development / Re: Reset to bootloader through sketch on: January 23, 2011, 02:50:52 pm
I've already been editing the bootloader some. Longer wait time and a higher error count.
4  Forum 2005-2010 (read only) / Development / Re: Reset to bootloader through sketch on: January 23, 2011, 02:40:24 pm
From what I've read, it seems it can cause problems.
5  Forum 2005-2010 (read only) / Development / Reset to bootloader through sketch on: January 23, 2011, 02:34:15 pm
Hello,
I currently am working on a small project and I need to reset the whole arduino into bootloader programming mode. I have a pro mini, atmega328

The way I currently tried is: asm volatile ("  jmp 30720");
This does send it into the bootloader, but it won't respond to any serial commands. Normally when it boots, I can send a '1 ' command to get 'AVR ISP'

The other way I can think of is using a watchdog timer. I would prefer not to use a watchdog.

I am doing this without a standard FDTI cable, so upon connecting there are a few extra characters sent to the arduino before the connection is established.

I've changed the bootloader to have a longer wait time(yes, I did it in the makefile) and to have a higher max error.

Any other suggestions?

Thanks,
Nai
6  Forum 2005-2010 (read only) / Interfacing / Help with Capsense and a slider on: September 18, 2010, 05:11:22 pm
So, I've been trying to make a slider. Is it possible to use one solid sheet, or do I have to use multiple sheets and test each sheet separately?

As in pus a wire on each side of a foil covered piece of cardboard and test each side and figure out where the finger is.

Thaks,
Ian
7  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Nano with Lego Accelerometer on: June 08, 2010, 09:14:22 pm
Nope, got it working. One of the wires was broken inside the connector.
Also, for anyone else doing this here's the code:
Code:
#include "Wire.h"
void setup()
{
  Wire.begin();
  Serial.begin(19200);
}

void loop()
{
  Wire.beginTransmission(1);
  Wire.send(0x42);
  Wire.endTransmission();
  delay(20);
  Wire.requestFrom(1, 1);
  char b;
  while(Wire.available())
  {
    b = Wire.receive();
  }
  delay(50);
  Wire.send(0x45);  
  Wire.endTransmission();
  delay(20);
  Wire.requestFrom(1, 1);
  while(Wire.available())
  {
    char c = Wire.receive();
    int i = (c & 3) + (b << 2);
    Serial.println(i,DEC);
  }
  delay(500);
}
8  Forum 2005-2010 (read only) / Interfacing / Arduino Nano with Lego Accelerometer on: June 07, 2010, 02:22:22 am
I don't know how many people have actually done this, but my day was spent getting this to work.
So to start with, you need to cut a lego cable
Soldering/tinning the ends works best smiley-wink

Then, with a breadboard most likely, connect the pins 1 and 4 to 5v, 2 and 3 to ground, 5 and 6 to I2C clock and data respectively.
Then the code:
Code:
#include "Wire.h"
void setup()
{
  Wire.begin();
  Serial.begin(19200);           // start serial for output
}

void loop()
{
  Wire.beginTransmission(1); // transmit to device #1(lego accelerometer
  Wire.send(0x42);           // sends Read first 8 bits of accelerometer
  Wire.endTransmission();
  delay(700);
  Wire.requestFrom(1, 8);
  while(Wire.available())
  {
    char c = Wire.receive();
    Serial.println(c,HEX);    //output the data
  }
  Serial.print("Done \n");
  delay(500);
}
Fairly simple, but I had trouble googling it, so I did it myself
The rest of the request bytes can be found on the hitechnic site

Always glad to help
~Nai
Pages: [1]