Show Posts
|
|
Pages: 1 [2] 3 4 5
|
|
17
|
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. 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. 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?
|
|
|
|
|
21
|
Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p.
|
on: December 30, 2012, 09:46:44 am
|
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".
|
|
|
|
|
24
|
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. 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||. 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: September 18, 2012, 08:43:48 am
|
Thanks for your replies, guys.  Consistent indenting will make your code much easier to read. Consistent spacing, too. Sorry about that. Will do that in my future posts.  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. 
|
|
|
|
|
27
|
Using Arduino / Programming Questions / Re: Parsing values from Arduino to processing.
|
on: September 16, 2012, 03:45:32 am
|
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. 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. 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. 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);
|
|
|
|
|
28
|
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. 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. 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 / Sending data from arduino to processing, serially.
|
on: September 09, 2012, 02:50:32 am
|
I have an arduino duemilanove. I'm trying to send an array of positive and negative floating point numbers, stored within the arduino, to processing. I was going one step at a time by sending a single byte by using the following code and it worked perfectly. void setup() { Serial.begin(9600); } byte a=43; void loop() { Serial.write(a); }
And this is the processing sketch. import processing.serial.*;
Serial myPort; void setup() { String portName = "COM4"; myPort = new Serial(this, portName, 9600); } void draw() { if(myPort.available()>0) { println(myPort.read()); delay(1000); } else { println("no devices found"); } } But, by using "byte" datatype i can send only values between 0-255. How can i modify the above programs so that i can send and receive negative and positive floating point numbers. Thanks.
|
|
|
|
|