summaryrefslogtreecommitdiff
path: root/software/idm/idm.asm
diff options
context:
space:
mode:
Diffstat (limited to 'software/idm/idm.asm')
-rw-r--r--software/idm/idm.asm44
1 files changed, 17 insertions, 27 deletions
diff --git a/software/idm/idm.asm b/software/idm/idm.asm
index d779b4b..5883dcb 100644
--- a/software/idm/idm.asm
+++ b/software/idm/idm.asm
@@ -35,8 +35,11 @@
;; constants
BUF_STARTH EQU H'0020'
BUF_STARTL EQU H'0000'
-BUF_ENDH EQU H'0023'
-BUF_ENDL EQU H'00BF'
+BUF_ENDH EQU H'0020'
+BUF_ENDL EQU H'0060'
+;; BUF_ENDH EQU H'0023'
+;; BUF_ENDL EQU H'00BF'
+
#define FSRW FSR0
#define FSRWH FSR0H
#define FSRWL FSR0L
@@ -138,8 +141,6 @@ endif
;; }
int_adc
bcf PIR1,ADIF
- retfie
-
btfsc OVERRUN
retfie
;; movlb .1
@@ -147,6 +148,8 @@ int_adc
movf TMP,w
movwf INDFW
incf TMP,f
+ btfsc TMP,7
+ clrf TMP
movlb .0
call wbuf_next
bcf INT
@@ -184,13 +187,6 @@ int_spi
int_spi_0
btfss CMD_READ
retfie
-
- incf TMP,f
- movlb .4
- movf TMP,w
- movwf SSP1BUF
- retfie
-
movlb .0
call rbuf_next
btfss UNDERRUN
@@ -205,9 +201,8 @@ int_spi_0_loadnext
goto int_fsr_norestore
int_spi_r
- ;; movf INDFR,w
- ;; btfss UNDERRUN
- movf TMP,w
+ movf INDFR,w
+ btfss UNDERRUN
movwf SSP1BUF
clrf CMDS
bsf CMD_READ
@@ -361,8 +356,7 @@ endif
movwf ADCON1
movlw b'00001101' ; AN3, ADC On
movwf ADCON0
- ;; movlw b'01001000' ; ADIE,SSPIE
- movlw b'00001000' ; SSPIE
+ movlw b'01001000' ; ADIE,SSPIE
movwf PIE1
movlw b'01011111' ; Enable Pull UPs, disable T0CKI
movwf OPTION_REG
@@ -393,19 +387,15 @@ main
if DEBUG == 1
bcf SPEAKER
btfss DBG0
- bcf INT
- btfsc DBG0
- bsf INT
+ goto enable_t1
-;; goto enable_t1
-
-;; btfsc T1CON,TMR1ON
-;; bcf T1CON,TMR1ON
-;; goto main
+ btfsc T1CON,TMR1ON
+ bcf T1CON,TMR1ON
+ goto main
-;; enable_t1
-;; btfss T1CON,TMR1ON
-;; bsf T1CON,TMR1ON
+enable_t1
+ btfss T1CON,TMR1ON
+ bsf T1CON,TMR1ON
endif
btfss CS
goto main