Monday, April 30, 2012

Bench PSU: AVR JTag update #4 (I think I can stick a fork in it now)

I've slowly but surely made progress on my bench power supply. I think my JTAG issues are a thing of the past. I've done a couple things to ensure reliable communications, and I've now got the AVR Dragon running at 2 MHz with 0 errors so far. First, I put the 20pf capacitor on the JTAG clock line, at the breadboard side. I know I derided the lowly 20pf cap in the past as a pawn of the Capacitor Cartels, but I'm eating crow now.

The second thing I did was to create a JTAG "Bread Head", so named in and inspired from this post on Blondihacks: Bread Head. I'm not a great photographer, and macro shots seem to be even harder, but here it goes:

My Atmel 644 (and pin compatible DIP 40s) JTAG
Breadboard adapter. I could probably trim a little more
perfboard off the top.

Tuesday, April 24, 2012

Bench PSU: AVR JTag update #3

In my last post, I reported that I got my AVR Dragon to work in a 5V circuit by creating what I called a "shielded JTAG cable":

I speculated that "cross talk" interference might have been causing my un-reliable JTAG when running my circuit at 5V. (It worked fine at 3.3V, but some components in my final circuit are 5V parts, I also noticed that many 20 Mhz AVRs are only rated to run at a full 20Mhz above about 4.5V)

I got my DSO Quad hobbyist class digital scope last week, and I was all set to write up a really scientific post documenting my construction and testing of a shielded AVR cable, then something strange happened. I switched to another 2x5 "unshielded" JTAG cable to reproduce my original problem. When I hooked up my DSO to the JTAG clock line, the programming functionality worked flawlessly at 5 Volts! Curse you, Heisenberg! (Yes, I know that this is not really the meaning of the Uncertainty Principle, but any time I run across a case where the act of measuring something alters the quantity I'm trying to measure, I think it it).

Saturday, April 21, 2012

Windows Installers - Having it your way.

Despite being my blog about "software and electronics", I've been sparse on posts about what's historically been my bread and butter - the Windows Desktop platform, still the best thing to happen to computing since sliced bread ... and butter. It's just not as sexy as the exotic embedded stuff or the mobile platform du jour.

Aynways I've been meaning to compile and post a list of windows tools that I think rock. I'm always surprised when I find out someone whos been using windows for a long time doesn't knwo about some particular tool I've been using forever and think is essential, "what, you mean you've never heard of SciTE?".

7-zip is definitely a tool in that category. It can open just about anything considered an "archive" format, zip, gzip, tar, rar, iso, and one that I find handy when something's gone wrong: msi and cabs.

I recently got my atmel cpld JTAG programmer, and wanted to install the AtmelISP software. For some reason only known to my PC, the installer refused to complete, and performed a lat minute cancel/rollback at the end of the install.

While the fail dialog was up, I used Sysinterals procmon (another rockin tool, by the way) to find out the installer wrote some temp files that happened to be "msi" (Microsoft installer packages). I copied the msi files and opened with 7zip, which allowed me to extract the atmel isp software. This worked in this case becasue there were no critical scripts run by the installer other that to install ftdi drivers, which I already had installed.


Wednesday, April 18, 2012

Bench PSU: AVR JTag update #2 (it's alive!)

I think I figured out the noise issue on my ATmega setup.

After I posted my ATDH1150 teardown yesterday, I got to thinking about the "JTAG-X" port on the device:

It's a 2x7 JTAG port that looks to be wired to the same lines as the 2x5 "JTAG-A", except that one of the two rows is almost, if not all, connected to GND. I'd seen this done other ribbon cable type connections, but I never really thought much about why this was done. The effect of it is to make every other wire in the ribbon a GND line. I'm probably butchering terminology here, but I think this is a form of shielding. It helps to reduce electromagnetic interference, or cross-talk(is that the right term?) between the signal lines.

My experiments so far with my AVR Dragon-breadboard setup lead me to strongly suspect that noise was the culprit, and contrary to my initial intuition, many types of noise can become more of  problem with higher voltages.

Tuesday, April 17, 2012

ATDH1150USB mini tear down.

Last month I mentioned the ATDH1150USB Atmel CPLD JTAG programmer, and my efforts to home-brew my own programmer based on some ancient code I found on Atmel's website.

The escalating level of effort required to make my own programmer outweighed the $45 it cost to just buy the Atmel programmer. Slightly annoying, since I already own an Atmel branded JTAG device, the AVR Dragon.

There's scant information on the web about the 1150, unlike it's popular Altera cousin the "USB Blaster".

Here's the hardware that came in the box:

Box contents: mini USB cable, a loooong (I estimate 18") 2x5 JTAG ribbon cable,
and a 6" 'JTAG-X" 

The first thing I did was immediately void my warranty(does this thing even have one? I have no idea, I'm guessing that the folks at Atmel would be laid back if I ever ran into issues, this isn't a consumer device. )

Bench PSU: AVR JTag update

I did some more experimenting with my AVR Dragon JTAG woes today, despite not really having the time (I was supposed to file my taxes, but thanks to the District of Columbia, I get one more day. Why put off until tomorrow what you could easily do the day after tomorrow?

To summarize my last post:

ATmega 644 in a breadboard, JTAG functionality only seems to work reliably when powered at 3.3V vs 5V.

I was a little distraught that I had to spend time with dumb issues like this, and not on to cooler stuff. In building this power supply though, I'm sure that I'm going to face a lot of noise issues. I felt dumb.

Well, I'm an Engineer, and what do Engineers do when they feel dumb? They get empirical. Hypothesize, Measure, Test, Rinse, Repeat. Through process of elimination, I knew I could come up with a list of things that were not the cause of my problems. I made a list of random notes as I tried various things that might show a different behavior.

Monday, April 16, 2012

AVR JTAG programming oddities

I recently launched a new project, I'm working on a bench power supply. I've wanted to do the "old ATX PC PSU to bench power supply" thing for a while, and there was a recent series on the EEVBLOG whose design I'm taking a lot of inspiration from. (That David Jones is a freakin' genius). I want to have a little more "kapow" than his design, 0-9 V, 3 channels. I don't know if that's a folly on my part, but time will tell.

I finished up the "thinking a lot about it" phase, where I watch TV and daydream about what I want to do, and I moved into the prototype/experiment/pre-design phase.

I'm going to use an ATmega 644 as the main MCU to drive my logic. I'm wavering between that and the ATmega 328, but I just think the 328 probably doesn't have enough pins.

I've thrown together a few lines of code for doing the LCD display logic, using a "HD4478x" library for AVR's I found on the internet(I'll wait until my project is farther along before giving credit, since I might swap it out or roll my own in the end).

I went to test on a breadboard tonight and I discovered something very perplexing that I've not run into before...

Thursday, April 5, 2012

Wifi Links.

I haven't made any progress on the Wifi project lately. I've been on a pseudo-vacation for the past week.

In case you've landed here from Google with an interest in the MRF24WB0MA Wifi board from Microchip, I've got  few interesting projects I've run across you may find interesting.

"Jeff", trying(unsuccessfully?) to get the board working with an Arduino:

"Manis B", got a webserver running on an Arduino with the board:
(Also, really nice, pragmatic setup with connecting the pads, made me realize my mount was overkill - but fun)

"Blondihacks", did extensive experimentation with the board with an Atmega 168:
(Also, a fantastically done write-up, even though she deems it "a failed experiment")

And last but not least, one for my favorite blogs, Dangerous Prototypes, recently posted about a MCW1001A chip that is a companion to the MRF24WB0 boards that implements the TCP stack for you and communicates via UART: