From 722d539ab6f89018657faaaec1778b086c395e7a Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 4 Jan 2012 03:23:17 +0000 Subject: solar power calculations work now git-svn-id: https://svn.spreadspace.org/mur.sat@231 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/ihu/ihu.asm | 6 ++---- software/ihu/solar.inc | 13 +++++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'software/ihu') diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm index 6ccc821..da0ef9b 100644 --- a/software/ihu/ihu.asm +++ b/software/ihu/ihu.asm @@ -368,7 +368,7 @@ uart_rx_fe ;; MAINLOOP main ; sleep - nop +; nop ;; -------------------- ;; ADC Test @@ -436,12 +436,10 @@ main call wait_ms movf SOL_POWERL,w - movwf TXREG - + movwf TXREG movlw .8 call wait_ms - clrf TMP goto main ;; -------------------- diff --git a/software/ihu/solar.inc b/software/ihu/solar.inc index 484a538..3c7134e 100644 --- a/software/ihu/solar.inc +++ b/software/ihu/solar.inc @@ -61,14 +61,19 @@ sol_mula_vc btfss SOL_CALC_9,0 goto sol_mula_rotate + bcf STATUS,C movf SOL_CALC_0,w addwf SOL_CALC_3,f - movlw .1 btfss STATUS,C + goto sol_mula_vc1 + bcf STATUS,C + movlw .1 addwf SOL_CALC_4,f btfsc STATUS,C incf SOL_CALC_5,f +sol_mula_vc1 + bcf STATUS,C movf SOL_CALC_1,w addwf SOL_CALC_4,f btfsc STATUS,C @@ -113,12 +118,15 @@ solar_calc_power bcf STATUS,C movf SOL_CALC_3,w addwf SOL_CALC_6,f - movlw .1 btfss STATUS,C + goto solar_calc_power1 + bcf STATUS,C + movlw .1 addwf SOL_CALC_7,f btfsc STATUS,C incf SOL_CALC_8,f +solar_calc_power1 movf SOL_CALC_4,w addwf SOL_CALC_7,f btfsc STATUS,C @@ -133,6 +141,7 @@ solar_calc_power rlf SOL_CALC_8,f ;; if(SOL_CALC_6 & 0x80) SOL_CALC_7:8+=1 + bcf STATUS,C movlw .1 btfsc SOL_CALC_6,7 addwf SOL_CALC_7,f -- cgit v1.2.3