Pages: [1]   Go Down
Author Topic: LED Blinks much faster than it should  (Read 154 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm a student working on a research project. For this project, a custom arduino was made on a PCB with a gyroscope, and magnetometer. The problem I'm having is that when uploading the simple Blink demo code to the atMega 2560 through a USBtiny programmer, the led on the PCB, which corresponds to pin 13 like on a standard Arduino does not blink every 1000ms. At first it blinked about 15 times slower, i.e every 15 seconds. After some more trials, the LED started blinking sporadically.

I tried using the programmer with a standard Arduino and everything worked as it should so, I know the problem shouldn't be the programmer.

What could be responsible for the incorrect rate of the blinking light?
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 548
Posts: 27372
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you burn the fuses?
Use the IDE and program a Mega2560 bootloader on the part, that will set the fuses for external 16 MHz crystal, and things should run like a normal Mega after that.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Valencia, Spain
Online Online
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What could be responsible for the incorrect rate of the blinking light?

You didn't do "burn bootloader" (to set the CPU clock speed).

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I use the "burn bootloader" option, I get this error.

avrdude: verification error, first mismatch at byte 0x0000
         0x0c != 0x00
avrdude: verification error; content mismatch

Could it be that the USBtiny programmer does not work with atMega 2560?

Also, the sporadic blinking light is now blinking at a different rate again, but still not with the correct 1000ms delay.

Here is a picture of my setup.


* photo.JPG (2820.47 KB, 3264x2448 - viewed 17 times.)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 548
Posts: 27372
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When you select Tools:programmer, which one you select?
Perhaps there is a driver issue?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

USBtinyISP
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to use this http://www.gammon.com.au/forum/?id=11635 to burn the bootloader..
Is it necessary to cut out the 5th wire and have it as a reset pin?
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 548
Posts: 27372
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That code is for using one Arduino running a sketch to bootload another Arduino.
Not for using an AVR ISP Programmer to bootload a device/Arduino.
If you want to use that sketch, then yes, reset needs to come from pin 10 on the Arduino that is running the bootloading sketch.

I am not sure what the problem is with the USB Tiny device.
Some programmers do have problems with the large memory devices like a Mega2560.

I do a lot of messing around; after the first couple of projects, you come to realize that good tools make a world of difference. I use Atmel AVR ISP MKii for all my bootloading and thus do not have all the issues that come up way too often here with folks trying to get other methods to work.

http://www.mouser.com/ProductDetail/Atmel/ATAVRISP2/?qs=%2fha2pyFadujqFzV%252bExzQOlFEGuFbE5zkYm9OzGvRqkjeoy23MLFzjw%3d%3d

Price has been creeping up, about $1/year since I bought mine in early 2011.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 548
Posts: 27372
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The stock MKii does not provide power to the device being programmed, it only monitors it. The only time I have had a problem was when I forgot that - the indicator lights make it pretty obvious that something is not right.
I usually have a USB interface as part of the project, either connected to a header or mounted on board, so PC power via USB powers the board.
So connect both up, install the bootloader, then install blink, gives a pretty good indication that the board is off to a good start.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: