| Author |
Message |
djalli
Joined: 10 Nov 2001 Posts: 887 Helped: 15 Location: 1600 Pennsylvania Avenue, Washington DC 20500
|
28 Nov 2003 20:50 Analyzing waveforms in Microcontrollers |
|
|
|
|
I have 0 experience in Microcontrollers. If I turn on my function generator and send a 100Hz, 5volts p-p CAN I analyze this waveform. Such as getting frequency, amplitude etc. using a microcontroller?
If possible point me to links where people have played, experimented with analog waveforms.
|
|
| Back to top |
|
 |
bobcat1
Joined: 10 Jul 2002 Posts: 1118 Helped: 48
|
29 Nov 2003 12:12 Re: Analyzing waveforms in Microcontrollers |
|
|
|
|
The answer is YES but it depend on the type of the controller used
If you need a controller to analyze signals it not the best soulation because to analyze signals (FFT for instance it's best to use a DSP chip )
But to day's you can use a low cost micro a one i can recomend is the 8051f23x
it's can work up to 20 mips (milyon instrucation per second)
and you can use it to analyze a signal using FFT or you can use the new motorola dsp f830 serias it's a combination of DSp and a micro controller
best
bobi
|
|
| Back to top |
|
 |
cancel
Joined: 27 May 2001 Posts: 286 Helped: 11
|
29 Nov 2003 12:26 |
|
|
|
|
hi .. you can find a lot of examples searching e.g. google ;0)
one of them : http://home.iprimus.com.au/wjmoore/pic/proj_spec2.html
depends on what you need .. e.g. avr can do up to 16mips, cygnal up to 100 mips ..
|
|
| Back to top |
|
 |
techie
Joined: 05 Feb 2002 Posts: 850 Helped: 43 Location: Pakistan
|
29 Nov 2003 17:18 |
|
|
|
|
| Micros are good at measuring low frequencies and can also be used to measure amplitude using an onboard or external ADC. What you require can be done but dont expect to get up and start doing it right away. As you said that you have no experience in using micros. So you need to learn to use them hardware and software wise. Start with simple applications before going on to difficult ones. Better get some starter kit and get going some LEDs and switches stuff before experimenting frequencies and waveforms.
|
|
| Back to top |
|
 |
djalli
Joined: 10 Nov 2001 Posts: 887 Helped: 15 Location: 1600 Pennsylvania Avenue, Washington DC 20500
|
30 Nov 2003 4:12 |
|
|
|
|
| techie wrote: |
| Micros are good at measuring low frequencies and can also be used to measure amplitude using an onboard or external ADC. What you require can be done but dont expect to get up and start doing it right away. As you said that you have no experience in using micros. So you need to learn to use them hardware and software wise. Start with simple applications before going on to difficult ones. Better get some starter kit and get going some LEDs and switches stuff before experimenting frequencies and waveforms. |
To all of you thank you. Yes it is true and it has been a great desire with me to work with microcontroller and as bobcat1 mentioned DSP chip are far better to do FFT.
I do not know where to start. Is any simulation package software? I know MPLAB should be one.
It is a long journey to learn these but it is best. Matlab has some toolkit for DSP chips? Is that relevant?
Anyhow many thanks!
|
|
| Back to top |
|
 |
sokrat
Joined: 23 Sep 2002 Posts: 371 Helped: 2 Location: EGYPT
|
30 Nov 2003 8:47 Re: Analyzing waveforms in Microcontrollers |
|
|
|
|
| djalli wrote: |
I have 0 experience in Microcontrollers. If I turn on my function generator and send a 100Hz, 5volts p-p CAN I analyze this waveform. Such as getting frequency, amplitude etc. using a microcontroller?
If possible point me to links where people have played, experimented with analog waveforms. |
Dear
I was detect dtmf signal using pic 16 f877 using FFT but first you must know what you want to from signal ... and what kind of signal you will receive sine square ..Etc
1- if signal square you can measure frequency direct from microcontroller
By using timer as external counter "assume you frequency is low frequency " if the frequency is high you can use external divider IC
2-if signal not square you can clip the peak and then measure the frequency
3- measure amplitude you can use ADC
NOTE:
if the signal is complex signal then you can use FFT
S KRAT
|
|
| Back to top |
|
 |
Google AdSense

