Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 29th May 2004, 08:05 PM   (permalink)
Default Re: How to test?

Quote:
Originally Posted by km
Quote:
Originally Posted by Nigel Goodwin
Basically you need to generate data for different waveshapes, a sinewave is the obvious first choice, and you can generate that from the Sin() function included in most high level languages.
What you mean by generate data for different waveshapes? Is it means that find the most suitable number of samples for different types of waveshape? The waveforms that I need to generate is it a function in the programing part, for example: y=sin(x) and from here I test different number of samples on it?

All the test is it mainly on the programming part only :?:

What others waveshape I need to generate? (analogue waveforms)
Yes, different analogue wave shapes, obviously a sinewave is probably the first one to test (as it's a common wave shape and easy to generate), you should also test square waves (again, easily generated), triangle waves (still easy), sawtooth waves (easy again) - then more complicated waves, the sort of wave shapes you get in the real world, a note from a guitar, or a trumpet, a voice etc.

For the 'real world' type samples you would probably find it easiest digitising a sample in Windows, and using data from the WAV file. Or you could simply plot analogue wave shapes manually.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 30th May 2004, 06:15 PM   (permalink)
km
Default -

Quote:
Originally Posted by Nigel Goodwin
Yes, different analogue wave shapes, obviously a sinewave is probably the first one to test (as it's a common wave shape and easy to generate), you should also test square waves (again, easily generated), triangle waves (still easy), sawtooth waves (easy again) - then more complicated waves, the sort of wave shapes you get in the real world, a note from a guitar, or a trumpet, a voice etc.
Thanks Nigel :wink:
Is square waves also consider as an analogue waveform too :?:
For my project, is it necessary to test a more complicated waves like what you had mentioned:a note from a guitar, or a trumpet, a voice etc?

I thought that my project is only use to measure electric signal? :?
km is offline   Reply With Quote
Old 30th May 2004, 07:09 PM   (permalink)
Default Re: -

[quote="km"]
Quote:
Originally Posted by Nigel Goodwin
Is square waves also consider as an analogue waveform too :?:
For my project, is it necessary to test a more complicated waves like what you had mentioned:a note from a guitar, or a trumpet, a voice etc?

I thought that my project is only use to measure electric signal? :?
Test what you need to, a square wave is an analogue signal, although it could also be considered a digital signal as well. As for measuring electrical signals, any kind of waveform in an electrical circuit is an electrical signal - what sort of electrical signals had you in mind?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 30th May 2004, 08:36 PM   (permalink)
km
Default -

Quote:
Originally Posted by Nigel Goodwin
As for measuring electrical signals, any kind of waveform in an electrical circuit is an electrical signal - what sort of electrical signals had you in mind?.
At first, I thought that it would be only sinewave that I need to consider. Well, I think I'm wrong now. Actually, I don't really get it why I need to test for a more complicated waves as well? Do I really need to measure those you have said for my project? eg: a note from a guitar, trumpet, and a voice. :roll: OR is it just only a test to determine the number of samples for different types of waveform?
km is offline   Reply With Quote
Old 30th May 2004, 09:22 PM   (permalink)
Default Re: -

Quote:
Originally Posted by km
At first, I thought that it would be only sinewave that I need to consider. Well, I think I'm wrong now. Actually, I don't really get it why I need to test for a more complicated waves as well? Do I really need to measure those you have said for my project? eg: a note from a guitar, trumpet, and a voice. :roll: OR is it just only a test to determine the number of samples for different types of waveform?
Your requirement was to display RMS values for the incoming data, if your incoming data is always a sinewave you can do so very, very simply, a normal cheap analogue or digital meter will do that - both types just read the sinewave directly, and simply scale it to read RMS - BUT THIS ONLY WORKS FOR THE EXACT WAVE IT WAS CALIBRATED FOR!.

If you want to read RMS values for differing waveshapes it's a lot more complicated, you need to calculated the RMS value, and if you don't test it with differing waveshapes how do you know if it works or not?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 31st May 2004, 08:57 AM   (permalink)
km
Default -

Quote:
Originally Posted by Nigel Goodwin
If you want to read RMS values for differing waveshapes it's a lot more complicated, you need to calculated the RMS value, and if you don't test it with differing waveshapes how do you know if it works or not?.
Thanks for your advice!! Nigel :wink: I have the idea now.
After I had done the test for different waveshapes, how can I apply it to my project? (Since there are different values of sample for different waveshapes) :idea:
km is offline   Reply With Quote
Old 31st May 2004, 05:26 PM   (permalink)
Default Re: -

Quote:
Originally Posted by km
Thanks for your advice!! Nigel :wink: I have the idea now.
After I had done the test for different waveshapes, how can I apply it to my project? (Since there are different values of sample for different waveshapes) :idea:
You simply use the tried and tested maths routines that you used on the PC, knowing full well that they work and give correct RMS readings for any waveshape you happen to feed it. The waveshape you monitor with your PIC design then doesn't matter, it will be correct for any waveshape - as an RMS routine has to be.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 6th June 2004, 07:11 AM   (permalink)
km
Default Question

Quote:
Originally Posted by Nigel Goodwin
You simply use the tried and tested maths routines that you used on the PC, knowing full well that they work and give correct RMS readings for any waveshape you happen to feed it.
hmm, I don't really get what you mean, Nigel. :roll: You asked me to simply use the tried and tested maths routines on the PC to confirm that it gives correct readings for any waveshape. Is it test on the programming part by feed in different values?(in the code that i write for different waveshapes :?: )

Quote:
Originally Posted by Nigel Goodwin
The waveshape you monitor with your PIC design then doesn't matter, it will be correct for any waveshape - as an RMS routine has to be.
What about peak-to-peak, frequency, average and duty cycle routines? The results will be correct also?
km is offline   Reply With Quote
Old 6th June 2004, 07:25 AM   (permalink)
Default Re: Question

Quote:
Originally Posted by km
Quote:
Originally Posted by Nigel Goodwin
You simply use the tried and tested maths routines that you used on the PC, knowing full well that they work and give correct RMS readings for any waveshape you happen to feed it.
hmm, I don't really get what you mean, Nigel. :roll: You asked me to simply use the tried and tested maths routines on the PC to confirm that it gives correct readings for any waveshape. Is it test on the programming part by feed in different values?(in the code that i write for different waveshapes :?: )
No, you need to write code that works with any waveshape, if you have to write different code for different shapes your routine isn't working. RMS means Root Mean Square, and gives the same heating effect as the same DC voltage - so 230V DC fed to a heater works the same as 230V RMS, the waveshape doesn't matter, it still contains the same amount of energy.

Quote:
Quote:
Originally Posted by Nigel Goodwin
The waveshape you monitor with your PIC design then doesn't matter, it will be correct for any waveshape - as an RMS routine has to be.
What about peak-to-peak, frequency, average and duty cycle routines? The results will be correct also?
You need to write different routines for them, they are totally different things - but RMS is the hard one!.

Have a look at http://www.epemag.wimborne.co.uk under downloads and PIC's, they have done various projects over the years, including scope type designs. "Micro PICScope" uses an LCD and a PIC16F877 to give a simple scope, it also calculates frequency and P-P, it could be worth looking at. They also did a PIC based scope that connects to the PC parallel port, the PC software (written in BASIC) could be worth a look.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 6th June 2004, 08:27 AM   (permalink)
km
Default Question

Quote:
Originally Posted by Nigel Goodwin
No, you need to write code that works with any waveshape, if you have to write different code for different shapes your routine isn't working....
:arrow:
You need to write different routines for them, they are totally different things - but RMS is the hard one!.
All the codes (for different waveshapes) & routines should write in a single program correct?

Thanks for your information, Nigel!! :wink: I have already seen it earlier. For the PICScope, can I use the code for my peak-to-peak and frequency calculations? Do you know the rating of the MICRO-PIC Scope?
km is offline   Reply With Quote
Old 6th June 2004, 01:09 PM   (permalink)
Default Re: Question

Quote:
Originally Posted by km
Thanks for your information, Nigel!! :wink: I have already seen it earlier. For the PICScope, can I use the code for my peak-to-peak and frequency calculations? Do you know the rating of the MICRO-PIC Scope?
I see no reason why you can't use the routines, design your project round a similar scheme.

The rating of the MICRO-PICScope isn't really given, it just specifies "basically audio", but it does give 17KHz as the highest frequency, limited by the sampling rate.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 9th June 2004, 07:47 AM   (permalink)
km
Default PIC Programmer

Hi Nigel, I have something to ask you. My college programmer doesn't support PIC 16F628. Do I need to buy a programmer :?: OR build one :?:
km is offline   Reply With Quote
Old 9th June 2004, 08:05 AM   (permalink)
Default Re: PIC Programmer

Quote:
Originally Posted by km
Hi Nigel, I have something to ask you. My college programmer doesn't support PIC 16F628. Do I need to buy a programmer :?: OR build one :?:
You could do either, the P16PRO40 is available very cheaply as a kit, hardly worth sourcing the components yourself.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 12th June 2004, 12:34 PM   (permalink)
km
Default -

Quote:
Originally Posted by Nigel Goodwin
An obvious easy value (for an 8 bit processor) would be 256 samples, but you don't have anywhere to store them in a 16F84.
After I have determined how many samples I need, how can I know my PIC has sufficient memory to store the samples?
km is offline   Reply With Quote
Old 12th June 2004, 12:42 PM   (permalink)
Exo
Default

goto the mirochip flash pic selection guide and search a pic with enough RAM

http://www.microchip.com/ParamChartS...g=en&pageId=74

keep in mind that you need more ram then you need to store samples. Your code requires some ram to run also (to store counters, temporary values,...)
Exo is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 10:52 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.