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

Back to Subject List

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


 
#57513 - Scaling by Division Help
Hello..

I am interested in getting a value between 12 and 26 inclusive out of an operation where I read a value of a sensor via ADC. This should give me 15 steps. I think my code will work in this case, but I'm not sure what will happen when the ADC value is less than 17. Can anyone help with this?

ADC: mov b, adcon
jnb b.4, adc
clr a
clr b
clr c
mov a, adch
mov b, #17
div ab

Quotient is now in A, but what if adch= 16?

List of 7 messages in thread
TopicAuthorDate
Scaling by Division Help            01/01/70 00:00      
   RE: Scaling by Division Help            01/01/70 00:00      
   RE: Scaling by Division Help            01/01/70 00:00      
      Keep micro quiet during conversion!            01/01/70 00:00      
   RE: Scaling by Division Help            01/01/70 00:00      
   RE: Scaling by Division Help            01/01/70 00:00      
      RE: Scaling by Division Help            01/01/70 00:00      

Back to Subject List