??? 03/04/05 02:34 Read: times |
#89065 - Re: Higher Resolution. Responding to: ???'s previous message |
Dear John,
Thanks for your reply, John said:
From the information given above, I am assuming you are using an 8bit ADC, if I remember vaguely from your previous posts, I think it is the PCF8591. My suggestion would be to go for a higher resolution ADC such as the MCP3202, which is a 12 bit ADC available for about Rs.126/= in Mumbai, which will satisfy your required resolution in one range. You are right John I am using an 8 bit ADC. Yes, the best solution is to use a better resolution ADC. But there's a practical problem. Let me explain. I use this signal conditioner + [ 8 bit ADC ] for measuring the RMS current flowing throught the components being welded. The half cycle width is only 10ms [ With 50Hz supply mains ]. In this 10ms period I need to measure atleast 100 samples from ADC. Find squares for each samples. At the end of each half cycle. Add the square values. Find their average and finally square root. and all this has to be done in flat 10ms. With 8 bit ADC values. I need to find square 8 bit ADC values which is pretty fast with 12 bit values [ 16 bit in keil unsigned integer ] squaring will take more than 4 times of what it takes now. At present the squares are unsigned integer and I add them. With 12 bit ADC I will need to add unsigned longs since the squares of 12bit values be will no less than 24 bit. Addition of unsigned long will also take 3 times more time than unsigned integer. Then I divide the Square sum by number of samples to get Mean sqaure and with 12 bit ADC values this operation will also take consideratble more time. Finally I find square root and with wider data this will also need much more time than what it takes now. At present with my I2C ADC I take 100 samples every half cycles and squaring and adding the squares is done in I2C interrupt. The mean square and root finding is done in main program once a half cycle measurement is done. CONCLUSION: My P89C668 in 6 clock mode has already come down to its knees with the current task and no more power left for crunching more than 8 bit values from ADC. Soon I will use ARMs LPC2124 for this product series I think 8051 is just not enough for this application. [ There are other speed issues too I mean other than ADC and current calcualtions ] Thanks again for your reply. Best Regards, Prahlad Purohit |