Show Posts
Pages: [1]
1  Using Arduino / Installation & Troubleshooting / Re: Mega2560: timeout communicating with programmer.... on: December 17, 2012, 01:45:54 pm
Did anyone ever find a solution to this problem? I've tried replacing the AVRDUDE.EXE, modifying the the boards.txt to "wiring" programmer, and searching around the web.  Nothing seems to work. My mega worked great for 2 days, then suddenly, nothing would upload; not even the simplest little program.
2  Using Arduino / Installation & Troubleshooting / Re: Arduino Mega2560 can't be programmed via USB on: December 16, 2012, 01:19:18 am
I'm having the same problem.  I received my Mega2560 2 days ago. Until this afternoon, everything was working fine. Suddenly the same code that was uploading wouldn't upload any longer. I hadn't changed anything. I've read a bunch of threads, tried changing the AVRDUDE.EXE to an older version that someone posted on a different site, modified the boards.txt file to "wiring" as indicated here, tried using the ISP programmer vs the ISP mkII programmer and vice-versa- nothing works.  I can't upload any programs. They all do this same thing. Very strange since it was working just fine earlier...

Here's an output from my verbose upload after I reverted everything back to the original EXCEPT I kept the "wiring" setting in the boards.txt:

Binary sketch size: 3,496 bytes (of a 258,048 byte maximum)
C:\Users\Cameron\Desktop\arduino-1.0.1\hardware/tools/avr/bin/avrdude -CC:\Users\Cameron\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega2560 -cwiring -P\\.\COM5 -b115200 -D -Uflash:w:C:\Users\Cameron\AppData\Local\Temp\build1215771844599652454.tmp\MegaTEST.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\Cameron\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM5
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]

Any thoughts?
Thanks,
Cameron
3  Using Arduino / Displays / Re: [SOLVED]LCD 16x2 showing garbage on: December 13, 2012, 06:17:22 pm
Guys, with  your help, I resolved it.  Here is the final config that worked: LiquidCrystal lcd(7,8,9,A2,A1,A0)
Karma, I love your backpacks - will pick a couple up.
Thanks.
4  Using Arduino / Displays / Re: [SOLVED]LCD 16x2 showing garbage on: December 12, 2012, 07:20:30 pm
Got it.  The shield I'm using is this one: https://www.adafruit.com/products/243.  I set up the LCD using this tutorial http://learn.adafruit.com/character-lcds/wiring-a-character-lcd.   Of course I had suspected a conflict between the LCD and either the SD card or the Serial comm since I could place the LCD print code before initialization and it worked fine.  I searched around the net to find potential conflicting pins.  The last pin I changed was the DB7 from pin 12 to pin 0.  I also tried pin 1.  The results are the same. Text displays correctly at the beginning of the Setup() function but displays random characters that generally look alike if the code is placed below the initialization of either the SD or the serial.  I get that there are potential conflicts.  This is a community project and the others had earlier hardwired pins 2-4 so these are not an option.  I guess the question is, if the SD card uses pins 10, 11, 12, and 13; and the serial uses 0 and 1, and I'm already using 2-4 for the sensor, and 5,6,7, 8, 9 for the LCD, then the DB7 pin which was on 12 then I placed on 1, then 0 and I had the same results, then I'm stuck without any pins - unless I can use an analog pin, which I haven't tried yet.  BTW, the garbage was nothing near what it should have been, randomly place on the screen and odd ascii chars.
thx
5  Using Arduino / Displays / Re: [SOLVED]LCD 16x2 showing garbage on: December 12, 2012, 12:52:09 pm
No. I switched pin 0 around before. Same thing unfortunately. Doesn't make any sense to me. I've looked at all the pins to find which one might conflict with the SPI etc and I'm not using any of those pins. Perhaps pin 4 which is now hardwired unfortunately, is suddenly becoming a problem, tho is was fine before the LCD. Dunno. Thx
6  Using Arduino / Displays / Re: [SOLVED]LCD 16x2 showing garbage on: December 12, 2012, 01:45:11 am
Thanks guys.  Yes. I'm using the SD card, the Serial Monitor and the RTC. Everything works fine if I leave out the code for the LCD, so I don' t see how pin 4 might be conflicting with my optical sensor.  I also thought that the chipselect was pin 10.  Here is the code.
Code:
#include "SD.h"
#include <Wire.h>
#include "RTClib.h"
#include <LiquidCrystal.h>

