Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Re: Programming UNO (ATMega328P) from Atmel Studio on: December 04, 2012, 11:04:48 am
Just an update;

To get the programmer to work in Atmel Studio 6, after adding the programmer tool you have to navigate to the Device Programming window (in the toolbar).

In there you can go to memories and specify the hex file to upload onto the MCU (the file is in your project directory).

Worked perfectly for me, able to program with Atmel Studio now (happiness smiley-razz).
2  Using Arduino / Microcontrollers / Re: Programming UNO (ATMega328P) from Atmel Studio on: December 04, 2012, 04:33:19 am
Thank you!

I changed the lines in programmers.txt, now I can program the device using the arduino ide (it should work with visual studio as well, I've been using it with the visual micro plugin for the last couple of weeks).

Now to figure out what's up with Atmel studio ... >.>

Anyways, thanks for the help again Coding Badly smiley

The IDE does give a few errors:

Code:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_recv(): buffer too small, received 32 byte into 32 byte buffer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_recv(): buffer too small, received 32 byte into 32 byte buffer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_recv(): buffer too small, received 32 byte into 32 byte buffer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_recv(): buffer too small, received 32 byte into 32 byte buffer
avrdude: verification error, first mismatch at byte 0x0000
         0x0c != 0x00
avrdude: verification error; content mismatch

But the test program works fine (simple blinking LED).
3  Using Arduino / Microcontrollers / Re: Programming UNO (ATMega328P) from Atmel Studio on: December 04, 2012, 02:44:01 am
Hello Coding Badly

Care to elaborate?

Are you referring to an AVRISP programmer (such as the Mk-ii)? The atmega328p is not on the mk-ii's list of supported devices (officially).
4  Using Arduino / Microcontrollers / Programming UNO (ATMega328P) from Atmel Studio on: December 04, 2012, 02:14:19 am
Hey guys

I've bought a programmer, the Pololu USB AVR Programmer (http://www.pololu.com/catalog/product/1300).

I'm trying to program the 328p mcu in Atmel studio using this device, but I'm running into a lot of problems. When creating a new project, I chose to create a standard C application. I've also added the STK500 as an available tool. The Uno board is powered from a 12V plug, and not connected by USB, but the problems I'll describe occurred when powering it from USB aswell.

However, when pressing F5 to compile & run (A blank program, just a start template basically), I get an error message "Launch has failed and Studio could not read target voltage. Please check your connections and try again."

Strange thing is, when viewing the available tools in Atmel Studio, the programmer can read voltages/fuse bits/lock bits/device signature without problems. The configuration utility from Pololu also does not display any errors from the last programming attempt.

I've tried to check the programmer's manual, and the blinking red LED on the board indicates a problem, but none of the proposed solutions have worked for me. What could I still be doing wrong?

Thanks again, in advance.

5  Using Arduino / Microcontrollers / Re: Removing the Arduino Bootloader on: November 29, 2012, 09:44:34 am
Thanks for the info Coding Badly smiley
6  Using Arduino / Microcontrollers / Re: Removing the Arduino Bootloader on: November 27, 2012, 09:44:57 am
$10 for the pololu programmer is a bargain.

Got that right!

Quote
Coding..., out of curiosity why would you resort to using an Uno when you have a pololu programmer?
Teensy I understand as it should be faster because of the native USB support, but why use Uno?

Upload performance from fastest to slowest...

• Uno with a 250K baud bootloader

• Pololu (very close to the same speed as above)

• Teensy running TinyISP

• Uno running TinyISP

• Teensy running ArduinoISP

• Uno running ArduinoISP (very slow)


The first two are very close to the programming time listed in the Atmel datasheet and are essentially the fastest possible method using SPI.  (Again, I highly recommend the Pololu AVR Programmer.  It was worth the $20 I paid for it (now just $10).)

TinyISP on either hardware is not as fast by a noticeable amount but is still fast enough to fall within the "two second" rule1.

ArduinoISP is just abysmal.


I use the Uno or Teensy because of the amenities that I've added to the Arduino ISP sketch (TinyISP is available here).  It makes a "good enough" programmer with some very basic debugging tools.

I like the Teensy because, inserted in a breadboard, it makes a very nice "project board".  Breadboard + programmer + basic debugging for ~$30.  What's not to like?

I like the Uno because it's easier to move from one project to another.  Getting the Teensy out of a breadboard is a little annoying.


1 Humans perceive a computer response within two seconds to be reasonable.  At five seconds, humans tend to get impatient and annoyed.  At ten seconds, they tend to get angry.  Past that, the monitor gets a fist, a boot, or a bullet.


What bootloader is that exactly, that allows the fast baud rate when using the UNO as ISP?
7  Using Arduino / Microcontrollers / Re: Removing the Arduino Bootloader on: November 27, 2012, 09:43:05 am
You don't need to remove the bootloader in order to upload Arduino-less code.

Wait what?
The bootloader is just a piece of software that is loaded in the AVR that allows
a tool (avrdude in this case) to upload code to the AVR. The bootloader itself
is totally independent of anything Arduino.

As shipped the AVR fuses are set to create two sections in the FLASH. Bootloader and application.
The "Arduino" bootloader is small piece of code in the AVR that uses the serial port to update the flash
with the user application (code/program/sketch).
The bootloader runs at reset/powerup if there is no attempt to upload anything, the bootloader
will start the application code.
The application code can be written using any toolset you prefer. The Arduino tools are just one option.

avrdude is a tool that is used upload code into the flash.
avrdude can be used with an ISP programmer to upload code to the flash
avrdude can also use other mechanisms like a serial port that talks to a serial based programmer or to a bootloader.
The Arduino IDE uses avrdude to talk over a serial port to a pre-installed bootloader in the AVR chip.
The newer IDE can also use an ISP progammer to upload code. When an ISP programmer is used,
a bootloader is not used so the flash space used by the bootloader code frees up and can be used
by the application code.

If you don't want to use a bootloader, you will need some sort of ISP programmer.
Like Pico, I recommend getting a USBasp programmer off ebay.
I like the USBasp kk multicopter programmers (about $5-$10 USD) because they come with a 6 pin ISP
cable instead of 10 pin so no adapter is needed.

--- bill

This cleared up a lot of things, thank you Bill.
8  Using Arduino / Microcontrollers / Re: Removing the Arduino Bootloader on: November 26, 2012, 10:02:47 am
You don't need to remove the bootloader in order to upload Arduino-less code.

Wait what?
9  Using Arduino / Microcontrollers / Re: Removing the Arduino Bootloader on: November 26, 2012, 07:07:56 am
I see, thanks for the advice.

If I were to erase the Arduino bootloader, is there a way to do it without purchasing another programmer?

I'll definitely get a programmer in the near future, it's just a question of finding a decent one since availability is very limited in my country.
10  Using Arduino / Microcontrollers / Removing the Arduino Bootloader on: November 26, 2012, 03:07:50 am
Hello All

I've been trying to figure this out for a couple of days now, and I think it's mostly because I don't really know what to look for.

I want to remove the Arduino bootloader on my mega board so that I can write standard AVR C code and upload it through the USB connection.

Is it possible to do this without buying a programmer? I read somewhere that I can use another Arduino as a programmer (have a spare Uno lying around), but how do I go about doing the whole thing?

The Arduino language & IDE has a bunch of annoying bugs and I'd like to just code it in plain old C. I have some experience with PIC mcus, but they're just rubbish :d

Thanks in advance
11  Using Arduino / Networking, Protocols, and Devices / Re: What GSM / Cellular shield for Arduino on: September 06, 2012, 03:20:08 am
I've been using the one from ITead studio for a project of mine.

It is fairly cheap, and works well, just make sure you use it with an Uno, and also make sure you have the right library.
12  Using Arduino / Programming Questions / SIM900 SMS programming question on: September 01, 2012, 11:11:09 am
Hello all

I'm trying to read SMS data into a string. Using the UNO R3 board, and the SIM900 shield by ITead Studio.

The connection works well, incoming messages are correctly displayed on the serial monitor (AT+CNMI is set to 2,0). I'm using the library from open electronics (http://code.google.com/p/gsm-shield-arduino/downloads/detail?name=BETA_GSM_GPRS_GPS_IDE100_v302.zip.zip&can=2&q=).

What I'm trying to do is create a similar method to Serial.event(), which takes incoming characters from the serial port and puts them into a string until it finds the newline character. After this it will print the string, and set it to 0:

Code:
String inputStr = "";         // a string to hold incoming data
//boolean stringComp = false;  // whether the string is complete

void setup() {
  // initialize serial:
  Serial.begin(9600);
  // reserve 200 bytes for the inputString:
  inputString.reserve(200);
}

void loop() {
  // print the string when a newline arrives:
  if (stringComplete) {
    Serial.println(inputString);
    // clear the string:
    inputString = "";
    stringComplete = false;
  }
}

/*
  SerialEvent occurs whenever a new data comes in the
 hardware serial RX.  This routine is run between each
 time loop() runs, so using delay inside loop can delay
 response.  Multiple bytes of data may be available.
 */
void serialEvent() {
  while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read();
    // add it to the inputString:
    inputString += inChar;
    // if the incoming character is a newline, set a flag
    // so the main loop can do something about it:
    if (inChar == '\n') {
      stringComplete = true;
    }
  }
}

