summaryrefslogtreecommitdiff
path: root/software/idm
diff options
context:
space:
mode:
Diffstat (limited to 'software/idm')
-rw-r--r--software/idm/idm.asm50
1 files changed, 35 insertions, 15 deletions
diff --git a/software/idm/idm.asm b/software/idm/idm.asm
index ef48aaf..d2d68bc 100644
--- a/software/idm/idm.asm
+++ b/software/idm/idm.asm
@@ -32,7 +32,9 @@
;; DEFINES
CNT0 EQU H'0020'
CNT1 EQU H'0021'
-
+CNT2 EQU H'0022'
+TMP EQU H'0023'
+
;; -------------------------------------
;; OFFSET
org .0
@@ -48,7 +50,10 @@ CNT1 EQU H'0021'
int_spi
bsf PORTA,7
- nop
+ bcf PIR1,SSP1IF
+ incf TMP,f
+ movf TMP,w
+ movwf SSP1BUF
bcf PORTA,7
retfie
@@ -82,7 +87,11 @@ init
movwf TRISA
movlw b'01110011'
movwf TRISB
- movlw b'01011000'
+; movlw b'01011000' ; 1 MHz
+; movlw b'01100000' ; 2 MHz
+; movlw b'01101000' ; 4 MHz
+; movlw b'01110000' ; 8 MHz
+ movlw b'01111000' ; 16 MHz
movwf OSCCON
movlw b'00001000'
movwf PIE1
@@ -94,25 +103,36 @@ init
movwf INTCON
bcf PORTA,7
+ bcf PORTB,3
+
+ clrf TMP
+
;; -------------------------------------
;; MAINLOOP
main
- movlw .50
- movwf CNT0
+;; movlw .255
+;; movwf CNT0
-outer
- movlw .255
- movwf CNT1
+;; outer1
+;; movlw .255
+;; movwf CNT1
-inner
- decfsz CNT1,f
- goto inner
+;; outer
+;; movlw .20
+;; movwf CNT2
+
+;; inner
+;; decfsz CNT2,f
+;; goto inner
+
+;; decfsz CNT1,f
+;; goto outer
- decfsz CNT0,f
- goto outer
+;; decfsz CNT0,f
+;; goto outer1
- movlw b'00001000'
- xorwf PORTB,f
+;; movlw b'00001000'
+;; xorwf PORTB,f
goto main