Feeling stupid

My first “real” project is now getting closer to completion. So I shifted from self etched board to having the board manufactured by a board house. Including placement and soldering of the SMD parts. 5 boards for ~700 Euros.

Really cool to see my first project so far. It is really a thrill to learn Eagle and design for months and then see the finished product. So I felt very excited when the boards arrived.

But then …

… all boards 0.2mm to wide. No big deal → sand them down.
… one 3 pin connector “overlaps” with the display. No big deal either → clip it close to the surface and fiddle a little bit with the soldering iron.

… 3 outputs consistently fail to work as designed on all 5 boards.
Arrrgghhhhh. 700 Euros down the drain …???
But I have some spare pins and already put strategically placed break out vias for just his case. But I would not fall back to them unless I understand what is really wrong.

So I start to search what is wrong. Looks as if the driver transistors are always powered. Hmmm. Measuring the voltage gives something around 0.6V. Consistently for all failed boards. Hmmm. Maybe the software is flawed. But: the same software was used on the self etched board. Worked “fine” with this board.

OK, so I was searching for 3 days in a row. Then I start precision measurements trying to figure out the location of the short. Nothing. Then I start to try different loads to figure out the impedance. Something between 2k and 4k. WTF has 0.6V @2-4k ???

Still confused. Looked at the schematic the 20th time or so. And suddenly I got it.
All affected pins are on port C. Lookup alternate functions of Port C for Atmega644. Arghhhhh. By default JTAG is enabled.

Fix the fuses → all 5 boards work fine.

But wait: my homebrew board had some shorts as well. I always attributed them to me soldering SMD with a 2mm tip. Which pins where affected??? Port C only?
Hmm. How are the fuses → JTAG enabled…

Lessons learned:

  1. if it is neither a software bug nor a hardware bug it may be the fuses.
  2. Always disable JTAG if you do not need it.
  3. Make no assumption about any fuses. Always set all fuses to the values that you would expect IMMEDIATELY.

Udo

Nothing to feel stupid about. The Arduino platform isolates newcomers from even having to know that fuses exist let alone what their functions are and when and when not one might change them. I suspect that the topic is one that fits the "little knowledge is a dangerous thing' pretty well. Thanks for sharing your experience.

Lefty

Whoa 700 euros, most of that must have been the board loading I guess. I feel for you when you thought you'd blown it, I know that feeling all too well :)

Good to see it's now working.

BTW, what is the project?


Rob

Including placement and soldering of the SMD parts. 5 boards for ~700 Euros.

Whoa 700 euros, most of that must have been the board loading I guess.

Yeah that's pretty expensive but getting small quantities of boards manufactured and populated can be very expensive.

I'd also be interested to know what the project is/perhaps see one of the boards but I suspect it may be for a commercial venture (judging by the board price) and we may not get to see it 8)

With regard to the boards and their function. Yes, it may be for a commercial venture. I have not yet decided what I will do with it. So I will not yet tell about what it is.

IP is almost completely under my control. That is: no Arduino hardware or software anymore. To be more precise: all libraries but the avr-libc completely re-implemented. Completely different approach on most stuff. A total of >10 000 Locs, including C, Assembler and some "tiny" pieces of forth. Completely own designed hardware. Two Controllers (Mega 644 + Tiny 25V), 1 step up converter and 1 LiIon Charger. "Mostly" ESD hardened. Explicitly designed to be "hackable".

Started as my "Beginner" Project about 1.5 yeards ago on Arduino. When I saw the commercial price tags I started to figure if I can do just as well. By now I have learned a lot about controllers and electronics design. The goal is to have 5 prototypes up and running this year and to do "real" end user testing. If it all goes well I might be able to launch this in 2012. Although 2011 would be much better.

In the end it is about learning to create a complete product from scratch including the tiny company to sell it. The goal being mainly a learning experience. Hence I will put parts or all of it into the open source community - but only after the launch.

The tougher learning experience will be to actually put up and run a tiny a company. I already figured that there are some pretty tough market entry barriers.

