Hi, Peter
I suggest you to try :
count = ( 1001 x Voltage - 9891 ) / 8
Alain
Hi, Peter
I suggest you to try :
count = ( 1001 x Voltage - 9891 ) / 8
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Thanks again for the ideas. Alain what makes yours special/sneaky?
I note that in my original table the 3rd character of the hex words 100V = $2C30 (3) in this case is never a letter A,B,C,D,E,F
Either I got lucky with my samples or something else is happening.
I was wondering if we are seeing the output from a 12bit ADC 4096 packed into those twelve bits.
Sorry I'm still a bit stuck.
Looking at this again lets assume my voltage data is being encoded into a 3 digit hex humber. (12 bits)? or is it a raw 10 bit non justified ADC result I am seeing?
Lets take 100V as an example $2C3 = 707
The position 3 is never > 7 and varies between 0 and 7 as the voltage rises and falls.
That feels significant,so what is going on?
150V for example = $447 = 1095
Grateful for any other ideas.
Or alternatively how can I prevent anything other than 0-7 appearing in the result?
Hi Peter
Let us walk through this as per what I suggested
(100V-10)*126 = 11340 = $2C4C
(150V-10)*126 = 17640 = $44E8
Now suppose we drop the last nibble( divide by 16), you get $24C and $44E which is pretty close to the numbers you're seeing. So, the error must be in the formula being an approximation.
Hope this makes it easier for you to solve the issue
Regards
Thanks I think I have it now..
Bookmarks