ATMEGA2560 Not working but bootloader burns. - Page 1
Forum section: electronics / beginners

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 27, 2017, 12:18:25 am
content: HiI have a circuit that has an arduino based section in it.When I put it together the arduino bootloader burned successfully but nothing would come out of the chip.No serial or plain high low logic.So I tried on another board with only the caps, crystal stc for the arduino and the same happened.I also desoldered a working chip with my code off an arduino twice and the same once more.Any idea why this is?will the ardunio run on just the crustal and two caps? is it wort trying?Thanks in advance.

author: sleemanj
author_rank: Super Contributor
timestamp: July 27, 2017, 01:15:35 am
content: Measure the voltage at RESET when it's not working but you think it should be working.You should have a cap in series between reset and J2.5 in case the serial is pulling reset low all the time.You should put a switch on reset so you can reset it manually.R13 should not be necessary, probably doesn't do anything bad though, PIC people sometimes do this I think it was recommended on some PIC datasheet or something.Aside from that nothing jumps out.

author: hermit
author_rank: Frequent Contributor
timestamp: July 27, 2017, 04:42:01 am
content: You say you burned the bootloader. How are you verifying it burned correctly. You don't say were able to upload a program? Have you tried that?

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 27, 2017, 04:43:04 am
content: Quote from: hermit on July 27, 2017, 04:42:01 amyes I burned it via ICSP. And the desoldered ones where pre burned.

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 27, 2017, 04:58:15 am
content: Quote from: sleemanj on July 27, 2017, 01:15:35 amIt measures around 4.7v.

author: tombi
author_rank: Regular Contributor
timestamp: July 27, 2017, 04:43:02 pm
content: Is it an actual crystal or a resonator? I had to set some fuse to increase the drive level to make a resonator work once.Do you have a scope? If so is it oscillating? You should see a low level signal on the crystal pins.Tom

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 27, 2017, 05:20:03 pm
content: Quote from: tombi on July 27, 2017, 04:43:02 pmIts an actual crystal with two caps. I tried multiple crystals including 12MHz. And I dont have an Oscilloscope

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 27, 2017, 05:23:33 pm
content: I just tried a serial echo directly in C and thats the only thing that got me some sort of output. but what ever I sent all I got was `w` or `o` and a few other characters.its sooo puzzling and this is my 5th chip.

author: alm
author_rank: Super Contributor
timestamp: July 27, 2017, 05:27:40 pm
content: Are the clock-related fuses set correctly? Given that you get some sort of output, it is likely not set to external oscillator (a somewhat common mistake). Does the clock rate match the F_CPU setting used while compiling the bootloader? Any clock division fuses set that might mess with this?Do you have a scope or logic analyzer that you could use to look at the output to see if the baud rate is off? If the bootloader expects an 8 MHz clock, and you have CKDIV8 set, then your actual baud rate might be 1/8th of the expected baud rate. If you use a 12 MHz crystal instead of 8 MHz, then the baud rate might be 50% fast.

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 27, 2017, 05:31:56 pm
content: Quote from: alm on July 27, 2017, 05:27:40 pmThese are my current fuse settings with 16mhz.And all I have is an Aglient U1252B DMM

author: JoeO
author_rank: Frequent Contributor
timestamp: July 27, 2017, 08:55:41 pm
content: How about a clear picture of your circuit board and all wires going to and from it.

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 28, 2017, 12:42:42 am
content: Quote from: JoeO on July 27, 2017, 08:55:41 pmfour dead boards later I got it working.I have a feeling it was my USBasp playing up.So i programmed it on the arduino than desoldered it and tried my best soldering unskills.

author: SL4P
author_rank: Super Contributor
timestamp: July 28, 2017, 06:12:03 am
content: I had a similar odd experience ecently with MEGA-1284P chips.Using an OEM JTAG-ICE3 to program the bootloader - they failed, but when I pulled the ISP/SPI clock back down, they worked fine - then I could re-set the fuses to my preference, and push back up to high-speed programming and no more issues.

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 28, 2017, 10:47:54 am
content: Quote from: SL4P on July 28, 2017, 06:12:03 amAhh I kept getting `avrdude : warning : Can not Set sck period . usbasp please check for firmware update .` but as it was a warning I assumed it was not important.Should have mentioned it here.

author: SL4P
author_rank: Super Contributor
timestamp: July 28, 2017, 11:23:39 am
content: Nice looking project what does it do ?

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 28, 2017, 11:25:36 am
content: Quote from: SL4P on July 28, 2017, 11:23:39 amThanksIts a Digital voice announcement system (DVA) for a London underground train.

author: SL4P
author_rank: Super Contributor
timestamp: July 28, 2017, 11:28:41 am
content: If you're running the CPU on the crystal... I hope there are ~18pF caps on the other side of the board...!Same as above for 10nF / 100nF decoupling capacitors.ALL close to their intended purposes- the xtal seems a long way from the CPU chip.Cheers

author: abdullahseba
author_rank: Frequent Contributor
timestamp: July 28, 2017, 01:01:54 pm
content: Quote from: SL4P on July 28, 2017, 11:28:41 amYep I have 15pF on the other side. The crystal is about the same distance as my arduino. That second crystal is for the USB - audio chip.