显示标签为“pcb design”的博文。显示所有博文
显示标签为“pcb design”的博文。显示所有博文

2016年2月24日星期三

PCB design considerations


不可忽视的电路设计的八个盲点
盲点一:对于设计要求不高的板子用细线自动分布
自动布线必然要占用更大的PCB面积,同时产生比手动布线多好多倍的过孔,在批量很大的产品中,PCB厂家降价所考虑的因素除了商务因素外,就是线宽和过孔数量,它们分别影响到PCB的成品率和钻头的消耗数量,节约了供应商的成本,也就给降价找到了理由。

盲点二:总线信号都用电阻拉一下
信号需要上下拉的原因很多,但也不是个个都要拉。上下拉电阻拉一个单纯的输入信号,电流也就几十微安以下,但拉一个被驱动了的信号,其电流将达毫安级,现在的系统常常是地址数据各32位,可能还有244/245隔离后的总线及其它信号,都上拉的话,几瓦的功耗就耗在这些电阻上了。

盲点三:CPU和FPGA的这些不用的I/O口让它先空着
不用的I/O口如果悬空的话,受外界的一点点干扰就可能成为反复振荡的输入信号了,而MOS器件的功耗基本取决于门电路的翻转次数。如果把它上拉的话,每个引脚也会有微安级的电流,所以最好的办法是设成输出(当然外面不能接其它有驱动的信号)

盲点四:FPGA还剩这么多门用不完,可尽情发挥
FGPA的功耗与被使用的触发器数量及其翻转次数成正比,所以同一型号的FPGA在不同电路不同时刻的功耗可能相差100倍。尽量减少高速翻转的触发器数量是降低FPGA功耗的根本方法。

盲点五:小芯片的功耗都很低不用考虑
对于内部不太复杂的芯片功耗是很难确定的,它主要由引脚上的电流确定,一个ABT16244,没有负载的话耗电大概不到1毫安,但它的指标是每个脚可驱动60毫安的负载(如匹配几十欧姆的电阻),即满负荷的功耗最大可达60*16=960mA,当然只是电源电流这么大,热量都落到负载身上了。

盲点六:存储器多控制信号,板子只需要用OE和WE信号就可以,片选接地,这样读操作时数据出来得快多了
大部分存储器的功耗在片选有效时(不论OE和WE如何)将比片选无效时大100倍以上,所以应尽可能使用CS来控制芯片,并且在满足其它要求的情况下尽可能缩短片选脉冲的宽度。

盲点七:信号过冲只要匹配好就可以消除
除了少数特定信号外(如100BASE-T、CML),都是有过冲的,只要不是很大,并不一定都需要匹配,即使匹配也并非要匹配得最好。象 TTL的输出阻抗不到50欧姆,有的甚至20欧姆,如果也用这么大的匹配电阻的话,那电流就非常大了,功耗是无法接受的,另外信号幅度也将小得不能用,再说一般信号在输出高电平和输出低电平时的输出阻抗并不相同,也没办法做到完全匹配。所以对TTL、LVDS、422等信号的匹配只要做到过冲可以接受即可。

盲点八:降低功耗都是硬件人员的事,与软件没关系
硬件只是搭个舞台,唱戏的却是软件,总线上几乎每一个芯片的访问、每一个信号的翻转差不多都由软件控制的,如果软件能减少外存的访问次数、及时响应中断及其它争对具体单板的特定措施,都将对降低功耗作出很大的贡献。




Baggio WANG FAN
SHENZHEN JAAPSON TECHNOLOGY CO LTD
skype: baggiowang0214
JAAPSON, Expert in HDI Multi-layer PCB Manufacturing

2016年1月10日星期日

PCB Engineer: Top 6 PCB Design Mistakes

Let's face it. We all make mistakes, and PCB designers are no exception. And contrary to popular belief, making mistakes is ok, as long as we learn from them. Here is a quick summary of some common PCB mistakes. 

Choose the wrong PCB design software

