I admit it: I'm a total geek. I love electronics, programming, 3D art, vintage Apple hardware, and whisky. I'm always juggling half a dozen projects. I also enjoy documenting it all: my successes, my failures, my experiences... and everything geeky along the way.

Seeed Studio Fusion - $9.90 for 10pcs 2 layer 10x10cm boards


 
 
 
 
 

MEGA MINI Assembly, Part II | Kevin Rye.net - Main

Kevin Rye

Geek Extraordinaire. Yeh, I said it.

MEGA MINI Assembly, Part II

If Google brought you here looking for the MegaMini by JK Devices, check here. If not, read on....

I left off with my MEGA MINI boards not working. I was banging my head against the wall trying to figure out what went wrong. I figured I’d shelf it for a week and look at it again another day with a clear head. I ended up getting busy with the Night Light 2.0 and the Bare Bones Arduino v3. Now that those are complete, it’s time to go back to the MEGA MINI and see what went wrong.

I posted my schematic on the Arduino forums and asked if someone could lend a second set of eyes and let me know if it made a stupid design error. It turned out I had .1uF caps on the crystal! Can you believe it? When I put all the caps into the schematic, I must have used the clone tool and forgot to relabel the ones for the crystal as 22pF. That mistakes carried all the way though to the PCB and I blindly soldered in .1uF caps without even questioning it. I should have noticed when I laid out all my parts that I didn’t have 22pF caps. I guess it was a “forrest for the trees” thing. It just goes to show that sometimes you just need a second set of eyes.

I removed the .1uF caps and replaced them with 22pF ones. I reconnected the PCB to Atmel Studio. I was so thrilled to see if pick it right up and write the bootloader without a problem. As a matter of fact, both boards worked great. I though maybe I had cooked the ATmega on the first PCB. Apparently, they are more robust than I had thought.

That’s awesome. That means I got all the ICP stuff on the PCB correct!

bootloadingMEGAMINI_0003

With the bootloader written, it was time to upload a test sketch. That will tell me if I got all the FTDI stuff on my PCB correct.

Blink, blink, blink! It works! I’m so thrilled that it works. I love not wasting $18 ATmegas!

bootloadingMEGAMINI_0005

I have a header on the board for an LCD. Remember, this is supposed to be a stripped town version of the GPS clock that I’m working on. If I can get this right, then the final PCB for the GPS clock should be a snap.

Since this is just a prototype, I don’t want to permanently attach a $20 LCD to it, so I soldered in a female header.

MEGAMINIasembly_0006

Finally, I soldered in a 10K pot for the LCD. I was all set to try out some GLCD example sketches.

MEGAMINIasembly_0009

I uploaded a sketch, but sadly, nothing happened. I then rechecked my pinouts to the display and dang-it! I got them all wrong! I don’t know what I was on at the time, but I got all of them wrong. Maybe I looked at the wrong data sheet or something. Actually, I think what I did was confuse the fact that “physical pin X” isn’t the same as “digital pin X”. I think I just jumbled it all up.

I though that it would be an easy fix and that I could just do it in code. I opened up the ks0108_Mega.h file in the GLCD library and remapped all the pinouts. I really goofed though and managed to use 3 pins that aren’t even outputs. To work around that, I just ran some jumper wires from the LCD header to the header for the Button Breakout Board and cut the traces on the PCB by the LCD header. I then remapped those 3 pins in the ks0108_Mega file. Problem solved.

Good thing this is just a prototype. Again, I’d rather make these kinds of silly mistakes on a $5 board than on a $50 one.

MEGAMINIasembly_0011

I recompiled and uploaded the sketch. Boom! It works. It really works!

MEGAMINIasembly_0012

I then soldered in a few more headers for the Button Breakout Board and popped it in.

MEGAMINIasembly_0014

I then uploaded a new sketch that just sits there waiting for a button press. Once a button is pressed, it’s displayed onscreen. It’s just a simple test to make sure than I can interface with the ATmega2560 with the Button Breakout Board.

MEGAMINIasembly_0026

Here it is in action.



This was just supposed to be a proof of concept for the GPS clock; basically a trial run. However, it could very well be a finished project on its own. I could just put it in an enclosure and it would be good to go. With 256K of code space, I bet I could have it display a ton of cool stuff.

I’m one step closer to completing the GPS clock. I think it’s safe to go ahead and start working on the PCB and apply what I learned from the MEGA MINI.

See this project from start to finish:
The MEGA MINI v1.0
MEGA MINI Assembly, Part I
MEGA MINI Assembly, Part II