ATXMEGA32A4U ADC periodic noise

Go To Last Post
76 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

Now Scope the output

Where's the output?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My impression that the "output" is the audio system in the USB master.

 

But, this raises a suggestion. Output the data to a port and observe it with a 8-wide logic analyzer. OR, feed that data into an 8-bit parallel input DAC and observe it as an actual audio signal.

 

I lay about 40% odds on USB, and 50% odds on the analog conversion process (this encompasses power supply, reference, input signal, and ADC). That leaves 10% for programming, MCU timing, and acts of divine retribution.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks JC,

 

But some facts about my board.

 

1. it is a peripheral device which is connected to a PC via USB cable.

2. The power supply of my device is get form USB port. 

3. data is captured from ADC channels and send to PC via USB out endpoints.

4. data is sent from PC to device and is played on DAC channels via USB in endpoints.

5. The only way that I can see the output of ADC channels is to get them in PC and use an editor software like Audacity to see it. 

6. Thus if I use a battery then how I can transfer data to PC?

7. By using a median filter, the quality of captured ADC signals are better.

8. noise happens in a periodic way and I guess it is from USB transactions with PC.

9. when I discard USB write transactions from PC side and just read ADC samples, the duration of noise decreases which gives me a clue that USB transactions may be in charge .

10. as decoupling capacitors are away from power pins of Xmega micro controller, I am afraid if urgent current can not be feed to micro Controller when USB transactions are in progress and those noises happens.

 

Thanks

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can intercept (e.g. break the circuit) the power from the USB connector and provide power to that point via battery or an adjustable clean power power supply.

 

Jim

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mehrdad_58 wrote:

10. as decoupling capacitors are away from power pins of Xmega micro controller, I am afraid if urgent current can not be feed to micro Controller when USB transactions are in progress and those noises happens.

 

 

I don't think you understand the purpose of decoupling caps.

I'd be guessing pcb layout is a possible culprit. But you've not shown us this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks guys.

I have learnt how fix a bug from the discussion.  

শূন্য  - The ZeRo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try using another USB port on the host.  Try using another host computer.

 

If there is a periodic 1.6 second pulse on VCC, you might be able to see that on your scope.

 

If you can put the result of the ADC out on an Xmega pin, you could disconnect from the host.

 

The numbers you get from the ADC should be much higher during the periodic noise.  You could look at the numbers.  When the numbers are low, set a digital output pin low.  When the numbers are high, set the digital pin high.  Look at that pin with with a scope or even a DMM to see if the 1.6 second pulse is there when not using the USB.  

 

You could also export the ADC result on an analog pin by using the DAC.  Look at that pin when not using the USB.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't think you understand the purpose of decoupling caps.

I'd be guessing pcb layout is a possible culprit. But you've not shown us this.

 

Let me show a picture from PCB part of my design.

 

 

Those 2 white circles are decoupling capacitors that was designed to be placed near VCC and GND

pins of micro controller. 

There are 2 other ones that is not in this shot and are far far far away wink laugh

 

The board is a 2 layer one.

 

Apparent that micro controller is that 44 pin TQFP in the center of picture.

 

 

Last Edited: Sun. Sep 22, 2019 - 03:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could also export the ADC result on an analog pin by using the DAC.  Look at that pin when not using the USB.

 

 

Above sentence is one the most professional sentences that I have heard yet. wink

 

Thanks steve17, You prove that you are very professional. 

 

Before this, I always think of my board as a Black box,  Now you open some windows on the walls of it. 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mehrdad_58 wrote:

Those 2 white circles are decoupling capacitors that was designed to be placed near VCC and GND

pins of micro controller. 

Ouch. I think I see a massive ground loop. The GND pins on the micro all come together under the chip, but then the only connection I see is by a blue track to the left and then it disappears in the upper left corner. Presumably it loops all the way around the PCB, and then come back down to the decoupling cap on the right side.

If that is so, then your GND connection is more like a H-field antenna that can pick up all sorts of noise from the surrounding circuitry.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mehrdad_58 wrote:
Let me show a picture from PCB part of my design.

This is crazy.
cryingno

