Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/28/03 14:34
Read: times


 
#57380 - RE: ADC Value display Problem
Responding to: ???'s previous message
For all to know....the ADC0804 is an 8 bit A2D converter that produces values from 0x00 to 0xFF. First off it seems kind of strange to need to display these values as six digits value. However, if that concern is put aside, then it would mean that the required display sequence would be...

0x00 -> 000000
0x01 -> 001000
0x02 -> 002000
0x03 -> 003000
...
...
0xF8 -> 248000
0xF9 -> 249000
oxFA -> 250000
0xFB -> 251000
0xFC -> 252000
0xFD -> 253000
0xFE -> 254000
0xFF -> 255000

To achieve this effect all in software you would need to go to the 8052.com code library (at this link: http://www.8052.com/codelib/math8051.asm) and get the 16x16 multiply. Use this to multiply the A/D converter result by a fixed point factor of 1000. Then from the same code library you would use the unsigned divide 32-bit routine to successively divide the result by 10's in a loop. At each iteration of the loop you extract the remainder and convert that to a display digit value. Note that you can get up to 10 digits of precision from this process so you will have to discard the leading zeros. Finally take your six digits result and engage that value into your LED seven segment display routine.

Michael Karas


List of 23 messages in thread
TopicAuthorDate
ADC Value display Problem            01/01/70 00:00      
   RE: ADC Value display Problem            01/01/70 00:00      
      RE: ADC Value display Problem            01/01/70 00:00      
         RE: ADC Value display Problem            01/01/70 00:00      
   RE: ADC Value display Problem            01/01/70 00:00      
      RE: ADC Value display Problem            01/01/70 00:00      
   RE: ADC Value display Problem            01/01/70 00:00      
      RE: ADC Value display Problem            01/01/70 00:00      
      RE: ADC Value display Problem            01/01/70 00:00      
         RE: ADC Value display Problem            01/01/70 00:00      
         Still makes no sense!            01/01/70 00:00      
            RE: It could make sense!            01/01/70 00:00      
               Oh yes!            01/01/70 00:00      
                  RE: Oh yes - Kai and Mike            01/01/70 00:00      
               Still guessing            01/01/70 00:00      
   RE: ADC Value display Problem            01/01/70 00:00      
   -100 points!            01/01/70 00:00      
   RE: ADC Value display Problem            01/01/70 00:00      
      RE: ADC Value display Problem            01/01/70 00:00      
         RE: ADC Value display Problem            01/01/70 00:00      
            RE: ADC Value display Problem            01/01/70 00:00      
   RE: ADC Value display Problem            01/01/70 00:00      
   RE: ADC Value display Problem            01/01/70 00:00      

Back to Subject List