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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/27/02 11:10
Read: times


 
#26400 - Need help on a computation...
Hi all friends,
I am stuck with a problem at computations. First of all this is what I am working on...
Philips 89C51RD2/Atmel 89C51 µC,
Assembly Language: Win 8051 IDE by AceBus.

Now My problem is as follows...
I get a Requested angle from two locations (which one is to be used is decided based on a switch). One location gives me the data in decimal floating poing (like 10.25) using serial communication:RS-485. The other gives me an analog value (-15v to +15v). The total range of movement is ±35 degrees. So, the Serial channel gives me exact values (correct to two decimals) but the analog channel gives me ±15v. Now, I am using ADC0800 for reading the analog channel, and RS-485 channel to read the other.
I also get a feedback (actual range is ±35deg) from a POT that gives me ±15v.
Now I have to compute
required angle = SET ANGLE - FEEDBACK ANGLE

It is looking straight forward, but the following are a few problems I discovered...
Since I use ADC0800, It is 8-bit only accepts ±5v. So, Im scaling down the input of the analog channels by 3, and performing the computation on the values returned by the ADC (1 byte). The real problem is with the Serial value. First of all, how do I store it and secondly how do I convert the value to ADC O/P format. I cant use LookUp tables either as the µCs Im using dont support floats.

I need help pals, and I need it ASAP. Thanks for all of You.
Warm Regards,
Sriharsha.

List of 3 messages in thread
TopicAuthorDate
Need help on a computation...            01/01/70 00:00      
RE: Need help on a computation...            01/01/70 00:00      
RE: Need help on a computation...            01/01/70 00:00      

Back to Subject List