Showing posts with label atmega. Show all posts
Showing posts with label atmega. Show all posts

Tuesday, October 16, 2012

AVR Dragon Jumpers - ISP for Atmega 168/328/etc

I've been trying my hand at etching pcb's lately. As a result I needed to burn a bootloader on a Atmega 328 and I didn't put a ISP header on my target board. I really need to get in the habit of doing that. Usually I just stick it in my dragon, connect it up with a bunch of jumpers and burn it.

A while back I saw someone had made a whole set of boards for this purpose. You just plugged in the board and never get a wire crossed again! I made a brief search for them but couldn't find anything useful (schematic, pcb layouts, etc). So I made my own. So far I have made the ISP for the 168/328. Sometime I will make the HVPP for these and both for the 644/1284.

You may notice that I have a mix of male and female headers. When I got my dragon I put mostly female headers on (excluding JTAG and ISP) so I could use normal jumpers rather than special female ones. I still think it was a good idea, but most people use all male headers, so the board could use all females.

I only put the used headers for ease of use and cost control. For soldering I put all the headers in place on the dragon then added the board. It keeps everything perfectly aligned.


Etch-resist was a laser printer transfer, cupric chloride etch solution. I'll do a post on that whole process later.


I intended to attach the KiCAD Schematic and PCB file here, but I can't see how to do that (might not be possible), so I posted it over on TryThisTv.com

Wednesday, January 18, 2012

Fixed a dead 1284p

The Problem:
Through the 1284p saga I ended up with a 1284p that I couldn't burn the bootloader to. It was working (sprinter running, random serial errors and restarts though) then the next day it quit. Later, when I tried to burn the correct fuse bit and bootloader I received a Device Signature = 0x000000.

Unless something had corrupted it, it had the Ext Crystal Osc. setting. I figured the fuse problem out after this chip died. I came to the conclusion that either something was messed up with the fuses or the micro was completely dead. I wanted to build a Fusebit Doctor, but didn't have the time to start another project at this point, so I bought a 644p and shelved the 1284p.

The Solution, or "I Had a Lucky Break!":
I kept thinking about the dead micro, it was really bugging me. Finally I decided to try it with a crystal oscillator instead of the resonator to see if that was it. I found a 16mhz crystal in my spare parts box and replaced the resonator on my breadboard with it, couldn't find 22pf caps, and the caps I found didn't work with it.

I still managed to burned a bootloader on it with just a 16mhz crystal, no caps. Now it seems fine again with the resonator and the new fuse settings, go figure.

Monday, January 16, 2012

ArduinoISP

Intro:
If you read Part 2 of my Sanguinololu Build you saw my arduino ISP (in Circuit Programmer) built on a breadboard to burn bootloaders my 1284p's. It worked really good, but I had to be really careful not to bump any wires loose or pull them out accidentally.
Some day I may buy a proper ISP, but until then it would be nice to have something that would work on the rather rare occasion I actually need one. So I decided to make something more permanent but not require a dedicated Arduino either.

The Project:
  • Connect an Arduino to any 6 pin AVRISP header
  • Include status LED's
  • Be completely removable (mounted on headers)
There you have it, 3 led's (Pulse, Error, Data?) Schematic was figured from the Burning the Sanguino Bootloader using Arduino as ISP page.  LED's are dead bugged on the header, not sure if you even need the cap. just plug in the 2 headers, the 6 pin ISP plug and burn away!

Seems to work so far, Tried it on my other arduino, not really extensive testing, but seems to work.I'd like to make a couple pcb's for various chips with the 6 pin ISP header on them, but that's all for now.

UPDATE:
Just built a second one, decided to move the ground from the power side to the io pin side, that allows selection of 5v or 3.3v on the VCC wire. or you can leave it disconnected if your target is self powered.


Tuesday, December 27, 2011

Sanguinololu 1.3a - Part 3:Not Out of The Woods Yet

See Also:
Part 1 - Build
Part 2 -  Trouble in Paradise


After the events of the last 2 parts I thought the Sanguinololu was finally working properly. But that would have been too easy, right? (I wouldn't have called it easy.) Of course not, something's still not right. Now I could upload and download firmware fine, and they seem to work. Except...
  • Both boards seem to reset or reboot at random.
  • One board gets a lot of serial errors, I resoldered the FTDI chip several times. I'm convinced my soldering is OK.
  • I noticed that touching my scope's 10x probe to the resonator pins produced serial errors and seemed to crash the 1284p some times
Turns out the Sanguino, from which I tried to use the bootloader and related software, as per the instructions on the Sanguinololu wiki page, is built with a crystal oscillator, not a ceramic resonator, so the fuse settings may be different. The Mighty 1284p bootloader is also set to a crystal oscillator.

I used http://www.engbedded.com/fusecalc/ to calculate new fuse settings

I burned Mighty 1284p bootloader with new fuse settings (changed in boards.txt):
Low 0xD6
High 0xDC
Ext  0xFD

I ran the controller connected to usb (no motors or external power) for over 3500 lines of g-code without error. Previously it would error some where between when it connected (before the build even started) and definitely before 200 lines of g-code.

I hooked up my motors and ran another build. I haven't built a frame yet, I've got other projects to finish first, but it ran the motors for a full build (11222 lines, the sample build-benchmart.stl), so we'll call it good for now.

From what I have been able to find the fuse settings for the Sanguino and Mighty 1284p are just plain wrong for the Sanguinololu. They are for a external crystal oscillator. Apparently the full sweep oscillator setting is required for a resonator. The above settings seem very stable so far.

UPDTATE: I just got a 644p to play with, I haven't had a lot of time for testing yet, but it seems stable on both the default settings (ext crystal osc) and my modified fuse settings. I think almost everyone uses the 644p and this may be the reason I haven't found anyone else with this problem. I'm inclined to believe that my setting (full swing osc - ceramic resonator) is correct for both micros, but the 644p doesn't mind the wrong setting nearly as much as the 1284p. I've still got more tests to run on it, so I'll update as I go.