Not knowing RFO Basic I can't say much about this, but I am interested how do you get the data from PIC to the tablet.
USB or something else?
Can you make standalone apps with RfoBasic ?
Yes, I could but not intending to use it here for the moment.
More and more feeling inclined to do as much as I can with the micro and send data processed, as much as "ready to display" as possible. Tomorrow I should run the first test.
The Tablet has most probably the far more powerful processor ( even cheap ones sport a quad core 1Ghz+ ) so the maths would be better in the tablet!! However!! This largely depends on RFO basic and how it behaves... Some are very inefficient so excessive math may slow the app down ( I doubt it ) but I personally would use the tablet to do the math!!
I would simply send the raw ADC values to the tablet. You are only losing data (possibly accuracy.. in theory) if you process it in the micro and send "ready to display" values to the tablet. You are not solving any problems by processing the data in the micro.. possibly just creating them and limiting what you can do with the data at the tablet end.
I will make the micro to average each 4-readings block to xmit just 2 and 2 bytes. The rest of the pirouethes to display mV values, the tablet will do. Once done, a binary file will be saved on board the tablet.
I will make the micro to average each 4-readings block to xmit just 2 and 2 bytes. The rest of the pirouethes to display mV values, the tablet will do. Once done, a binary file will be saved on board the tablet.
Sounds good. By averaging, do you mean that you add 4 ADC readings and then send that value? .. that is what I would do. That is called "oversampling" and is part of data acquisition and is naturally done at the micro.
I would not do the right-shift. If you add four 10-bit ADC results you can just send that sum to the tablet and treat it as a 12-bit ADC value. You are sending 16-bits anyway. Why discard two bits of information?
If you want to do the right-shift, then shift only once. Summing four ADC results increases the ADC resolution by 1 bit and improves Signal to Noise Ratio by 6dB. If you shift twice, you lose what you gained when adding four results.
**broken link removed**
I oversample...... Read the adc 24 times on the trot... The result is pretty good... Then DON'T divide by 6 to get your 12bit... Use the higher value when calculating sensor inputs...
12 bit * map = truncated result..
14.5 bit * map = more accurate sensor result...
If the result is still a bit rocky... stick a 1mS delay in between the readings to surpress it a bit!!
I would not do the right-shift. If you add four 10-bit ADC results you can just send that sum to the tablet and treat it as a 12-bit ADC value. You are sending 16-bits anyway. Why discard two bits of information?
If you want to do the right-shift, then shift only once. Summing four ADC results increases the ADC resolution by 1 bit and improves Signal to Noise Ratio by 6dB. If you shift twice, you lose what you gained when adding four results.
**broken link removed**
Thanks for putting me in the right track. Found that AN somewhat hard to grasp so I searched and got the app note AVR121 which explains all more in detail.
Now I think I understand the difference between oversampling and a crude averaging as I was intending to do.
I oversample...... Read the adc 24 times on the trot... The result is pretty good... Then DON'T divide by 6 to get your 12bit... Use the higher value when calculating sensor inputs...
12 bit * map = truncated result..
14.5 bit * map = more accurate sensor result...
If the result is still a bit rocky... stick a 1mS delay in between the readings to surpress it a bit!!
Thanks for putting me in the right track. Found that AN somewhat hard to grasp so I searched and got the app note AVR121 which explains all more in detail.
Now I think I understand the difference between oversampling and a crude averaging as I was intending to do.