|
30 Nov 2003 8:47 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
djalli
Joined: 10 Nov 2001 Posts: 887 Helped: 15 Location: 1600 Pennsylvania Avenue, Washington DC 20500
|
30 Nov 2003 10:44 Re: Analyzing waveforms in Microcontrollers |
|
|
|
|
| sokrat wrote: |
Dear
I was detect dtmf signal using pic 16 f877 using FFT but first you must know what you want to from signal ... and what kind of signal you will receive sine square ..Etc
1- if signal square you can measure frequency direct from microcontroller
By using timer as external counter "assume you frequency is low frequency " if the frequency is high you can use external divider IC
2-if signal not square you can clip the peak and then measure the frequency
3- measure amplitude you can use ADC
NOTE:
if the signal is complex signal then you can use FFT
S 8O KRAT |
Dear sokrat
What I want from a signal is frequency since it is important and as you mentioned amplitude I can use ADC.
I will analyze some complex signal some day let say: a random sinewave where first 10sec is 100Hz and the next 3seconds is 1Khz etc so on.
Never thought of using square waves. Good ide to experiment with. Thank you sokrat.
|
|
| Back to top |
|
 |
sokrat
Joined: 23 Sep 2002 Posts: 371 Helped: 2 Location: EGYPT
|
30 Nov 2003 12:44 Re: Analyzing waveforms in Microcontrollers |
|
|
|
|
ok ....
about frequency you can measure it using microcontroller but first you must convert this sin wave to square wave and then measure frequency using microcontroller but remember the frequency for input signal must not greater than the oscillator clock for microcontroller
S KRAT
|
|
| Back to top |
|
 |
Aoxomox
Joined: 18 Jul 2001 Posts: 90
|
30 Nov 2003 14:17 Re: Analyzing waveforms in Microcontrollers |
|
|
|
|
If you want to decode a FSK modulated signal you can use some analog prefilters that each detects one of the frequencies and the µC will only test which prefilter receives something.
Maybe you should describe what kind of signal you really want to work with and what is interesting for you.
The data acquisition path must be clear first to determin if it can be done with a µC, a DSP, or simple analog/digital hardware.
(24bit audio/video processing needs powerfull DSP, reading out a PWM coded signal from a temperature sensor can be done in very slow runing µC)
Additionally a µC has some features (PWM/Timers/interrupt inputs...) that if used in a wise way can allow the implementation of a high speed problem, that normally requires a DSP. In such cases it is even more important to exactly know the goal of your measurement application to decide what will be done in hard- and what in software.
I would suggest starting off with a program like LabView first to get some experience with the data acquisition and then, if it runs stable, port it to your µC. In LabView you can first generate some example signals and test your structure with real world signals better than you can do this in a µC without any debug possibilties.
Hope it helps
aOxOmOx
|
|
| Back to top |
|
 |
djalli
Joined: 10 Nov 2001 Posts: 887 Helped: 15 Location: 1600 Pennsylvania Avenue, Washington DC 20500
|
03 Dec 2003 22:09 Re: Analyzing waveforms in Microcontrollers |
|
|
|
|
Aoxomox thank you, I see what you hint.
Can I export LabView vi to a C code or anything else to I can port in uC?
I may like to experiment with DSP chips.
What is, is a real signal and I want to measure various frequencies. If the signal is human heartbeat, pre-recorded data, I must detect missing pulse so I know that heartbeat did not go in normal range. If heart stops that would be no signal which is easy to detect at least in Matlab.
thanks again.
|
|
| Back to top |
|
 |
ME
Joined: 14 Mar 2002 Posts: 1523 Helped: 13
|
04 Dec 2003 0:25 |
|
|
|
|
| You can generate C code in Matlab with Simulink and Real time toolbox to export to MCU or DSP.
|
|
| Back to top |
|
 |
gul hameed
Joined: 24 Nov 2003 Posts: 27
|
04 Dec 2003 19:23 matlab code |
|
|
|
|
| ME wrote: |
| You can generate C code in Matlab with Simulink and Real time toolbox to export to MCU or DSP. |
is there exampes available on net
plz tell me
ur thankfull gul hameed
|
|
| Back to top |
|
 |
djalli
Joined: 10 Nov 2001 Posts: 887 Helped: 15 Location: 1600 Pennsylvania Avenue, Washington DC 20500
|
04 Dec 2003 20:38 thank you! |
|
|
|
|
| ME wrote: |
| You can generate C code in Matlab with Simulink and Real time toolbox to export to MCU or DSP. |
ME thank you!
The code is going to be big though. There are Simulink toolboxes I have exactly for this purpose but let see.
|
|
| Back to top |
|
 |