Pages: [1] 2   Go Down
Author Topic: Feeling stupid  (Read 3583 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3470
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Check out my experiments http://blog.blinkenlight.net

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

Good to see it's now working.

BTW, what is the project?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Including placement and soldering of the SMD parts. 5 boards for ~700 Euros.
Quote
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  smiley-cool
Logged

0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3470
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink

Udo
« Last Edit: March 02, 2011, 01:14:39 pm by Udo Klein » Logged

Check out my experiments http://blog.blinkenlight.net

0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3470
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley 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
Logged

Check out my experiments http://blog.blinkenlight.net

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, you make me feel stupid. What is a fuse? What tag? I'm not pretending on the jtag thing. smiley-eek-blue
Logged


nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 3
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-red
Logged


nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 3
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Georgia, US
Offline Offline
Sr. Member
****
Karma: 5
Posts: 371
Arduino makes my head hurt :(
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: [1] 2   Go Up
Jump to: