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

2MHz sine waveform using AD9833 and PIC18F4580
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
syamin0712



Joined: 23 Aug 2015
Posts: 14

View user's profile Send private message

PostPosted: Tue Aug 25, 2015 12:43 pm     Reply with quote

Firstly, does it mean the signal generally is correct by using MODE 2? I am right?

Quote:
amplifier seems to be showing very significant overshoot, that is making it worse.... 

The result i got was the original result from the output pin of AD9833 without using any amplifier circuit yet.

Quote:
your scope probe compensation recently?.

What do you mean by this statement?

Quote:

connect the OUTPUT pin to ground via a 220 ohm resistor


May i know why i should connect to the 220 ohm since this ic AD9833 already has internal load 220 ohm?
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Aug 25, 2015 1:06 pm     Reply with quote

my work with the the part( which i use in several different products )-- led me to believe the 200 ohm value you cite is actually a source impedance. and at frequencies below 100khz made no special difference other than cutting the 200 mv RMS to 100 mv.

however at frequencies above a megahertz i found spectral purity was
very much reduced without it.
https://upload.wikimedia.org/wikipedia/commons/e/e7/1hzto1Mhz_sinewave.JPG
Above is a module with performance from 1 hz to 768khz in 1 hz steps ,
1.00 V RMS with better than .3db flatness, and DC output guaranteed to be less than 1 mv ( due to DC servo) at better than -56db total RMS spurious content. no terminating resistor needed.
the residue is primarily 3rd harmonic energy.

R5, C6 , R8 are added when operation above 1 mhz is required.

my biz partner has used several thousand of these with great happiness.
ANYWAY.....
Try using the external terminator
AND
also try grounding your scope to the PCB common ground and not using the tip -ground clip.


i'd feel a lot more certain of your problem if you showed a PHOTO with the details of your actual hardware under test.

showing how you connect your scope lead too ideally.
syamin0712



Joined: 23 Aug 2015
Posts: 14

View user's profile Send private message

PostPosted: Tue Aug 25, 2015 9:11 pm     Reply with quote

Quote:
i'd feel a lot more certain of your problem if you showed a PHOTO with the details of your actual hardware under test.

showing how you connect your scope lead too ideally.


I attached the link for your further reference.

http://obrazki.elektroda.pl/4676712600_1440557641.png
http://obrazki.elektroda.pl/3076281100_1440557646.jpg
http://obrazki.elektroda.pl/1377368900_1440557649.jpg

Information on jumper for hardware configuration:
Red jumper--- +5V
Black -----------ground
White --------- oscillator
blue ---------- SDATA
yellow ------- SCLK
oren -------- FSYNC
green -------- output connect to probe

For your information I just used the burner SK40C that I bought at the nearest shop for my PIC, solder the AD9833 using PCB which I bought from element14 and using brade board for my circuit testing because the circuit is not confirm yet.

I think this is happened due to the high frequency because when I just apply 20KHz the signal looked very smooth without the ripple with the configuration circuit that I have now.
So, i think the coding is absolutely right just maybe the configuration of the circuit for high frequency appplication.

I'm also tried to put the 2200 ohm as suggested but its only cut the rms value but the shape of the signal is still same.

Is there any configuration circuit for high frequency (MHz) for AD9833 that I can use?
Ttelmah



Joined: 11 Mar 2010
Posts: 19256

View user's profile Send private message

PostPosted: Tue Aug 25, 2015 11:24 pm     Reply with quote

My comment about the scope probe, is this.
Every oscilloscope probe has to be compensated to match the scope it is being used on. There is a setup procedure on the scope, and a test source built into the scope. You attach the probe to a pin on the scope producing a nice square wave (it is normally a pin on the front of the scope). Set the time-base and amplitude to specific levels for the calibration (scope manual), and adjust the trimmer capacitor on the side of the probe to get a nice waveform without overshoot or rounding.
This is a standard part of using a scope, and unless it is done, the scope will generate smoothing or overshoot on the waveform.

You need to be grounding the scope to the chip under test, especially with your wiring.
syamin0712



Joined: 23 Aug 2015
Posts: 14

View user's profile Send private message

PostPosted: Tue Aug 25, 2015 11:41 pm     Reply with quote

Hi Ttelmah,

Quote:
Every oscilloscope probe has to be compensated to match the scope it is being used on. There is a setup procedure on the scope, and a test source built into the scope. You attach the probe to a pin on the scope producing a nice square wave (it is normally a pin on the front of the scope). Set the time-base and amplitude to specific levels for the calibration (scope manual), and adjust the trimmer capacitor on the side of the probe to get a nice waveform without overshoot or rounding.


Yes, I always do the probe calibration by doing same as what you said every time before measure the output from my circuits to make sure that the standard square wave is nice.