Confucius said, “A man who does not plan long ahead will find trouble at his door.” This applies to PCB design too. One of the first steps to successful PCB design is to choose the right tools. There are many powerful and easy-to-use electronic design automation (EDA) software packages available for PCB designers today. Each one has its own unique capabilities, advantages and limitations. You should also be mindful that no software is infallible, so issues such as component footprint mismatch can and do occur. Although there may not be a single tool that meets all of your needs, you should do your homework to find the best fit for your requirements. In my previous post, I did a research about which PCB design software is better, there are many different answers, but you can take them as reference.

Poor communication with designer and/or manufacturer


Even though out-sourcing of PCB design is becoming more common, and is often more cost-effective, it might not be the ideal solution for highly complex PCB designs where performance and reliability are key. As the complexity of designs increase, the face-to-face time between the engineer and PCB designer to ensure precise component placement and routing in real-time becomes very important and can help to eliminate costly rework later. 

It is equally important to engage the PCB board manufacturer early on in the design process. They can provide initial feedback on your design to maximize efficiencies based upon their processes and procedures that will save you time and money in the long run. By making them aware of your design objectives and involving them in the early stages of PCB layout, you can avoid any potential problems long before going into production and shorten time-to-market.


Failure to test early prototypes

Prototype boards allow you to prove that your design works according to your original specifications. Prototype testing allows you to validate the functionality and quality of the PCB and its performance before it is mass-produced. Successful prototype testing requires a good deal of time and experience, but by starting with a robust test plan and a clear set of objectives evaluation time can be decreased, and the likelihood of production-related mistakes reduced. If any issues are found during prototype testing, a second iteration of tests on a reconfigured board will need to be performed. By including high-risk elements early in the design process, you will be able to benefit from multiple iterations of testing and identify any potential issues early on, reducing risks and ensuring project deadlines are met.


Using inefficient layout techniques or incorrect components


The demand for smaller and faster devices requires PCB designers to layout complex designs in significantly reduced footprints using smaller components that must be placed closer together. Making use of technologies such as embedded discrete devices on inner PCB layers or smaller pin pitch ball grid array (BGA) packages will help to reduce the board size, improve performance and leave room for rework when issues are encountered. When working with components that have higher pin count and smaller pitch, it is important to select the right board layout technique in the design stage to avoid problems later on and minimize fabrication costs.  

Also be sure to carefully study the range value and performance characteristics of any substitute components that you plan to use, even those that are labeled as drop-in replacements. A slight variation in the characteristics of the substitute component may be enough to throw off the performance of your entire design.


Forgetting to back up your work


Back up your important data. Need I say more? At a minimum, you should backup your most important work and other files that would be difficult to replace. Even though most companies perform daily backups of all corporate data, this might not be the case in some smaller companies or if you do work from home. With backing up to The Cloud so easily accessible and cheap these days, there is no excuse not to backup your data where it is safe from theft, fire, and other local disasters.


Becoming a one man island


In my early days as a programmer, I remember thinking that we spent way too much time in code design reviews. But I have to admit that looking back now they really were a very important part of the process, just as they are with PCB designs. While you may think your design is flawless, and that making mistakes is simply not your style, often times your peers will find something in your design that you overlooked. Sometimes, even though you know the intricate details of the design, someone less intimate with it can be more impartial and provide valuable insight. Holding regular design reviews with your peers can help detect unforeseen issues and keep your project on track and within budget. 


How about you? Have you made some PCB design mistakes in the past that have made you a better designer today? Feel free to comment and provide a few more mistakes of your own so that others can learn from them too.




Baggio WANG FAN
SHENZHEN JAAPSON TECHNOLOGY CO LTD
baggio@jaapson-pcb.com  
www.jaapsonpcb.com
skype: baggiowang0214
JAAPSON, Expert in HDI Multi-layer PCB Manufacturing

2016年1月4日星期一

Debug approaches and technology development

Although embedded software developers would like to think that they spend the bulk of their time designing software and coding it, that is not the case. Almost everyone actually spends more time getting the code to function correctly - a process that we call "debugging". Different people have different ideas about what debugging actually entails and, with the advent of multicore designs, new challenges are presented. This article reviews debug approaches and technology and considers what is likely in the future.


