PDA

View Full Version : Serial Output - for an ASM numb



scomi85
- 1st March 2009, 10:13
Full asm code here (http://homepages.paradise.net.nz/bhabbott/watt/wattmeter.asm).

From the asm source code, there are calculations on the watt and ampere hour.
But for my project, i intended to get only the ampere hour reading out. So I tried my best to study the asm code though i am numb in asm.

Calculating the ampere hour


calc_Ah:
add1632 Amps,AmpSum ; AmpSum = accumulated Amps
mov32 AmpSum,dd
movi16 3600*3,aa ; 3 reads per second, 3600 seconds per hour
call Div32 ; AmpHours = AmpSum / (reads per hour)
store_Ah:
mov16 dd+2,AmpHours
And here is the part to display the reading at a 16x2 line LCD


.....
call Show_AmpHours ; "9999.9W 99.99Ah"
.....
But the code is intended to display it on the LCD. How to modify it so that i can directly get a single stream for only the ampere hour data out from a PIC?

I am trying to get the serial uart output from it. Can anyone guide me? (I din use any RS232, the RF module needs serial comm. via CMOS logic)
I am just leaving this particular part, can someone kind enough guide me?