Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: HDL_CinC_Dragon on July 12, 2007, 06:03:54 PM

Title: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 12, 2007, 06:03:54 PM
Ive checked and rechecked and rechecked and rechecked and rechecked (continue about 30 more times) and rechecked my soldering. Everything is connected to where it should be and nothing is connected where it shouldnt be. Ive got a regulated 5.15 volts between VCC pin 7 and GND pin 8. Ive got my AT Mega in its 28 pin DIP socket and putting the black lead(GND) from my tester on pin 8(GND), and the red lead from my tester on pin 7 and its reading the 5.15 volts. That tells me that the MCU is in fact getting power. All the connections go where they need to and no connections are made where they shouldnt.

Based on this information, I am lead to believe that my MCU has been fried. Is there a way to find out if it is? the connection between VCC and GND is good, i know that... Is there a way to see if perhaps a different part of the MCU is broken? Are there certain connections I can check? Should everything have connection to ground or something like that?
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: Admin on July 15, 2007, 03:09:01 PM
Im guessing this post is related somehow?
http://www.societyofrobots.com/robotforum/index.php?topic=1536.msg10340#msg10340
(try and keep related posts as a single post)

So Im confused about your post . . . you say everything is perfect, and then ask if its fried. You forgot to mention anything about what isnt working :P

Its not programming or something?

5.15V is a little high for the regulator output. Are you sure its regulated?

Guessing from your previous post, chances are you fried something. The only way to know is to buy another one and try it out . . . I usually buy extras for myself cause I fry them occasionally, too.
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 15, 2007, 06:53:24 PM
Im curious to know if theres a way I can check if its fried without spending 10 dollars for a new MCU. $3.66 for the controller, $7 for the shipping. I dont have a lot of money unfortunately.

Also, the two threads aren't 100% correlated with eachother. The other one is a 5vreg missing about 2/3 of a volt from its regulated output so I was wondering If I needed to replace it. This thread is asking if the MCU might be fried.

Ill try to be as specific as I can this time, sorry I wasnt before, When I posted that I was also working on it so my thoughts were scattered with frustration
alrighty, here goes:
1) I soldered in my 28pin DIP socket and then made all the necessary connections for VCC and GND and also for the Data connections for the 3x2 header to the DIP socket. Pin 1 from the ISP programmer to pin 18(MISO), pin 2 to 7(VCC), 3 to 19(SCK), 4 to 17(MOSI), 5 to 1(Reset), 6 to 8(GND).
2) I put the AT Mega8 AVR in the 28 pin DIP socket
3) I plug in its power source (be it battery pack or USB)
4) I connect the ISPII 3x2 programming cable to the 3x2 header on the motherboard
5) I load up AVR Studio and try to connect to the device -- I select the AVRISP mkII and select USB for the port
6) When the window pops up, I choose the AT mega8 device and the programming mode is set to ISP mode
7) When I click Erase Device just to see if it even sees the MCU it tells me that no target was detected.


Im pretty sure I didnt leave anything out that I normally do... Did I not do something that I was supposed to? Or do I have to spend the money to get a new one shipped to me?
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: Admin on July 22, 2007, 10:45:51 AM
Before you tell it to erase, you originally tell it to connect, correct?

(http://www.societyofrobots.com/images/sbs_connect_AVR.png)

Does it give you an error when you select this option? Because if it cant connect, you shouldnt even have the option to erase . . . I suspect that you are either using the wrong port, or its truely fried.

Try programming it and see what happens (probably wont work, though).

If its truely fried, you may want to consider just upgrading now since you have the option:
http://www.societyofrobots.com/step_by_step_atmega168_swapout.shtml
(requires zero rewiring, just a few changes in the code)
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: garriwilson on July 22, 2007, 09:19:35 PM
I'm not sure but I think you're supposed to plug in the 9v battery when you connect to PC? IF I'm wrong sorry :-[.

P.S. I'm a major noob. lol ;D
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 22, 2007, 10:04:29 PM
Of course you tell me this AFTER I ordered a new AT Mega 8 lol

no worries, I dont think I have to worry about filling its EEPROM anytime soon. When I do finally get my photovore working (Because im NOT stopping until the little bastard is running around avoiding things =P) I probably wont be making too many complex scripts for anything. But when I do, Ill have more of a reason to upgrade.

Well im going to remake the programming part of the circuit board again. (Power source, AT Megas, 3x2 header) and see if I can get it working...



I'm not sure but I think you're supposed to plug in the 9v battery when you connect to PC? IF I'm wrong sorry :-[.

Im using the battery pack set up but yes, you have to plug in its power source before the program can write to it
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 22, 2007, 10:29:00 PM
Discovery!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Im so dumb!

ok, so to make sure that the problem was my circuit and not the cable hook up, I took some pins from an HDD header I desoldered from a mother board and stuck them into the holes in the ISP cable and used my DMM to see which pins corresponded to which pins on the other end. On the programing hub, the translucent blue boxy thing, pin 1 of the cable is on the inside under the red ribbon wire. On the other end thats supposed to connect to the board is on the OUTSIDE under the red ribbon wire! I thought it was a mirrored config but I was wrong :'(

This means my very first circuit board was probably 100% correct in the first place. I feel dumb. Now that I know this, I can correct the problem and test to see if it works. Im still in the process of rebuilding the circuit, ill post my findings when im done.
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 23, 2007, 12:12:19 AM
Well that did the trick.
I can now interface with my AT Mega 8! Thanks for all the help!!


I apoligize for all the hell I raised in trying to get this to work. I feel sooo friggen guilty and embarrassed that is was something so simple. I didnt realize that the arrow on the ISP heads was on the same side as pin 1. I thought you were just supposed to "know" that it was on the inside. Turns out I was wrong. So I rewired the whole thing and made sure I got the correct Pin 1 on the 3x2 header and then got all the rest of the pin numbers correct.

Oh well, lesson learned. If I can take at least one lesson out of all this then it was worth it.



I also learned about keeping my posts organized and all together. I must have started like 8 threads (Thats what I feel most guilty about)
From now on, if Im having trouble with a project, im going to try and keep all my questions in a single thread rather than one new thread for each thing...
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 23, 2007, 12:27:19 AM
New problem lol


Should I write it to the AT Mega 8 as Flash or EEPROM?
When I write it as flash, it takes about 20 seconds
The debug text area says "Programming FLASH....    OK!"
but when it goes to verify by "Reading FLASH" it fails and then fails to leave the programming mode.

When I try to write as EEPROM it says the contents of this HEX file do not fit in the selected deivce...

I tested the 6 pins on the 3x2 header for shorts and the only "short" is between the VCC and GND pins but thats because theyre both hooked up to the VReg and I get like a .011 reading on it from my DMM, when looking for resistance, instead of .000 for a full closed circuit





I need to go make some coffee, im going to be up all night now
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: Admin on July 23, 2007, 04:53:59 AM
Quote
I apoligize for all the hell I raised in trying to get this to work. I feel sooo friggen guilty and embarrassed that is was something so simple.
Dont worry I have my moments too . . . And when I was a noob, probably more than you . . .

Quote
Should I write it to the AT Mega 8 as Flash or EEPROM?
Flash

Make sure the device is set to ATmega8. Try going to the Advanced tab in the programming window and click the Read button and the Read Cal. Byte. Im honestly not sure that will help, but I always do that before I program and I never have problems . . .
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 23, 2007, 05:05:47 AM
Yep, it is set to AT Mega 8 and and I did what you said but I get the same problem... maybe I should try it with the new AT Mega that I just got in the mail... before I do that though Im gunna see if the troubleshoot has anything to offer me... one could hope right?
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 23, 2007, 05:13:53 AM
Got it!

It was the "ISP Freq" in the "Board" tab. I had to set the frequency to 125.0 kHz and when I told it to program the MCU, I got zero warning messages or failures in the debug console.

Thanks Admin =D

Now I just have to make the second "eye" and modify the servos and then mount everything to my chassis
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 23, 2007, 06:14:19 AM
****.... ummm to modify the servo, it says to remove the slot that is supposed to go over the pot. Well the slot on my gear isnt removable... im gunna have to use a drill...



-EDIT-
Ok I dremeled one of them... took alot of energy and my hand hurts from holding the little gear for that long while dremeling its organs out... works now though.

After working all night already on this thing is starting to take its toll on me. Not sure if im gunna be able to do the second servo until after I get some sleep :P

-EDIT-
Just remembered im out of super glue... so regardless, I cant do the second servo this morning.... thank god
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: Admin on July 23, 2007, 07:02:07 AM
Hmmmm you are the second person to mention this problem . . . this should help:
http://www.societyofrobots.com/robotforum/index.php?topic=1299.msg10562

I guess Hitec is trying to save a few pennies . . .
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 23, 2007, 07:41:33 AM
grr, we should all write angry emails to them :)