What do you do?
If you met someone in a bar, say, and you got talking, they are likely to ask what you do. You will probably reply that you are an embedded software developer. If they carry on talking with you, they might ask you what that job entails and you would probably answer with something about designing software and writing C/C++ code. Of course, that is not really the case. Most embedded software developers spend the bulk of their time debugging.


This does beg the question: what does debugging actually mean? The answer is less simple than you might expect.


Debugging by hand: debug in the past
Many years ago, when computers were big and expensive, there were no debugging tools that we would recognize today. Frankly, programmers made fewer errors. One reason for this was that time on the computer was precious, so the programmer would write the code down on paper first, thinking it through very thoroughly. They would very carefully proof read to avoid syntax errors, as just one slip could waste a computer run. Then they would think through the operation of the code, dry running it on paper to check the logic. Eventually, this carefully scrutinized code would be submitted to the computer. After the run, the results would be studied and, if an error was detected, the code would be modified to include extra printf() (or equivalent) lines to show how values were changing. By using conditional compilation, "debug" and "production" versions of code could be compiled.

So, why not take this approach when writing embedded software today? The first part - writing the code on paper and thinking a lot - might be a very good practice. However, the ready access to computers that cost almost nothing has moved us away from such an approach. The practice of adding printf() calls to log values is still amazingly common, despite it being quite problematic for embedded applications. 


There are five key issues:

1. Most implementations of printf() are quite large. The function needs to address a very wide range of formatting situations and that takes a lot of code. This does not matter in a desktop software context, but memory is rarely in abundance in an embedded system.

2. There is the question of where the output of printf() actually goes. Many embedded systems have nothing that looks like a "console" and directing output back to a host computer can be challenging.

3. In a multi-threading context - i.e. when using an RTOS - reentrancy is a concern. If two threads try to use printf() at the same time, confusion can result.

4. Every time you want to change the variables you are looking at, a complete rebuild and download of the code is required.

5. Lastly, of course, formatting and sending the output (somewhere) takes time. If it is a real time application, this overhead can introduce problems.


A real debugger: Debug today
So, for most systems, using printf() as a debug tool is not viable and the use of a “real” debugger makes more sense. Debuggers are available from a wide variety of suppliers of embedded software development tools and can take a number of different forms, largely characterized by how/where the code gets to execute:








Simulation – It can be useful to start debugging before target hardware is available. One approach to achieving that is to use some form of simulation. This term covers a broad spectrum of technologies, which may include native execution of code on the host computer and instruction set simulation.


Virtual prototype – A step on from simulation is the use of a virtual prototype. A number of vendors offer tools whereby code may be executed and interact with a detailed simulation of the real target hardware at a number of possible levels of abstraction.


Network connection – If a target system is networked, this may be a good way to interface a debugger. However, it does demand fully working target hardware, functional network driver software and some kind of target “debug agent” software.


JTAG – Many embedded CPUs support the provision of a JTAG port and its inclusion has a minimal impact on system design. Debuggers that support a JTAG connection are widely available.


For many developers, the simplest solution is the last one listed – attach a debugger to a target system or an evaluation board using JTAG. This can give ready access to all the target data and addresses the five problems with printf()debugging thus:

1. There is no extra code on the target.
2. Data is displayed on the host computer without effort.
3. The debugger needs to be task-aware, but that is well understood.
4. Code only needs to be rebuilt to fix bugs.
5. A JTAG connection is slightly intrusive in the time domain, but the impact is typically quite small.



Debugging in the future – multicore and beyond
Debugging has always been challenging, as the manifestation of bugs can be very subtle. This became harder with the widespread use of multi-threaded code, but debugger suppliers responded well to the needs of developers. Many tools allow task-specific breakpoints and feature the option to stop the entire system or just the task of interest. However, this “stop and stare” approach becomes almost non-viable with a multicore system, which may also feature multiple operating systems and CPU architectures.

