I am building a watt meter around a Allegro ACS755-50 hall effect curent sensor. The output is scaled so that 0 to 4.995V = 0 to 50ADC. I also have a /11 voltage divider to measure up to 55Vdc. I am having a hard time trying to calculate Watts with this integer math stuff. The current and voltage measurements are dead on. The problem I am having is that my voltage and current reading are split into a byte.word configuration. How to carry the remainder of the word over to the byte so that my calculation is correct. I am now trying to just myultiply the word vars together but that isn't working either....Here is my code so far:

DEFINE OSC 20

DEFINE ADC_BITS 10
DEFINE ACD_CLOCK 3
DEFINE ADC_SAMPLEUS 200
INCLUDE "modedefs.bas"

ADCON0 = %11000001
ADCON1 = %11000000

' Define LCD registers and bits
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 3
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 2
'Pulsin definations
'define pulsin_max 1000
'Button Variable
B0 var byte

B0 = 0

'Misc. VAR's and CON's
BDLY con 20
maxim var word
Position VAR WORD ' Servo position data
Y VAR BYTE ' Servo position update speed
Servo var PortC.2 ' PortB.4 = left servo output
AD_Raw Var Word ' 10-bit result of A/D conversion
AD_Result Var Word ' Quantasized ADC result
AD_Result1 Var Word ' Quantasized ADC result
Average Var Word ' Variable for building up the average result
Samples Var Byte ' Amount of samples taken
Volts Var Byte ' Holds the Volts part of the result (only for display purposes)
Millivolts Var Word ' Holds the Millivolts part of the result (only for display purposes)
Amps Var byte
milliamps Var word
W var word
Milliwatts var Word
ph var word
pl var word
c vaR word
' quanta level = (5/1024) * 256 == 1250
Quanta Con 1250

Y = 20

Amp:

Average=0 ' Clear the Average variable befor use
For Samples=0 to 9 ' We will take 10 samples of the ADC
ADCIN 0,AD_Raw ' Place the conversion of channel0 into AD_RAW
Average=Average+AD_Raw ' Build up the Average result
Next ' Close the loop
Average=Average/10 ' Calculate the average by dividing by the number of samples taken
AD_Result1=(Average) */ Quanta ' Quantasize the result
AD_Result1=AD_Result1*10
amps= AD_Result1/1000 ' Calculate the Amps part of the result
Milliamps=AD_Result1//1000 ' Calculate the Milliamps part of the result
IF Milliamps < 60 THEN
Milliamps=Milliamps-Milliamps
ENDIF
RETURN

Volt:

Average=0 ' Clear the Average variable befor use
For Samples=0 to 9 ' We will take 10 samples of the ADC
ADCIN 1,AD_Raw ' Place the conversion of channel0 into AD_RAW
Average=Average+AD_Raw ' Build up the Average result
Next ' Close the loop
Average=Average/10 ' Calculate the average by dividing by the number of samples taken
AD_Result=(Average) */ Quanta ' Quantasize the result
AD_Result=AD_Result*11
Volts= AD_Result/1000 ' Calculate the Volts part of the result
Millivolts=AD_Result//1000 ' Calculate the Millivolts part of the result
RETURN

Watt:

AD_Raw=AD_Result*AD_Result1
W= AD_Raw/1000 ' Calculate the watts part of the result
Milliwatts=AD_Raw//1000 ' Calculate the Milliwatts part of the result
Return