![]() |
![]() |
![]() |
|
|
|||||||
| 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. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) | ||||
|
PART 1:
Quote:
PART 2: 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):?: PS:I'm getting more worry about my project day by day as I only left 2 months to do my project :cry: |
|||||
|
|
|
|
|
(permalink) | |||
|
Quote:
Quote:
Quote:
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: |
||||
|
|
|
|
|
(permalink) | |
|
:shock: A lot of prayer? LOL :lol: Thanks for your advice!!
Quote:
|
||
|
|
|
|
|
(permalink) | ||
|
Quote:
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. |
|||
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
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)
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) | |
|
Exo, thanks for spending your time to read my post!! :wink:
Quote:
How about PIC 16F87 OR PIC16F648A? Both of these have twice the program space as the PIC 16F628. :idea: |
||
|
|
|
|
|
(permalink) | |
|
Exo, thanks for spending your time to read my post!! :wink:
Quote:
How about PIC 16F87 OR PIC16F648A? Both of these have twice the program space as the PIC 16F628. :idea: |
||
|
|
|
|
|
(permalink) |
|
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.
|
|
|
|
|
|
|
(permalink) |
|
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. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
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. |
||
|
|
|
|
|
(permalink) | |
|
Quote:
: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: |
||
|
|
|
|
|
(permalink) | ||
|
Quote:
P-P is easy, simply search for the lowest and highest values, they are the two peaks. |
|||
|
|
|
|
|
(permalink) | |
|
Quote:
All the test is it mainly on the programming part only :?: What others waveshape I need to generate? (analogue waveforms) |
||
|
|
|