Forum Index > Projects > LED Pegboard and Matrix Projects
 Can't program Meggy on Mac
 |  Printable Version
By: Windell (offline) on Monday, December 29 2008 @ 01:58 PM PST  
Windell

Does this thread help?

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1193955465


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: magician13134 (offline) on Monday, December 29 2008 @ 02:00 PM PST  
magician13134

Quote by: Windell

Does this thread help?

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1193955465


It did, sorry I just edited my post Oops!


Forum Apprentice
Apprentice

Status: offline

Registered: 12/29/08
Posts: 12

Profile Email    
   
By: Windell (offline) on Monday, December 29 2008 @ 02:03 PM PST  
Windell

One thing to check: Make sure that your USBtinyISP is *not* providing power to the Meggy-- that is, make sure that the power jumper by the ribbon cables is disconnected, and make sure that Meggy is providing its own power.

(Alternate scheme: USBtiny provides power, but Meggy Jr is switched off. Just make sure that both are not on at the same time-- that will guarantee trouble.)


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: magician13134 (offline) on Monday, December 29 2008 @ 02:12 PM PST  
magician13134

Yeah, my USBTiny is not providing power... Goodness, I wish I had socketed the 168 now Frown


Forum Apprentice
Apprentice

Status: offline

Registered: 12/29/08
Posts: 12

Profile Email    
   
By: Windell (offline) on Monday, December 29 2008 @ 02:31 PM PST  
Windell

>Goodness, I wish I had socketed the 168 now

Do you have a reason to believe that the '168 has been damaged?


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: magician13134 (offline) on Monday, December 29 2008 @ 03:14 PM PST  
magician13134

No, but if I had, I could use my target board to program it... Well, now that i think of it, I don't need the target board... There's an ISP header build in - Duh! Ha ha... I'll either have to try to get AVRDude set up on my Mac or resign to using my PC again, I guess


Forum Apprentice
Apprentice

Status: offline

Registered: 12/29/08
Posts: 12

Profile Email    
   
By: Windell (offline) on Monday, December 29 2008 @ 03:22 PM PST  
Windell

> I'll either have to try to get AVRDude set up on my Mac or resign to using my PC again

The best way to get the AVR toolchain on the Mac (including AVRdude) is to install this bundle:
http://www.obdev.at/products/avrmacpack/download-de.html


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: magician13134 (offline) on Monday, December 29 2008 @ 05:43 PM PST  
magician13134

Hmmph! I installed AVRDude and everything looks good with that, but when I tried to program the Meggy, it's still a no-go. Here's the output:

PHP Formatted Code
ben-perkinss-macbook:Documents magician13134$ avrdude -c usbtiny -p atmega168 -U flash:w:test.hex

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

ben-perkinss-macbook:Documents magician13134$ avrdude -c usbtiny -p atmega168 -U flash:w:test.hex -F

avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA168 is 1E 94 06
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "test.hex"
avrdude: input file test.hex auto detected as Intel Hex
avrdude: writing flash (2830 bytes):

Writing | ################################################## | 100% 3.69s



avrdude: 2830 bytes of flash written
avrdude: verifying flash memory against test.hex:
avrdude: load data flash data from input file test.hex:
avrdude: input file test.hex auto detected as Intel Hex
avrdude: input file test.hex contains 2830 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.53s



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

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


Forum Apprentice
Apprentice

Status: offline

Registered: 12/29/08
Posts: 12

Profile Email    
   
By: Windell (offline) on Monday, December 29 2008 @ 10:52 PM PST  
Windell

Okay, so now we're debugging *two* different problems: USB-TTL cable programming and ISP programming.

For the USB-TTL programming, you can use the scope to test the USB-TTL cable. Connect the cable to your computer but not to Meggy Jr. The 6-pin end of the cable has bits of exposed metal, which you'll want to look at with the scope. Set the scope to 1 V/division scale, auto trigger, 100 ms/division, and look to see that pin 6 (green) is high, pin 4 (orange) is high, and pin 1 (black) is low. When you hit "upload to I/O board," pin 6 should go low for an extended period of time. (OK if it's not consistently down.) Try again, looking at pin 4. You should see the signal dip low-- briefly-- a few times. If this is the case, your cable is probably working correctly.