Problem is, I cannot simply change the Serial.available to _cell.available, _cell is defined in the GSM.cpp file and creating a new software serial port in the Arduino compiler causes the two to clash. I've tried a couple of methods to alter the read functions of the library but to no avail.

The SimpleRead method works well to just stream data in from the GSM module, but I can't seem to find a way to capture that data.

Here is the simpleRead method, it reads & prints one character at a time.

Code:
void SIMCOM900::SimpleRead()
{
char datain;
if(_cell.available()>0){
datain=_cell.read();
if(datain>0){
Serial.print(datain);
}

}
}

I've also looked at using the WhileSimpleRead method, which is different only in that it waits until there are no more characters available on the serial line before printing, which can be a bit of a problem if large amounts of data are read in.

Code:
void SIMCOM900::WhileSimpleRead()
{
char datain;
while(_cell.available()>0){
datain=_cell.read();
if(datain>0){
Serial.print(datain);
}
}
}

I should also mention that I am running 64-bit Windows 7 Ultimate with version 1.01 of the Arduino compiler.

Thanks in advance

Regards
Jaco
13  Using Arduino / Networking, Protocols, and Devices / Re: ICOMSat Sim900 / Mega2560 on: August 30, 2012, 03:01:58 am
Hey, GOOD news!
I had the amazing idea of opening the GSM_Shield.cpp and change all the "mySerial" for "Serial1", and deleting all the #include NewSoftSerial
By doing this, I just changed the comunication to Serial1 (pins 18 and 19) of MEGA, so I jumped the RX to the TX to these pins aaaaaand... the results are the following:

system startup
no call
no call
no call

...And when I called the shield from my cellphone:

incoming voice call from xxxxxxxxx (my number)

YES, it's working!! I'm so happy!! smiley That's it my friends!

Great news!

I've also tried renaming the MySerial instances to Serial1, but I did not remove the #include parts. Definitely going to try this, thanks mate.

I only have to have GSM functionality so the tiny number of pins aren't a problem for me:)

Good luck.
14  Using Arduino / Networking, Protocols, and Devices / Re: ICOMSat Sim900 / Mega2560 on: August 29, 2012, 09:30:36 am
Yep, UNO board works perfectly.
15  Using Arduino / Networking, Protocols, and Devices / Re: ICOMSat Sim900 / Mega2560 on: August 28, 2012, 04:33:20 pm
Yep, a friend of mine has the uno board, I'm going to see if I can get somewhere with that. Will let you know
Pages: [1] 2