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 26th May 2004, 07:06 AM   (permalink)
km
Default Confirmation of my project

PART 1:

Quote:
Originally Posted by km
As for the low pass filter - RC circuits, is it acceptable for R=1000kΩ & C=1µF ? If it is not acceptable, can you please suggest suitable values for me? Is the resistor for the RC circuit has to be 1% resistor?

Quote:
Originally Posted by Nigel Goodwin
It all depends on how fast you are going to read the incoming signal, a simple resistor capacitor filter is probably not good enough, you should make the 2nd opamp into an active filter at about 1/5th of your sampling rate.
In that case, do I need to use a variable resistor for my active low pass filter design? (for the 2nd opamp)

PART 2:

Quote:
Originally Posted by Nigel Goodwin
Quote:
Using PIC 12F675 with a built in ADC is not allowed also.(since the condition clearly stated: No built-in ADC PIC allowed!!) I am planning to used TLC 548 A2D (8-bit resolution), is that good enough for my project
Should be fine, 8 bits is plenty.
For my project, do I need to built an extra circuit before feeding the A2D output to the PIC 16F628? Because the data from the A2D is going to be very difficult to analyze and I might have difficulty in obtaining the results (i.e. frequency, average, peak-to-peak).

As for the external A2D I used (TLC 548), from what Nigel had said:"it should be fine to use that". (But from what I heard, the accuracy required for such applications is critical) Am I able to get accurate results with the external A2D (TLC 548)? Should I consider another A2D chip? (maybe an A2D 10-bit resolution):?:

PS:I'm getting more worry about my project day by day as I only left 2 months to do my project :cry:
km is offline   Reply With Quote
Old 26th May 2004, 08:51 AM   (permalink)
Default Re: Confirmation of my project

Quote:
Originally Posted by km
In that case, do I need to use a variable resistor for my active low pass filter design? (for the 2nd opamp)
Only if you want to make it variable.

Quote:
PART 2:

For my project, do I need to built an extra circuit before feeding the A2D output to the PIC 16F628? Because the data from the A2D is going to be very difficult to analyze and I might have difficulty in obtaining the results (i.e. frequency, average, peak-to-peak).
No, the output from the A2D will feed directly into the PIC, you just need to write the software to control it.

Quote:
As for the external A2D I used (TLC 548), from what Nigel had said:"it should be fine to use that". (But from what I heard, the accuracy required for such applications is critical) Am I able to get accurate results with the external A2D (TLC 548)? Should I consider another A2D chip? (maybe an A2D 10-bit resolution):?:
As I see it you are going to have to perform considerable calculations on the incoming data - I would suggest you write a program on the PC to perform these calculations and feed it dummy data, that way you can confirm it works, and check what resolution will suffice. There's no point building hardware when you don't even know if it will be possible or not.

If you've only got two months to complete this, and you don't appear to have started work yet, I would suggest a lot of prayer might be in order :roll:
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 26th May 2004, 09:48 AM   (permalink)
km
Default

:shock: A lot of prayer? LOL :lol: Thanks for your advice!!

Quote:
Originally Posted by Nigel Goodwin
I would suggest you write a program on the PC to perform these calculations and feed it dummy data, that way you can confirm it works, and check what resolution will suffice.
How can I do that? What software do I need? :idea:
km is offline   Reply With Quote
Old 26th May 2004, 10:03 AM   (permalink)
Default

Quote:
Originally Posted by km
:shock: A lot of prayer? LOL :lol: Thanks for your advice!!

Quote:
Originally Posted by Nigel Goodwin
I would suggest you write a program on the PC to perform these calculations and feed it dummy data, that way you can confirm it works, and check what resolution will suffice.
How can I do that? What software do I need? :idea:
Write in whatever software you are experienced in, Delphi, BASIC, C, Pascal, Prolog, Java - any language you like, just to prove it works, and to test what resolution works best. I would expect this sort of pre-planning and testing to be part of your documentation, and it all helps towards good marks.

You also have the problem of how many samples you need to give a sufficiently accurate reading - this is further compounded by the lack of RAM in mid-range PIC's. 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. Again, you can use the PC to test different numbers of samples, to see how few you can get away with - and again, this should all be documented.

If you look on the PICList there's a project for performing FFT (Fast Fourier Transforms) using a PIC, but it uses a high end PIC, with lots more memory and more power.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 26th May 2004, 10:43 AM   (permalink)
km
Default Not PIC 16F84