Also, yes one side of the probe I connected to the Vout pin and another pin of the probe I connected to the ground of the circuit.

I think I know how to solve the signal that I faced right now which is by connect the capacitor at the Vout pin to the ground so that it becomes as the coupling cap. It is because when I adding around 0.1nF, the signal becomes better compared to the signal before added that cap. But, I still have to try and error to know what is the best value of cap that I should use.
Ttelmah



Joined: 11 Mar 2010
Posts: 19256

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 12:26 am     Reply with quote

I said the ground of the chip under test, not the circuit.

Point is that there is likely to be noise between the chip, and your master ground 'point' when working at high frequency.
syamin0712



Joined: 23 Aug 2015
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 1:08 am     Reply with quote

Quote:
I said the ground of the chip under test, not the circuit


My chip, master and circuit share the same ground. So. Thats why i pin the probe only at one point coz the ground is same.


Quote:
Point is that there is likely to be noise between the chip, and your master ground 'point' when working at high frequency.


Do you mean i have to check every single point that connecting between the chip and pic?
Ttelmah



Joined: 11 Mar 2010
Posts: 19256

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 1:55 am     Reply with quote

No, you are missing the point slightly.

Just because you have two pins connected together, does not make them the same signal!...

When dealing with things switching at speed, there _will_ be noticeable signals, between points that are connected together. You need to actually make a connection directly adjacent to the pin of the chip you are testing.
This is why on HF boards, there are often multiple test point grounds round the board. One close to each major section of the circuit.
Try the experiment of turning the scope gain up a little, and touching the probe to different points on the same 'ground' signal round your board. Be prepared for just how much signal there may be at places.
syamin0712



Joined: 23 Aug 2015
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 3:46 am     Reply with quote

Quote:
Try the experiment of turning the scope gain up a little, and touching the probe to different points on the same 'ground' signal round your board. Be prepared for just how much signal there may be at places.


I think I get your point. use +ve probe at the output but the -ve probe of scope is connected at the ground point but at different ground location each. is it correct?

Coz when I pin the -ve probe of scope to the ground that closed to my output point..yup the signal becomes better BUT not for the farthest ground pin location.

SO, what I have to do to get the nice sine wave form signal?please advice Crying or Very sad
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Aug 26, 2015 7:19 am     Reply with quote

Quote:
, what I have to do to get the nice sine wave form signal


MAKE A REAL CIRCUIT BOARD WITH GROUND PLANES AND STAR GROUNDING. YOUR BREADBOARD IS A BIG PROBLEM.

20mhz and plug boards don't mix
syamin0712



Joined: 23 Aug 2015
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 7:49 am     Reply with quote

Quote:
20mhz and plug boards don't mix


Do you mean i have to use two 20 MHz separately? One at osc of PIC and another one at MCLK of AD9833?
Ttelmah



Joined: 11 Mar 2010
Posts: 19256

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 10:36 am     Reply with quote

No. The point is that high frequencies and breadboards, are a pretty sure formula for problems. You need a proper board with ground plane, and then very careful decoupling, and careful _layout_. Look carefully at the chips. Work out where the high frequency pins are, then position the chips on the board, so that things like high speed clocks are positioned away from the analog stuff. Even with a ground plane, you need also to ensure that paths from digital stuff back to the supply, do not cross the analog sections.

This is the classic sort of problem that just needs some actual practice, experiment and experience.

There is a lot of guidance online:
<www.ti.com/lit/ml/slyp173/slyp173.pdf>
<http://electronics.stackexchange.com/questions/5223/what-to-think-about-when-designing-hf-pcbs>
<http://www.maximintegrated.com/en/app-notes/index.mvp/id/5100>

The last in particular links to a really superb lot of guidance.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Aug 26, 2015 3:56 pm     Reply with quote

summary:

the waveform in
http://obrazki.elektroda.pl/7927611700_1440496782.png

shows roughly the right fundamental frequency and amplitude from the Ad9833 , once you ignore the awful analog waveform.

All your remaining issues center on not understanding
the importance of correct layout procedure and how to deal with the ANALOG and power supply aspects of the design you copied for the AD9833.

This is a PIC forum - not an mixed signals design forum.

You are driving way ahead of your ability in the analog field
and you need to connect with somebody who can do a proper layout for a circuit board for you. all the talk in the world won't get you ahead i fear.

BTW - connecting the digital controls for the AD9833 (RE2 RC3 RC5 ) through 47 to 56 ohm resistors is a good idea to prevent glitching if the part is more than a few inches from the PIC .
syamin0712



Joined: 23 Aug 2015
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 4:02 pm     Reply with quote

Ok. Thank you very much for the advice and the help.
Really appreciate it.
I will look detail on it Smile
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
Page 2 of 2

 
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