Sorry for my English.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I’d throw that pcb in the bin. The power routing is suspect at best. It could be the regulator oscillating occasionally. Showing us a small part of the pcb is not going to be too conclusive as the problem is probably not in the area you’ve shown.
Tell your pcb guy that putting vias in the middle of pads is not a good idea. Nor is doing copper fills that aren’t tied to a ground plane.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems that PCB is not good. 

 

Please give me some hints about routing signals and power and ground.

 

I collected more that 10 changes till now. 

 

Please give me some hints to apply in next step, Please remember that the board is a 2 layer one.

 

I need some design patterns for PCB.

 

 

 

Thanks

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

We’ve got nowhere near enough information. If you want to learn, there’s plenty of tutorials on line. It helps if you understand basic electronics as the pcb is a critical component - not just an interconnect.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I developed this board to be a pilot one and I would like to get as much as possible knowledge from it. 

 

Now that we know the design of PCB is not OK, I would like to apply some changes to it by using some wire soldering and component montage. 

 

I have following ideas:

 

1. Solder a through hole decoupling cap between each VCC and GND pins of micro controller.  (VCC and GND pins in XMega are near each other).

2. solder 4 wire between GND pins of micro controller and some GND pins in different points of board to break current loop. 

 

I do above things because I would like to learn as much as possible from current situation. 

 

 

Please give me any other ideas which may help 

 

Thank you.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Don’t waste your time. The problems can’t be fixed by cutting tracks and adding bits of wire.
Get the design right first. Getting pcbs made is fairly cheap.
Having components on both sides makes assembly expensive. It is usually cheaper to go to a four layer pcb with components on one side only

Last Edited: Mon. Sep 23, 2019 - 12:40 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mehrdad_58 wrote:
Please give me some hints about routing signals and power and ground

Pretty sure Atmel Microchip have App Notes on that.

 

The principles of good grounding, analogue/digital supply separation/isolation, etc are pretty general - not specific to AVR.

So general tutorials on mixed-signal PCB design should help ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

(page 13 for "4.7. PCB Layout and Grounding")

Chapter 4.6 is also worth a closer look (Power Supply, Power Routing, and Decoupling Capacitors)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I do not know how to say thank you. 

 

Now I have some documents to proceed. 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mehrdad_58 wrote:
Please give me some hints about routing signals and power and ground.

Here is a simple project on ATXMEGA32A4U.
I do not like this pcb.
But she is better than the one you showed.
The analog part is not used in this project.

Sorry for my English.

Attachment(s): 

Last Edited: Mon. Sep 23, 2019 - 05:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

agentXMEGA wrote:
I do not like this pcb.
You do what you have to do.

Some don't like jumpers or zero ohm resistors as jumpers though the 1-layer PCB of old have some tinned jumper wires.

A PCBA manufacturer might have a jumper machine.

XMEGA32A4U pin 35 is RESET with a trace that has some susceptibility; not an issue if the PCBA is inside its own metal or metallized enclosure that has complete, precise, and correct shielding.

Inside a chassis, above a few megahertz, the references (grounds) will be relative to each; if that's an issue, there are simple solutions.

agentXMEGA wrote:
Sorry for my English.
Please don't be; an Anglophone can be patient.

Thank you for your post.

 


What are the specific PCB/PCBA process reviews?-NOD Electronics

[3/4 page]

5. Jumper on the printed circuit board.

...

https://en.wiktionary.org/wiki/susceptibility

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks friends for you kind support 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are some important lessons here, and more lessons to be learned.

 

1) You have found that your board needs improvement, and some suggestions about what to do. That may be a necessary change, but it MIGHT not be sufficient. How can we say that? Well, partially because there has yet been no way to determine the source of the noise. It MIGHT still be software or something in the USB system or even your desktop hardware and software. Nobody can tell. Yet. Or, it might be that the board upgrade solves it all. You will never know until you try.

 

2) These problems are hard to track down. Really hard. it tends to be a war of attrition rather than a pitched battle followed by a victory celebration. Its just the way the universe works.

 

3) Because it is hard, you have lots of ideas about how to solve. Which one is the solution? Maybe none, maybe one not yet suggested. We can't know. We might never know.

 

4) Suggestion: post the schematic and the layout (with modest component detail where it is not obvious) before you send it out to your board house. You are bound to get some comments. Some of those might even be useful :) This could save you a subsequent board rev or several. 

 

Good luck

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Jim, 

 

 

 

Pages