Going forward, it is likely that sophisticated tracing and analysis tools (such as Sourcery Analyzer from Mentor Graphics) will address the needs of developers of multicore systems, particularly with AMP (Asymmetric Multi-Processing) architectures. Although a tiny amount of code instrumentation is required, this has minimal impact. The large volumes of logged data can be analyzed to yield a clear picture of a system’s state and behavior in the lead up to an observed bug.






Baggio WANG FAN
SHENZHEN JAAPSON TECHNOLOGY CO LTD
baggio@jaapson-pcb.com  
www.jaapsonpcb.com
skype: baggiowang0214
JAAPSON, Expert in HDI Multi-layer PCB Manufacturing

2015年12月29日星期二

How to Develop Your Tech Product in 5 steps

With the world obsessed with technology, innovation and disruption, many entrepreneurs are trying to develop ideas and services in this space. But often, it can be a bit daunting.

Have no fear. While developing your own tech product may seem overwhelming, it is achievable -- even for non-techie entrepreneurs.

You just need to break it down into steps. 







1. Clearly define your product and goals.
Create a document specifying all of the details for your product including features, functions, size and target retail price, to name just a few.

Keep in mind, this phase, product development, is a balancing act between pushing new limits and making compromises.  As with life, you can’t have everything. 

For example, when developing wearable tech products small size may be your highest priority, meaning that other specifications such as performance and battery life will need to be compromised.  The most common compromise is usually in regards to cost – and this sort of give and take occurs at startups and big corporations.



One of the more famous product compromises was the decision by Steve Jobs to eliminate dedicated keyboards on portable devices.  At that time, other product designers insisted it was essential to have a physical keyboard. But Jobs felt that appearance and larger screen size were more important than a real keyboard.  That compromise proved to be a wise decision that changed the very nature of portable devices.







2. Hire an electrical engineer to design the electronics
An electrical engineer will first select all of the components (microchips, displays, sensors, etc.) based on the features and specifications in your product definition.  Don’t be surprised if some of those compromises are necessary at this step.  After all of the components are selected the engineer will then connect everything together in an abstract blueprint-like diagram called a schematic circuit.  Depending on the design the engineer may also run computer simulations to confirm functionality.    

Next, a Printed Circuit Board (PCB) layout will be generated based on the schematic circuit.  The PCB is the board that contains and connects all of the electronic components. Whether your product is a tracking device, a Bluetooth headset, or a new type of smartphone, the electronics will be placed on a PCB. 


3. Produce the prototypes
Your electronics engineer will now send the PCB design files to a prototype shop to make a few units for testing.  Electronics prototyping can be broken into two steps: making the PCB itself, and attaching the components.  Each step requires completely different expertise and equipment, so two separate vendors are commonly required.





4. Evaluate, program and debug
After you receive the assembled boards, now it’s time to make them work.  I usually like to perform an evaluation of all the non-programmed parts of the design first, such as the power management section and oscillators. Then I move on to programming.

Any problems found with the electronics during programming will need to be fixed on the next PCB version.  The hope of course is there will be no problems, but in reality that never happens.

As a design engineer for a big-tech company I witnessed countless products being developed, and never once was the first version the final version.  This is always the case when developing something new and non-trivial.  You need to plan on it taking multiple revisions to get your product ready for market.


5.  Develop the case
This step should really be performed in parallel with the development of the electronics.  If appearance is critical for your product, then you need to hire a talented industrial designer to make your product look really amazing.

As with the electronics, it will take several iterations for you to get a custom case ready for market.  Development of the case is also complicated because different technologies are used for prototypes (3D printers) and production (injection molding).  If appearance isn’t a high priority, you might consider using a stock case, at least initially.

Never strive for perfection when developing your product.  You want to get it on the market as soon as possible so you can gather sales feedback.  Most likely, you’ll need design revisions incorporating what you learn from your initial sales before going to full production.  Only after pleasing the market have you truly developed a winning product.




(this article was contributed by Mr.John Teel)