Quote:
Originally Posted by Nigel Goodwin
You also have the problem of how many samples you need to give a sufficiently accurate reading - this is further compounded by the lack of RAM in mid-range PIC's. 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. Again, you can use the PC to test different numbers of samples, to see how few you can get away with - and again, this should all be documented.
I had changed my decision to use PIC 16F628 (It's your opinion 8) ). Will it has the same problem as what you have said?
km is offline   Reply With Quote
Old 26th May 2004, 10:47 AM   (permalink)
Exo
Default

Yes, 16f628 only has 224 byte of ram, still not enough (you're probabely need some of that for the rest of the software, not all ram can be used to store samples)
Exo is offline   Reply With Quote
Old 26th May 2004, 10:55 AM   (permalink)
Default Re: Not PIC 16F84

Quote:
Originally Posted by km
I had changed my decision to use PIC 16F628 (It's your opinion 8) ). Will it has the same problem as what you have said?
I agree with Exo, I suspect you would be better off with a high range PIC (18F series). But first, as I've already mentioned, try running it on a PC, and see how many samples you need to calculate what you are wanting to do - you 'might' be surprised.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 26th May 2004, 11:04 AM   (permalink)
km
Default PIC 16F87 OR PIC16F648A

Exo, thanks for spending your time to read my post!! :wink:

Quote:
Originally Posted by Exo
Yes, 16f628 only has 224 byte of ram, still not enough (you're probabely need some of that for the rest of the software, not all ram can be used to store samples)
If in that case, which PICs should I used? (without a built-in A2D)
How about PIC 16F87 OR PIC16F648A? Both of these have twice the program space as the PIC 16F628. :idea:
km is offline   Reply With Quote
Old 26th May 2004, 11:05 AM   (permalink)
km
Default PIC 16F87 OR PIC16F648A

Exo, thanks for spending your time to read my post!! :wink:

Quote:
Originally Posted by Exo
Yes, 16f628 only has 224 byte of ram, still not enough (you're probabely need some of that for the rest of the software, not all ram can be used to store samples)
If in that case, which PICs should I used? (without a built-in A2D)
How about PIC 16F87 OR PIC16F648A? Both of these have twice the program space as the PIC 16F628. :idea:
km is offline   Reply With Quote
Old 26th May 2004, 11:17 AM   (permalink)
Default

Do the preliminary work first, and find out what you need - then look for a processor which will fit those requirements. No point in choosing a processor to find out later it won't do what you want.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 26th May 2004, 12:34 PM   (permalink)
km
Default -

Thanks for all the advice, Nigel!! 8)

One more question about testing the program on PC. After I have written a program that works, how am I going to test what resolution work best and how many samples I need to calculate? :roll:

PS:I apologize for my poor understanding.
km is offline   Reply With Quote
Old 26th May 2004, 12:52 PM   (permalink)
Default Re: -

Quote:
Originally Posted by km
Thanks for all the advice, Nigel!! 8)

One more question about testing the program on PC. After I have written a program that works, how am I going to test what resolution work best and how many samples I need to calculate? :roll:

PS:I apologize for my poor understanding.
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. As you're planning an 8 bit A2D, the maximum value can go from 0-255, so you need to write the generation routine accordingly - scaling it to give results in that range.

For a start I would try generating a run of 256 samples, and try your maths on that - then try 128 samples, and see if you get the same result, then 64 samples - you can do this easily by only using every 2nd sample, or third sample etc.

This simulates different numbers of samples, while keeping the data identical. You should also try doing the same with other waveshapes, to simulate real world conditions.

To try different A2D resolutions, scale the original numbers differently, this time from 0-1023 for 10 bit resolution - although this will give you even more memory problems on an 8 bit PIC. But I see no reason why 8 bit resolution won't be OK.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 28th May 2004, 06:44 PM   (permalink)
km
Default C code for calculations

Quote:
Originally Posted by Nigel Goodwin
Write in whatever software you are experienced in, Delphi, BASIC, C, Pascal, Prolog, Java - any language you like, just to prove it works
Is it you mean to prove the programming code can be used to perform the calculations?
:arrow: For Example:
The C code for RMS calculations:

total = 0;
for (i=0; i<SMP_CNT; i++) //SMP_CNT=Sample Count
{
total += (sample[i]*sample[i]);
}
RMS = sqrt(total / SMP_CNT);


PS: Anyone has the C code for the frequency/peak-to-peak/average/duty cycle calculations feel free to send me. Thank you :wink:
km is offline   Reply With Quote
Old 28th May 2004, 07:06 PM   (permalink)
Default Re: C code for calculations

Quote:
Originally Posted by km
Quote:
Originally Posted by Nigel Goodwin
Write in whatever software you are experienced in, Delphi, BASIC, C, Pascal, Prolog, Java - any language you like, just to prove it works
Is it you mean to prove the programming code can be used to perform the calculations?
:arrow: For Example:
The C code for RMS calculations:

total = 0;
for (i=0; i<SMP_CNT; i++) //SMP_CNT=Sample Count
{
total += (sample[i]*sample[i]);
}
RMS = sqrt(total / SMP_CNT);


PS: Anyone has the C code for the frequency/peak-to-peak/average/duty cycle calculations feel free to send me. Thank you :wink:
That's the sort of idea, now generate some sample waveforms and make sure it works - then try different numbers of samples, to try and find the optimum point between small numbers of samples and high numbers of samples. Presumably there will be a point where you start to lose too much accuracy, you need to find it and keep just above it.

P-P is easy, simply search for the lowest and highest values, they are the two peaks.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 29th May 2004, 06:15 PM   (permalink)
km
Default How to test?

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)


Sorry, this is the first time I do these. So, I need to be 100% sure.
km is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 12:45 AM.


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