So far I have put something between 500 and 1000h of work into it and >5000 Euros in hardware/measurement equipment. I still consider this a pretty cheap price tag compared to what I have learned so far ;)

Udo

Finally the first of the 5 boards finished 95% of the hardware testing. The charger test still running. I am especially happy with the “power switch”. The Atiny25 is dedicated to the power switch. That is the board is always connected, the “power” button just wakes up the Atiny25 “power controller”. The power controller will then enable the switching regulator and thus power up everything. I already posted the software for this part here: http://www.mikrocontroller.net/topic/183673.

The “off” state power consumption of the whole contraption is <2µA. The design goal was to stay <10µA :slight_smile: The power controller alone consumes ~0.5µA, the other~1µA is the shutdown current of all other chips combined. The “on” state consumption of the power controller is ~0.5µA, the active state consumption about 214µA. But this will never last for longer than 1s.

I could have done this with only one controller but I wanted to ensure that powering down can always be enforced no matter if the main controller should hang or not.

Udo

Very intriguing Udo, can't wait to hear more about this.


Rob

Hey, you make me feel stupid. What is a fuse? What tag? I'm not pretending on the jtag thing. :fearful:

“fuses” are bits you can set in the AVR processor to enable/disable certain features. For example if you clear the SPIEN fuse you can no longer program the chip using ISP (in systen programing).

JTAG is a system for debugging that uses 4 of the processor pins. If it is enabled by accident as it seems Udo did (JTAGEN fuse?) you can no longer use those pins for normal IO.

It’s these fuses that sometimes cause a chip to become “bricked”, meaning that it cannot be reprogrammed. The only way out of this is to use high-voltage programming whereby you apply 12v to the reset pin.


Rob

Along these lines, I would love to use the JTAG port on an Atmel for actual debugging. i did some searching here and learned that the JTAG fuses are off by default, but didn't find much more than that. Does anyone know how I can use JTAG to debug code that is actually running on the CPU?

Thanks Graynomad. I am very clear now. Before tonight I only knew a brown-out fuse so I was pretending I didn't know any fuse :blush:

I have a JTAG ICE Mk2 but so far have only used it for programming. However as I understand it you need the appropriate debugging hardware, ie JTAGICE, Dragon or AVR ONE and AVR Studio.

In Studio you select the debugger you want to use (so far I've only used the simulator) and then you can set breakpoints, single step etc.


Rob

Thanks Rob, is it source level debugging (so I can step through the actual C/C++ code) or is it assembly level?

.... Well, I didn't know of that TYPE of fuse, I know more about like fuses as far as industrial/commercial/residential stuff goes

Both, I've stepped through C and ASM code (with projects written in C or ASM). It may also be possible to step through the ASM of a C program (not that you ever probably would want to), certainly you can easily view the expanded assembly generated by the compiler.


Rob

Rob do you use JTAG exclusively under Windows or did you ever do this with Linux? If so - how is this done?

Just Windoze I'm afraid, but for programming I just use AVRdude so I assume that works under UNIX. Presumably Studio is required for debugging.

BTW, I've just posted details about one of my current projects

http://arduino.cc/forum/index.php/topic,53829.0.html

We used some of the same keywords so let me know if I'm doing something too close to your board :)


Rob

Cool - but not even close ;) There are already some open projects out there that are more than close to what I am doing. I might even port one of the open solutions to my board so that there will be immediately a choice to run it open or closed :)

Udo

Udo,

could you tell me the company that made the boards for you? Could you give a bit more info on that? Like you gave them only the blueprints, or did you also give them the components? For 140 euro each board they must have done everything from scratch right??

P.S. Good luck with the product!

The company is http://www.pcb-pool.com/. I gave them my eagle files. I had them order most of the SMD parts and place them. I provided two special SMD parts that they did not have to order. I hand soldered the TTH parts (display, switches, connectors).

Worked much better than expected and was pretty easy following their guidelines. The quality is very good. All mistakes are due to mistakes that I made in the eagle files.

Udo