Baggio WANG FAN
SHENZHEN JAAPSON TECHNOLOGY CO LTD
baggio@jaapson-pcb.com  
www.jaapsonpcb.com
skype: baggiowang0214
JAAPSON, Expert in HDI Multi-layer PCB Manufacturing

2015年12月28日星期一

Hardware Engineer: How to solve your problems?

When the Gantt charts are drawn up at the beginning of a project, perhaps the hardest part for the hardware engineer to estimate is the debug phase of a product development. It is also one of the most ignored sections in planning. 



CAD tools have progressed over the years in terms of ease of use and integration into PCB and mechanical. But ultimately, the design work is carried out by a person who is not only fallible, but may also be working with incomplete or incorrect data. Some bugs are inevitable on all but the simplest designs and so the art of troubleshooting these bugs is all-important.


Bugs can range from something going BANG the first time power is applied to intermittent glitches reported in association with completely unrelated things like “it was raining” or “it only happens on his bench, not on mine”. Consequently the ease of fixing bugs similarly ranges from a five-minute job to months of work.


Debugging can be the most fun part of electronics design when it is going well. There is a great of satisfaction in finding and fixing the intractable bugs. But to succeed, it is important to be systematic in the approach taken to fixing bugs.


In this article are listed the steps needed to bring such a systems approach to troubleshooting hardware in product development. To illustrate these principles, I will refer back occasionally to work I performed years ago as a junior engineer on a system that was used for monitoring sixteen analog audio inputs at the same time. It looked something like Figure 1 below:

Figure 1: Monitoring sixteen analog audio inputs at the same time


The system consisted of a multichannel ADC board, with the digital audio signal passing through an FPGA that multiplexed it onto a DSP bus. The DSP received interrupts telling it that when data was ready, it was to read and store that data. The FPGA logic was entirely asynchronous.
Occasionally, the DSP would stop receiving interrupts and the whole system would grind to a halt. This could happen days apart, or in a matter of just minutes. Software bugs had been eliminated as the cause, so this looked like a hardware bug and I was asked to investigate.


Step 1: Picture success 
An important part of debugging is having the right mental attitude, as persistent problems can grind down your morale. In particular, it feels bad going to work two days in succession with the investigation stuck at exactly the same point. In such a case, ask yourself “Will I still be working on this bug in a year’s time?” The answer: Of course not! This bug isn’t forever, it’s going to be fixed. It’s not that there’s no solution, it’s that I simply haven’t seen it yet.



Step 2: Keep notes
Resist the temptation to dive straight in trying to fix the bug immediately. But it is important to determine first if others have dealt successfully with a similar problem. Collect reports from multiple sources, even though they may sometimes have conflicting data attached. A spreadsheet can work well here to organize what you find.



Step 3: Reproduce the problem
This is often the hardest and most time-consuming part. The frequency that bugs show themselves varies enormously. So at this point, based on the information you have collected, you need to create the conditions by which you can make the bug happen at your command.
At this point diagnosis can begin. The initial bug report may be “It stopped working”, “It crashed”, or other equally vague reports. Keep working until you have all the information you can get from the one who reported the problem and also have enough to narrow down the range of possible causes.
Don’t worry about or speculate on the cause, just focus on reproducing the bug. Be careful at this point. Sometimes, similar but different issues can appear to be caused by the same bug, with one masking the other. If other bugs are uncovered while looking for the initial bug, make a note of them and go back to them later, but don’t get side-tracked.
In the example shown in Figure 1, the bug was extremely sporadic, so the first part of the exercise was to write software that exercised the system vigorously, sampling at the maximum rate This reduced the time between failures and made analysis easier.


Step 4: Gather the evidence
Be methodical and document what you see and what happens. Don’t theorize at this point about causes, just create a table of what aggravates or alleviates the bug as well what as has no effect. Be aware that multiple bugs can have the same symptoms, which can produce contradictory evidence.






