Show Posts
Pages: 1 [2] 3 4 5
16  Using Arduino / Microcontrollers / Re: Bootloading the Atmega168. on: January 06, 2013, 12:56:17 am
Quote
So what is your 168 based 'board', does it run the chip at the correct crystal speed? Does it support auto-reset that the IDE requires? Have you run a loopback test on your 168 based setup to see if your communication link works?

I actually have a duemilanove clone board, which i used to program both my atmega328P( selecting the 'arduino duemilanove w/ atmega328' board), and my Atmega168 (selecting the 'arduino diecimila or duemilanove w/ Atmega168). Both had bootloaders. And i haven't done the loopback test. Will it confirm if my chip is dead or working?
 Some time back, my 168 stopped working( always failed while programming it). After i read Nick Gammon's page, i thought i'd try re-uploading the bootloader.

Quote
The fact that you uploaded OK shows the chip is good. I can't remember right now which bootloader I used for that chip*, but the clock speed would need to match and you would need to select the correct bootloader in the IDE so that the protocol matches.

Thanks for your reply. I actually burned the bootloader after making the changes Retrolefty told in the above comments. I'm sorry i didn't really get, what you meant by select the correct bootloader in the IDE?

Quote
Did you modify the boards.txt file and select the appropriate board type so that the IDE knows about the new connection speed used for uploads (and also the new space available?)

Thanks for you reply. I haven't modified the file. What board should i be selecting?
17  Using Arduino / Microcontrollers / Re: Bootloading the Atmega168. on: January 05, 2013, 12:47:29 pm
Thanks a lot retrolefty  smiley-grin THe bootloading worked....


But the chip, still wouldn't let me upload new programs. :/
18  Using Arduino / Microcontrollers / Bootloading the Atmega168. on: January 05, 2013, 10:09:03 am
 I have a arduino dumilanalov, which I'm using to re-bootload my Atmega168.

I ran the atmega board detector script by Nick Gammon, http://www.gammon.com.au/forum/?id=11637, and got the following results.
Quote
Atmega chip detector.
Entered programming mode OK.
Signature = 1E 94 06
Unrecogized signature.
LFuse = FF
HFuse = DF
EFuse = F8
Lock byte = FC
Clock calibration = 90

First 256 bytes of program memory:

0: 00 00 01 01 00 00 03 03 00 00 01 01 04 04 07 07
10: 00 00 01 01 00 00 03 03 08 08 09 09 0C 0C 0F 0F
20: 00 00 01 01 00 00 03 03 00 00 01 01 04 04 07 07
30: 10 10 11 11 10 10 13 13 18 18 19 19 1C 1C 1F 1F
40: 00 00 01 01 02 02 03 03 00 00 01 01 04 04 07 07
50: 00 00 01 01 00 00 03 03 08 08 09 09 0C 0C 0F 0F
60: 20 20 21 21 20 20 23 23 20 20 21 21 24 24 27 27
70: 30 30 31 31 30 30 33 33 38 38 39 39 3C 3C 3F 3F
80: 00 00 01 01 00 00 03 03 00 00 01 01 04 04 07 07
90: 00 00 01 01 00 00 03 03 08 08 09 09 0C 0C 0F 0F
A0: 00 00 01 01 00 00 03 03 00 00 01 01 04 04 07 07
B0: 10 10 11 11 10 10 13 13 18 18 19 19 1C 1C 1F 1F
C0: 40 40 41 41 40 40 43 43 40 40 41 41 44 44 47 47
D0: 40 40 41 41 40 40 43 43 48 48 49 49 4C 4C 4F 4F
E0: 60 60 61 61 60 60 63 63 60 60 61 61 64 64 67 67
F0: 70 70 71 71 70 70 73 73 78 78 79 79 7C 7C 7F 7F



And when i proceeded to burn my bootloader using, atmega board programmer sketch, i got the following message.

Quote
Atmega chip programmer.
Written by Nick Gammon.
Entered programming mode OK.
Signature = 0x1E 0x94 0x06
Unrecogized signature.
LFuse = 0xFF
HFuse = 0xDF
EFuse = 0xF8
Lock byte = 0xFC
Clock calibration = 0x90
Type 'C' when ready to continue with another chip ...

Is my chip dead?
19  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: January 02, 2013, 07:53:27 am
Thanks for the replies, guys. smiley

Quote
Perhaps an LED and 1K resistor on each of Tx/Rx lines to confirm data is getting through?

Will try that.. thanks smiley
20  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: December 31, 2012, 01:09:50 am
Quote
The image shows no connection between the 220 ohm resistor and ground.
Move the wire.

The connection is right in my circuit. smiley Plus that shouldn't be a reason why the upload is failing....
21  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: December 30, 2012, 12:55:34 pm
Yep. Board is Mighty 1284p 16Mhz using optiboot, and COM port's right...
22  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: December 30, 2012, 09:46:44 am
Quote
A simple jumper from the arduino board's reset pin to the 1284p reset pin should fix that situation. Try that and let us know how it works.

You may have to also remove the reset pull-up resistor on the 1284p chip as there is already a reset pull-up on the arduino board and having two in parallel may be too low a resistance for the auto-reset pulse to pull the signal low on initiation of the DTR signal.

Still, got the error, "avrdude: stk500_getsync(): not in sync: resp=0x00".


23  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: December 30, 2012, 05:50:17 am
Image attached..
24  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: December 29, 2012, 09:26:12 am
Thanks for the reply. smiley I swapped the pins like you said and it showed "done uploading", with an error,
Quote
avrdude: stk500_getsync(): not in sync: resp=0x00
. I have an LED conected at pin 4 and there weren't any blinking as well...
25  Using Arduino / Microcontrollers / Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: December 29, 2012, 08:45:55 am
Thanks to Nick Gammon's blog http://www.gammon.com.au/forum/?id=11637, I successfully burned the bootloader on to my 1284P. Since my ftdi cable is en route, i thought i'd burn some programs using my arduino dumilanalov. I removed the atmega328, and took pins from
RX(arduino)-- TXD0(pin15),
TX(arduino)-- RXD0(pin14),
RESET(arduino) -- RESET(pin 9),
5v--5v,
GND--GND

to the 1284p which is on a breadboard.

Then i tried burning a simple sketch.

Code:
int led = 3;


void setup() {               
 
  pinMode(led, OUTPUT);     
}


void loop() {
  digitalWrite(led, HIGH);   
  delay(1000);             
  digitalWrite(led, LOW);   
  delay(1000);               
}



I got the following error message when i used AVRISP mk||.
Quote
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62
avrdude: stk500_cmd(): programmer is out of sync

Where did i go wrong?
26  Using Arduino / Programming Questions / Re: Parsing values from Arduino to processing. on: November 04, 2012, 12:34:19 pm
This is a video of the simulator i was working on. smiley
27  Using Arduino / Programming Questions / Re: Parsing values from Arduino to processing. on: September 18, 2012, 08:43:48 am
Thanks for your replies, guys. smiley

Quote
Consistent indenting will make your code much easier to read. Consistent spacing, too.

Sorry about that. Will do that in my future posts. smiley

Quote
The local variable (array) in the serialEvent() method, value, is NOT the same variable as the global variable (array), value.

That was where the problem was. I thought that was part of the split syntax but i was actually creating a local array also. Thanks for your help.

And, i'll post a video of what i was working on, in a few days. smiley
28  Using Arduino / Programming Questions / Re: Parsing values from Arduino to processing. on: September 16, 2012, 03:45:32 am
Quote
this way you'll narrow down where the problem is.

 I think the problem lies in the fact that arduino loops function at way higher speeds compared to processing. So there might be even lag of seconds.

Quote
I'd recommend that you make some changes to your Processing sketch, and let us know if that affects your results.

Like you told, i changed my code adding serialEvent to my processing. But I'm getting 0.0 for value[0],value[1],value[2]. I have a feeling the loop is never getting invoked. I tried adding the bufferUntil() in setup, still didn't work. Heres the code.
Code:
import processing.serial.*;
Serial port;
float[] value=new float[4];
int i=0;
String mg;

void setup()
{
  size(600,600);
  port=new Serial(this, "COM4",115200);
 // port.bufferUntil(13);
  frameRate(300);
  background(255);
  fill(246,225,65);
}


void draw()
{
 
  background(255);
  translate(width/2,0);
  fill(0);
   
  text("Yaw: " + ((float) value[0]), 0, 100);
  text("Pitch: " + ((float) value[1]), 100, 100);
  text("Roll: " + ((float) value[2]), 200, 100);
 
 
}

void SerialEvent(Serial port)
{
   
  mg=port.readStringUntil(13);
  fill(0);
 
    if(mg!= null)
  {
 float value[] = float(split(mg, ' '));
 println(value);
  }
 
}

Also, i made a slight change in the arduino code..Now i'm sending the string as one line and the values are separated by spaces. Heres the code fragment of the arduino code.
Code:
Serial.print(euler[0] * 180/M_PI);
Serial.print(" ");
Serial.print(euler[1] * 180/M_PI);
Serial.print(" ");
Serial.println(euler[2] * 180/M_PI);
29  Using Arduino / Programming Questions / Parsing values from Arduino to processing. on: September 15, 2012, 02:57:24 am
I'm trying to parse my values which i get from my 6 DOF inertial measurement unit , from arduino to processing. So far, following results have been accomplished.
1. Sent the float values as string to processing. Converted them back to float in processing and displayed.

Problem : When i tilt my IMU, the values changes accordingly, but these changes are not affected in processing, but it is successfully affected in arduino serial monitor. There is only slight variation in processing, say from 5.8 to 6.2 when i do a 90 degree tilt, whereas the actual should have been like about 5.8 to 70.4 or something.

This is the code fragment from arduino.
Code:
mpu.dmpGetQuaternion(&q, fifoBuffer);
            mpu.dmpGetEuler(euler, &q);
            Serial.println(euler[0] * 180/M_PI);
            Serial.println(euler[1] * 180/M_PI);
            Serial.println(euler[2] * 180/M_PI);
     

And this is my Processing sketch.

Code:
import processing.serial.*;
import processing.opengl.*;
Serial myPort;
float[] value=new float[4];
int i=0;
int k=100;
String[] msg=new String[5];


void setup()
{
  size(600,600,OPENGL);
  noStroke();
  String portName="COM4";
  myPort = new Serial(this, portName, 115200);
  frameRate(50);
  background(255);
  fill(246, 225, 65);
  lights();
}

void draw()
{
  if(i>2)
  i=0;
 msg[i] = myPort.readStringUntil(13);
           if(msg[i] != null)
               {
               value[i] = float(msg[i]);
               println(value);
                }
                ++i;
               

  background(255);
 
 
 
  translate(width/2,0);

 
    fill(0);
   text("Yaw: " + ((float) value[0]), 0, k);
  text("Pitch: " + ((float) value[1]), 100, k);
  text("Roll: " + ((float) value[2]), 200, k);



}
 
30  Using Arduino / Programming Questions / Re: Sending data from arduino to processing, serially. on: September 10, 2012, 09:42:36 am
Thanks a lot. It worked. I sent the values as string, received them as string in processing and then converted them back to float. Actually i'm trying to simulate an inertial measurement unit, using processing. smiley
Pages: 1 [2] 3 4 5