//These define the pin connections of the Arduino. 
//They can be changed but only use digital in 2 or 3 for the Freq pin
#define TSL_FREQ_PIN 2 // output use digital pin2 for interrupt

float fD = 0.1; // Dark frequency
float Re = 2.3; // Irradiance responsivity
float eff475 = 0.113; // Luminous efficiency at 475nm, for dinoflagellate bioluminescence

RTC_DS1307 RTC; // define the Real Time Clock object

#define ECHO_TO_SERIAL   1 // echo data to serial port
#define WAIT_TO_START    0 // Wait for serial input in setup()

// the digital pins that connect to the LEDs
#define redLEDpin 3
#define greenLEDpin 4

// for the data logging shield, we use digital pin 10 for the SD cs line
const int chipSelect = 10;

// the logging file
File logfile;

void error(char *str)
{
  Serial.print("error: ");
  Serial.println(str);
 
  // red LED indicates error
  digitalWrite(redLEDpin, HIGH);
 
  while(1);
}

int timing = 1000; // in milliseconds
volatile unsigned long pulse_cnt = 0;

 // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7,8,9,6,5,0);

void setup() {
   // IF I PUT THE LCD CODE HERE, IT WORKS FINE (see bottom)

  Serial.begin(9600);
  Serial.println();
  Wire.begin();
  RTC.begin();

#if WAIT_TO_START
  Serial.println("Type any character to start");
  while (!Serial.available());
#endif //WAIT_TO_START

  Serial.print("Initializing SD card...");
  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
  pinMode(chipSelect, OUTPUT);
 
  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
  }
  Serial.println("card initialized.");
// PROBLEM CODE IS HERE:
    // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
 lcd.setCursor(0, 0);
  // Print a message to the LCD.
 lcd.print("LCD not working!");

     
7  Using Arduino / Displays / Re: [SOLVED]LCD 16x2 showing garbage on: December 11, 2012, 07:05:48 pm
Folks,
I'm having the same problem. I have a shield with combined RTC and SD card.  I've wired up the LCD (16 x 2) and it works perfectly when I use the simple sample code for the LCD.  I've noticed that it also works fine when I integrate the code into my program which utilizes the RTC and SD card IF AND ONLY IF I write to the LCD before initializing the SD or RTC.  Actually, I saw the comments about SPI conflicts etc, so I modified the pins for the LCD a few times and found that in the original configuration, I could write to the LCD successfully AFTER the RTC initialization, but not after the SD card.  Then, after I switched the pins, and it ONLY works if I write to the LCD at the beginning of the Setup() function before both RTC and SD calls.  I thought I understood the potential conflicts so I've wired the LCD to pins as follows:

LiquidCrystal lcd(7,8,9,6,5,0);

This doesn't seem to be using any pins that conflict, but maybe I'm missing something?  I have an Uno and am also using pins 2-4 for an optical sensor so they are not avail. Thoughts on how to resolve the conflict?  Oh, the problem I'm having is that any writes to the LCD are correct ahead of the RTC/SD initializations, but I get gibberish when I write after those calls.
Thanks,
Cameron
8  Using Arduino / Sensors / Dissolved CO2 sensor on: October 22, 2012, 02:21:39 pm
I'm looking to build a sensor for an algae project which reads out the dissolved CO2 content of the algae tanks.  This is not easy because the water is opaque and mucky, it's dissolved, not gaseous CO2, and since the pH is not constant in algae tanks, one cannot use a pH calculation.  I've been thinking that I  could 1) filter and remove a small sample which might allow me to use light measure after injecting chemicals into the filtered sample, 2) somehow liberate the CO2 from the water, then measure the gas, or 3) just find a probe that would work in murky water.  However, I've had no luck.  Anyone have any thoughts here?
Thanks!
Cameron
Pages: [1]