Last week I was discussing a board I designed to do development (hardware and software) of the Atmel ATTiny10 microprocessor. I had gotten the board built and was ready to write some software in assembler (my favorite way of writing programs next to writing them in Forth). So I wrote a very simple program that just turned on the internal pull-up resistors on three of the pins. The listing has some extraneous html tags and is kinda truncated but it gives you the basic ideas. There is not much there.
So I fired up Atmel Studio 6 and checked out the device. According to the programmer the device has 5.0 volts on it. According to my uncalibrated meter the power supply reads 4.95 volts. Close enough.
The program assembled with no errors (after a few tries) and so I tried to program the chip. No luck. I got an error code. Plus I could not read the device ID. After trying this quite a few times with the same results I thought I'd better e-mail the experts at Atmel for some help. After some initial missteps on my part (I got the programmer name wrong) we were discussing the schematic and the FAE thought I needed a pull-up on the Reset Pin (pin 6 - PB3). Well there is a pull-up on the pin, R9, a 100K resistor. So I asked the FAE what the value should be. And I'm waiting a day. Then two. Then three. Nothing.
In the meantime a friend of mine and I were discussing the problem. I had designed the board with page 26 of the users guide in mind. It gives the minimum values any given pin can be loaded with. I was well above those minimums. We both thought - wouldn't it be a hoot if the .1uF capacitors I used for partial debounce and ESD protection (to slow the rise time of any ESD pulses from the switches) was causing the problem. I wanted to write up the board for this week's column so I thought - I'll build a board without most of the components and switches making particularly sure to leave off those capacitors.
While I was in the process of completing that build, I gave the local FAE, John Corral, a call. He had my schematic at hand (I'd sent it to him earlier) in seconds (faster than I did) and we discussed the likely problem. We both agreed that even though the design met the published specifications, that the capacitors were the likely culprit. He said he didn't have the required components at hand to do a test and I said no problem. "Let me support you." I told him I would get back to him in a couple of hours. I finished the board and powered it up and what do you know? It worked. And I would have had the information back to him in roughly the time frame I had promised except Yahoo mail was down. The wonders of modern technology.
John also promised to send me a higher-powered programmer for evaluation. Needless to say, I will evaluate it when it gets here.
In any case, I was most amused that such a simple circuit could find a problem that had not been seen before in the entire time the chip has been in production. I do have a reputation as a troublemaker, so maybe that explains it.
I did ask John to find out what size capacitor would work in the circuit so I didn't have to change my designs - I have boards in hand for a prototype of a device I want to go into production with. I'm looking forward to finding out what Atmel learns on that score.
M. Simon's e-mail can be found on the sidebar at Space-Time Productions.