but yeah, I dremeled the first one out and super glued the pot and waited for it to dry before putting the gear back on. Then I ran out of super glue so Im not even going to bother with  starting on the other servo until after ive slept and bought some more super glue.
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: iCopyright_Everything on July 24, 2007, 05:37:01 PM
Ive checked and rechecked and rechecked and rechecked and rechecked (continue about 30 more times) and rechecked my soldering. Everything is connected to where it should be and nothing is connected where it shouldnt be. Ive got a regulated 5.15 volts between VCC pin 7 and GND pin 8. Ive got my AT Mega in its 28 pin DIP socket and putting the black lead(GND) from my tester on pin 8(GND), and the red lead from my tester on pin 7 and its reading the 5.15 volts. That tells me that the MCU is in fact getting power. All the connections go where they need to and no connections are made where they shouldnt.

Based on this information, I am lead to believe that my MCU has been fried. Is there a way to find out if it is? the connection between VCC and GND is good, i know that... Is there a way to see if perhaps a different part of the MCU is broken? Are there certain connections I can check? Should everything have connection to ground or something like that?

Well, HDL_CinC_Dragon, I've been having the EXACT SAME issues with my efforts using Admin's tutorial, but with a totally newbie head and the AVRISP MkII Programmer (2x3).

Hey could you PLEASE PLEASE tell me what you meant when you got the programmer head connections wrong? What should go where? I was following the admin post of the schematic and I have been CERTAIN its right but best to check with you, coz I've been getting THE SAME MESSAGE - Device not found etc when trying to program the damn thing and Ive gone over the color dot schematic a dozen times (but my 5V regulator is not doing what its supposed to but thats another story).

I have: (typing-drawing):

___----____
1    3      5
2    4      6

Is that what you had?

Despite the feeling of futility, the fact that you're having the same exact problems I am, and posting questions on here is really a great help!

Hope to hear from all soon!

Dan (iCopyright_Everything)
Title: Re: AT Mega8 has sufficient power but AVR Studio cant see it
Post by: HDL_CinC_Dragon on July 24, 2007, 07:35:40 PM
ok ill try to make a typing drawing as best I can for you

What I did was I misidentified which pin was which for the programming ribbon. If you take off the top cover of the programming HUB(The translucent blue box) by pinching the four claps on the underside, and unplug the cable(make note of the orientation of the red wire first), you will see that one of the pins is labeled "1". This pin is also that red wire. So based on that you get this:

r|||||
r|||||
r|||||
1 3 5
2 4 6
[HUB]

notice that pin one is on the inside (in relation to where the cable is) and directly under the red wire in the ribbon. It was my thinking that this layout was going to be mirrored to the other side so that pin one was again on the inside under the red wire. But this is not the case. What you really get is this:

[Other end of the ribbon that you plug into the robot]
1 3 5
2 4 6
r|||||
r|||||
r|||||
1 3 5
2 4 6
[HUB]

This time, pin 1 is on the OUTSIDE under the red wire as opposed to it being on the inside like it is on the other end.

I didnt realize this at first but I did after I had already figured it out using my Digital MultiMeter(DMM), on both ends of the ISP cable, on the black part, there is an arrow either on the inside(relative to the wires) or the outside. That arrow points to pin 1, and the part I didnt realize about this is that it will be on the same side as the pin. I just assumed that since pin one was on the inside on one side, it would be mirrored but i was wrong and feel very dumb for it, but i guess thats the learning process ;).

hope this helped... ill add pictures when i get home to better help in figuring out what the heck I just said ;)