On the ISP programming front, *first* make sure that you can program your Arduino with your existing setup-- that will verify that your programmer and software setup are working well. The "initialization failed" error can be caused by any of the connections from that port to your chip, so check them all, and make sure that you don't have any accidental shorts on those pins.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: magician13134 (offline) on Tuesday, July 07 2009 @ 03:28 PM PDT  
magician13134

Sorry to bring up an old thread, but I haven't been able to get this working still... I've tried everything in here except using an oscilloscope, I really don't have a working one, nor do I know where to go to use one... I got a new computer, everything has worked so far (Arduino, USBTiny, AVRDude), but still nothing works with my Meggy Jr...


Forum Apprentice
Apprentice

Status: offline

Registered: 12/29/08
Posts: 12

Profile Email    
   
By: Windell (offline) on Tuesday, July 07 2009 @ 03:55 PM PDT  
Windell

Well, this is weird indeed. And I'm sorry that it has dragged on so long.

Let me make sure that I understand what's going on here: Your Meggy Jr is basically working, EXCEPT that it can't be reprogrammed, right? It's got power on when you're trying to program. Your computer is set up and able to program an Arduino through a USBtiny, but not the Meggy Jr, and USB-TTL programming is not working either. Correct so far?

Next... You're sure that the ISP-6 header is on the bottom of the Meggy Jr, and that pin 1 of the cable is facing the right way, right?

I'm suspicious that perhaps this is a "reset" problem, because the only pin common to bootloader (USB-TTL) programming and ISP programming is Reset. If that pin were held high-- by a short to +V, or if the value of the reset pull-up resistor (R4, supposed to be 10k, the one small-size resistor) were wrong, it might not be possible for the Meggy Jr to initiate programming. Also possible: a bad solder joint at pin 1 of the microcontroller. Check these out carefully. You might also, with the power off, measure the resistance between pin 1 and +V.



Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: magician13134 (offline) on Tuesday, July 07 2009 @ 05:06 PM PDT  
magician13134

Hmm.... R4... 10k? My R4 is 220... It's been so long since I've made this now... Maybe it was a 10k it didn't come with and I mistakenly thought it was a 100 so I used a 220 to replace it? I'm not sure. All my resistors look the same size, so I'm guessing that's the only problem. Would that cause the issue? And should I just replace it to get it working? (If I can't find a 10k here, I know I have 1k... Would that work?)

Here are some pictures just in case you can pick up on anything else that wrong.




Forum Apprentice
Apprentice

Status: offline

Registered: 12/29/08
Posts: 12

Profile Email    
   
By: Windell (offline) on Tuesday, July 07 2009 @ 05:22 PM PDT  
Windell

Yeah... that would do it. Substituting a 220 ohm resistor for the 10 k would almost certainly have no effect *except* preventing programming from being possible.

The value there needs to be at least 5 k, but 10 k really is better. It will also work but for ISP programming only if you just remove the resistor. If you leave the resistor off, that disables the "auto-reset" feature of Arduino-style programming. If you want to leave the resistor off and program through the USB-TTL cable, you'll need to (1) reburn the default Arduino bootloader (with the USBtiny) and then (2) every time you reprogram, press the reset button at the right moment.

If you don't have a 5k - 10 k resistor, you can make one by stringing several 1k's in series, or you can e-mail our store and we'll send you a replacement. But for the moment, *just remove it* and things should mostly work okay. Smile


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: magician13134 (offline) on Wednesday, July 08 2009 @ 07:42 AM PDT  
magician13134

I had to dig through a couple boxed from Mouser, but I finally found a small pack of 10ks. I'll get that replaced in a little bit and hopefully get to start programming for it soon!

Thanks for the help, I hope this was the problem!


Forum Apprentice
Apprentice

Status: offline

Registered: 12/29/08
Posts: 12

Profile Email    
   
By: magician13134 (offline) on Wednesday, July 08 2009 @ 12:40 PM PDT  
magician13134

Phew! Finally. That took way too long... Now I feel bad that it was such a simple problem I had overlooked. Thanks for being patient with me. It all works now Big Grin


Forum Apprentice
Apprentice

Status: offline

Registered: 12/29/08
Posts: 12

Profile Email    
   



 All times are PDT. The time is now 12:50 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?