CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Reconstruction Filter
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
viki2000



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

PostPosted: Fri Mar 24, 2017 11:03 am     Reply with quote

The source of the noise is clearly identified: SCL I2C clock, but the way it propagates to the output of the DAC is not clear for now.
Let’s assume I did not respect any of the rules mentioned by you, which I totally doubt (did you see my board https://goo.gl/yWIVQ9 ?), because is very simple circuit and if I take one by one your listed possible causes, then 90% do not belong to my particular simple test board and let’s assume Adafruit board is a cheap board that did not respect also the rules.
Microchip provides an evaluation board for MCP4725:
http://www.microchipdirect.com/ProductSearch.aspx?Keywords=MCP4725EV
http://www.digikey.com/product-detail/en/microchip-technology/MCP4725EV/MCP4725EV-ND/1874100
http://ww1.microchip.com/downloads/en/DeviceDoc/51669a.pdf
At the end of last pdf file there is also the PCB shown – you may check it out.
Microchip is the manufacturer, so we can assume they designed properly the evaluation board.
I can buy one such board, it is not so expensive.
I will only provide the I2C signals from my PIC microcontroller and the +5Vdc to that evaluation board.

What will you say if I can still detect the same noise at output of the DAC?
What are you gonna blame then?
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 7:37 am     Reply with quote

viki2000 wrote:
The source of the noise is clearly identified: SCL I2C clock, but the way it propagates to the output of the DAC is not clear for now.
Let’s assume I did not respect any of the rules mentioned by you, which I totally doubt (did you see my board https://goo.gl/yWIVQ9 ?), because is very simple circuit and if I take one by one your listed possible causes, then 90% do not belong to my particular simple test board and let’s assume Adafruit board is a cheap board that did not respect also the rules.
Microchip provides an evaluation board for MCP4725:
http://www.microchipdirect.com/ProductSearch.aspx?Keywords=MCP4725EV
http://www.digikey.com/product-detail/en/microchip-technology/MCP4725EV/MCP4725EV-ND/1874100
http://ww1.microchip.com/downloads/en/DeviceDoc/51669a.pdf
At the end of last pdf file there is also the PCB shown – you may check it out.
Microchip is the manufacturer, so we can assume they designed properly the evaluation board.
I can buy one such board, it is not so expensive.
I will only provide the I2C signals from my PIC microcontroller and the +5Vdc to that evaluation board.

What will you say if I can still detect the same noise at output of the DAC?
What are you gonna blame then?


Based on errata for every new chip they make, I would not assume that.
Also, are you sure your scope probe grounds are good?
_________________
David
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 8:25 am     Reply with quote

I had a 2nd look at your test board, then re read the datasheet. According to figure 2-15 output of the DAC is not accurate unless there is a 3K load.
It'd be interesting to see what difference that makes compared to the current unloaded opamp output.
Do any other PIC pins have the sclk on them ?
Also it is critical to scope the +5 at the DAC. It should not have ANY noise. Aside from altering the internal Vref, it is possible the noise will migrate within the silicon elsewhere.
Another possible source is the board not being clean. Any amount of flux residue can allow crosstalk to occour. Boards made with water based fluxes, I clean in the dishwasher, dried, tested, then conformal coated.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 8:26 am     Reply with quote

You'll still detect it. But a lot less. This is why I said '99%'. The chip itself exhibits some internal crosstalk. This is in the data sheet. However the amount you have is a couple of orders of magnitude above that in the chip.

Note how much worse the problem was on your original waveforms with the breadboard.

Good circuit design involves a lot of things. How much noise is on the supply rail?. Sample this on the second scope channel while sampling the waveform. How is this smoothed?. How is your supply actually connected to the chips?. Where is the scope ground connected, relative to the chip ground?. Note the comments that to meet the specification it requires separate analog and digital grounds. Note also that even with a properly designed board, if you don't route the grounds correctly, you can re-introduce the problem....
newguy



Joined: 24 Jun 2004
Posts: 1899

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 8:32 am     Reply with quote

viki2000 wrote:
The source of the noise is clearly identified: SCL I2C clock, but the way it propagates to the output of the DAC is not clear for now.
Let’s assume I did not respect any of the rules mentioned by you, which I totally doubt (did you see my board https://goo.gl/yWIVQ9 ?), because is very simple circuit and if I take one by one your listed possible causes, then 90% do not belong to my particular simple test board and let’s assume Adafruit board is a cheap board that did not respect also the rules.
Microchip provides an evaluation board for MCP4725:
http://www.microchipdirect.com/ProductSearch.aspx?Keywords=MCP4725EV
http://www.digikey.com/product-detail/en/microchip-technology/MCP4725EV/MCP4725EV-ND/1874100
http://ww1.microchip.com/downloads/en/DeviceDoc/51669a.pdf
At the end of last pdf file there is also the PCB shown – you may check it out.
Microchip is the manufacturer, so we can assume they designed properly the evaluation board.
I can buy one such board, it is not so expensive.
I will only provide the I2C signals from my PIC microcontroller and the +5Vdc to that evaluation board.

What will you say if I can still detect the same noise at output of the DAC?
What are you gonna blame then?


I have a purebred great dane. She has been spayed, but for the sake of argument, let's say that she is still "intact".

Purebred great dane + tryst with sneaky neighbour dog = "impure" progeny.

It's kind of the same thing with hardware and electrical noise. In my experience, 25 years and counting now, if you "mate" a well designed PCB with a "Heinz 57" bodge of poorly constructed components, the resulting progeny has the overall quality of the poor bit, not the good bit.

I did indeed have a look at what you've constructed prior to what I wrote before, and my comments still stand.
viki2000



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 10:54 am     Reply with quote

All right.
And for the moment to answer some of your questions:
- I have tried also with 3K resistor at output and no opamp – the same noise
- No other pins of the PIC have SLK on them
- The board is very clean. I used dedicated spray for PCB to clean it very well prior measurements.
- There is no noise on supply rail, I checked it the scope, it is a clean battery DC power supply. The entire circuit does not take more than 30mA. I could get rid of 5V 3-terminal stabilizer if you insist, but is not the cause of the problem in my view, and I could use a simple 5V Zener or just a voltage divider without any stabilizer. There is no noise coming from Dc power supply. If the noise is induced from SCL to power rail, that is another problem, but if I remember well, I could not detect it with the scope. I can double check that.
There is one thing that none of you said. I hear all the time that I must respect certain rules, which generally speaking I agree, but on my particular board, what would you change? What is wrong with my tracks and PCB? What would you change to my particular board?
Only telling that I must respect some general rules, without telling what exactly should I change on that simple particular board does not help.
I still believe is an internal problem of the MCP4725 and I will try to prove that.

I will do one more test for the sake of knowledge and for finding the cross talk cause of the problem.
Maybe it will take some weeks, but I will come back later to continue the discussion.
I will buy the ready-made development board from Microchip and perhaps Adafruit. In the same time I will buy some MAX5812 from Maxim and DAC121c081from Texas Instruments (both SOT23) and I will replace MCP4725 on my test board. I will publish here the results, maybe I will make also some photos and we will discuss afterwards. For the moment I have to focus on something else.
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 11:49 am     Reply with quote

Tracking down 'noise' in analog systems entails a lot of eliminations and with the great scopes these days a LOT easier than 40 years ago.
good news is you haven't seen sclk backfeeding into VDD as the culprit.

One simple test, physically ground the SCLK and SDAT to the DAC, measure the output. Any noise or is it a rock stable 2.500 volts (or 1/2 VDD)? You can try it with SCLK hi, then SDAT hi, both hi.

Have you got another DAC? I always buy 2 (or more) for R&D proof of concepts. One for raw prototyping, another for real world tests. Plus it's easy to oops-POOF a new device !

I'd still have a 3K load resistor on the DAC output. While not in the drawing that figure 2-15 does show a HUGE difference in performance based on load.

Are the clk and data lines real good square waves and within spec?

Hmm..does it also happen if you send the same value to the DAC?

Does it happen when you do NOT send a value to the DAC?

Like I said, it's a process of elimination, make a list, check them off, eventually you'll find the answer.
viki2000



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 12:14 pm     Reply with quote

I have tried 3 devices MCP4725. I have measured the noise at output with 3K resistor too, the clock and data I2C have nice square waveforms.
I think my list is easier. Swap MCP4725 with another brand DAC I2C same package SOT23, and second to test with a ready-made development board MCP4725.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sat Mar 25, 2017 3:07 pm     Reply with quote

Your 'board', shows the same problem that your breadboard has. Linear supply rails.

You need one entry point to the board for your supply. Then a line from this to the analog chip, a line to the PIC etc..

The supplies and grounds should all run back to the same point. Not run 'on' from one IC to the other.

Where the supply enters the board, have smoothing. Then run a Vdd line to the PIC, and smoothing there. To the analog chip, run a line via a small inductor to it's supply pin, and again smooth at this point.
viki2000



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 2:26 am     Reply with quote

I made short test, because you insisted on power rails, replacing the parallel rails of the power supply with non-parallel twisted pair connected on the same point and having beads ferrite on them.
I eliminated the SOT-23-6 to DIP adapter with a wire spider construction.
https://goo.gl/rvn8Ou
It is the same noise.
I know we can still blame the PCB and the oscilloscopes, probes, that’s why I will order what I said above: other DACs SOT-23-6 from Maxim and TI and some ready-made boards with MCP4725.
By the way, the ready-made board, the development board from Microchip, does not have the 100nF decoupling capacitor on it near the MCP4725 as the datasheet recommends, it seem I must added at the pins of the board:
http://ww1.microchip.com/downloads/en/DeviceDoc/51669a.pdf
I will not make and more test for the time being, until I will receive the new DACs and the ready-made boards.
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 4:11 am     Reply with quote

Some digital feedthrough such as you are seeing is more or less inevitable with DAC devices Crying or Very sad . See section 4.12 of the MCP4725 datasheet. The specs on noise and so on for the DAC will be measured in the quiescent state, i.e. its measured while the DAC is not being sent data, and the digital lines are stable. As such they represent what you can expect to see if the DAC is being used as a simple voltage source. I do not know if what you are seeing is consistent with the level of feedthrough specified for this device.

Also there is, again pretty much inevitable, some code change feed through, for example the considerable glitch when the code changes from just below half range to half range, when the most bits are changing at the same time.

These types of DACs are much more suited to intermittent changes, i.e. change and then leave for a long time, than to continuous changes such as you are trying to do. I would expect, though I've never tried any, audio DACs, i.e. DACs optimised for reproduction of digital audio, to be better in these respects as they are intended, and indeed from what I can remember, must be used with continuously changing signals.

I suspect that no matter how careful you are with layout etc., you will not be able to fully eliminate the digital feedthrough. You have to filter it out. To do that you need to make the digital bit rate as fast as you reasonably can, so that it is considerably above the update rate of the DAC, then implement filtering as we discussed before. Again, a SPI DAC would be better suited to this than the I2C type you're using as its easier to get much faster bitrates, and generally lower cost, though as I understand this is basically a one-off, that's not really that much of an issue in this case. There is one thing to watch for, and that's the higher your bitrate, the bigger, while shorter and higher frequency, your feedthrough is likely to be. A conscientious professional designer might well try various bitrates to find the best compromise between bitrate and noise.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 4:34 am     Reply with quote

I have to also raise another point. Why does it matter?.
Audio devices will commonly have a lot of noise above audio. Doesn't matter at all, since it is well above audio....
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 27, 2017 5:11 am     Reply with quote

Mr T's point is very valid. Going back to the OP, the 100Hz mentioned appears to be the 'power line' and any scope, even my 40 year old analog can see the source is NOT perfectly clean.
Without seeing the schematics of the device this 'generator' has to feed, the HF noise may not even matter.
As for how different mfrs designs PCBs, most go for 'economy' or 'just within spec' or 'make it fit OUR stuff', with no Real World testing. I do know first hand that PCB design, especially analog, IS challenging.
viki2000



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 4:28 am     Reply with quote

The prosecution would like to introduce new evidences: 4 new break boards, different make, all with MCP4725, different addresses and manufacture time.
The tests were done having as power supply the 9V battery + 3-terminal voltage regulator, if not otherwise specified a power adapter.
The I2C frequency was 400 KHz during oscilloscope screenshots, but tests with 100 kHz shown the same output noise signal. One resistor 4.7K was attached at the output of the DAC, but shown no difference.
The code was modified for each break board in terms of DAC address and SDA, SCL lines. I used I2C software because is easier to reprogram the PIC and assign new pins for I2C bus instead of hardware rewiring.
I have made a new small PCB with PIC16F1825 and an inline connector where all these 4 break-boards could be inserted. The PIC16F1825 was on socket, because was easier for reprogramming on another PCB. I did not want to add ICSP to the present small test PCB to avoid any other supposedly unwanted noise/signal and keep it as simple as possible.
Here are the photos with the break boards and the oscilloscope screenshots:
https://goo.gl/OnQXK0

The board Ebay #2 has shown the lowest noise at output.
Then the question arrived: is it due to the PCB layout or due to that particular MCP4725 chip?
Solution: swapping that chip with another new one from my set/pack of 10 pcs. MCP4725 that I used initially for all the tests that shown noise at output.
So I desoldered that chip from board Ebay #2 and I soldered it on a SOT-23-6 to DIP adapter and then installed it on my big PCB.
On the board Ebay #2 I installed another new MCP4725 and I remade the measurements:
https://goo.gl/whNniY

As you can all see, the board Ebay #2 with another new MCP472 has the same SCL noise at output.
In exchange, the particular MCP4725 (ID APTC) from board Ebay #2 shows even less noise on my big PCB. In fact it shows a very satisfying output signal. I would be happy if all MCP4725 would be like that, but they are not.
To notice that using a power adapter instead of battery, we see a bit more noise; probably a better power adapter, a voltage reference instead of voltage regulator will solve that problem too. But using the battery there is almost no noise at all.
With these being observed, I can definitely say:
- The SCL noise seen at output does not come from my power supply - the 9V battery + 3-terminal voltage regulator.
- The noise (SCL interference) is not due to my PCB and not due my oscilloscopes or their probes.
- The SCL noise at output comes from inside the MCP4725.
I declare MCP4725 a nasty little scumbag because it has stolen the money and the time and fail to deliver the promised/expected job.
As RF_Developer said:
Quote:
These types of DACs are much more suited to intermittent changes, i.e. change and then leave for a long time, than to continuous changes such as you are trying to do.

That is a nice excuse as a part of defense, but should be clear mentioned in the datasheet as a warning and is not.
In other words is not good to generate nice analog waves, unless are very slow or the noise does not bother, or we can use it to generate different fixed DC values, but not fast continuous changes as expected in many analog signals.
Of course I let the jury to reach the final verdict, as for myself, I will not use it anymore.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 4:39 am     Reply with quote

I still suspect you are generating a lot of the noise, in how you are testing.

Take a pair of resistors. Say 10K each. Connect them between your supply rails, and put your scope on the junction. Run the code.

How much noise is visible on this pin?.

The data sheet does give explicit data on the digital crosstalk. Data sheets are designed to give information. They are not expected to give 'warnings' about things that everybody knows will happen. They however should tell you 'how much', and the sheet does. Look at how much lower your noise it now than on the original signals with massive spikes. Those spikes were not expected. Digital noise is....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Page 6 of 8

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group