Step 5: Try the easy stuff first
So you can reproduce the problem, look for the easy explanations first. For instance, are the connectors wired back-to-front? Are the chip pin-outs as per the data sheet? Are clocks running at the correct frequency? Very often, bugs are caused by mistakes that look dumb only in hindsight.
Remember when you did the design work, you had probably thousands of small decisions to make; most of these were correct. If the error proves to be “obvious” you can correct it and skip to step 9.





Step 6: Break the problem down
SPONSOR VIDEO, MOUSEOVER FOR SOUND
So now the easy things have been checked out. You can reproduce the problem, but perhaps only occasionally, or there are conflicting messages. It is important to remember that In complex systems, multiple bugs can show the same symptoms on the surface, but require different cures.
To help clarify the issue, eliminate as much of the system as possible that doesn’t appear to be relevant to the bug. For instance, you could power down devices on the PCB that are unrelated, or unplug cables to other boards. Do this while retesting. If the bug suddenly stops when an unrelated module is taken out of the equation, you have a smoking gun. Document it. Try to reproduce the bug again, with the module and then again without it.
In the DSP system described earlier (Figure 1), the only symptom was that the interrupts from the FPGA sometimes just stopped coming in. We wrote a simple program that just thrashed the system, reading from the interrupt status registers at the highest rate possible with the sample rate as high as possible, but without any other accesses to other parts of the system.
The frequency of the bug dramatically increased and a bug in the FPGA was found, relating to the system reading the interrupt status register at the same time as a new interrupt arrived. We fixed the issue and put the board on for a 24-hour soak test. After 23¾ hours, the bunting was up and we were starting to push the champagne corks out of the bottles….then it crashed again.


Step 7: Talk it over with a colleague
When dealing with what seem to be intractable bugs, just talking it over with someone else can often help, even when that person is from a different engineering discipline. Explaining what you see to another can be all that is required for you to see the bug from a different point of view and realize a crucial fact. At the very least you may come up with inconsistencies that need ironing out or receive suggestions of other things to try.
This conversation is best had away from the action. Go through exactly what the evidence is, one bit at a time, then look for what other experiments or investigations can be carried out. Then go back to the board and carry on.
In my example, we had a meeting with the office hardware guru and ran through the system, drawing it all up on a white board. Looking at how the FPGA logic worked in action, he suggested there might be a meta-stability issue in the FPGA. 





Step 8: Apply the fix
You understand the bug and have come up with a rational solution. You run the code and the problem appears to be solved. However, your job isn’t over yet.

Step 9: Try to break it again
Try to break the system again. To be sure you succeeded you will need to put the system through an appropriate series of stress tests an order of magnitude beyond that of the original implementation.
For instance, if a real-time system such as the one above, crashed every ten minutes and never lasted longer than an hour, but now runs for ten hours, the bug is almost certainly fixed.
You may find that the system behaves better, but still crashes. But at this point you may have discovered a new bug that had been masked by the previous bug. You need to treat it as such and go back to step one, creating a fresh investigation on the “cured” system.
Happily, in my example, our resident guru was correct and a simple modification to the FPGA solved the problem. There had been two bugs with one symptom, one which resulted in crashes on a period of about five minutes, the other on a period of many hours (typically about five). The nearly 24 hours in our soak test turned out to be a fluke. We had finally reproduced, analysed, understood and fixed the problem.

Step 10: Remember ‘disappearing’ bugs are still there if you haven’t fixed them
Sometimes bugs just appear to go away by themselves. This can be frustrating, but you can be sure that you haven’t fixed the bug. Either the initial report was incorrect or the bug is still there. These are the sort of bugs that reappear when your boss, his boss, or a customer is present.
It can be tempting to lift up the carpet and sweep these bugs under it, but don’t. Perhaps document it and carry on looking into other issues as it may return by itself. Ultimately though, you need to go back and fix it at some point. So, more effort needs to be applied in aggravating the problem to reproduce the bug.




Baggio WANG FAN
SHENZHEN JAAPSON TECHNOLOGY CO LTD
baggio@jaapson-pcb.com  
www.jaapsonpcb.com
skype: baggiowang0214

JAAPSON, Expert in HDI Multi-layer PCB Manufacturing