summaryrefslogtreecommitdiff
path: root/software/idm/idm.asm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2012-05-31 21:32:20 +0000
committerChristian Pointner <equinox@mur.at>2012-05-31 21:32:20 +0000
commitf7a1d2e9cdbb4f4d4f0c7712803d5abd34f55763 (patch)
treecb24f74e0424d1d9400de686b66cfdc3e5f5d785 /software/idm/idm.asm
parentcleanup (diff)
some timing test for idm communication (not working yet - hardware probs?)
git-svn-id: https://svn.spreadspace.org/mur.sat@501 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/idm/idm.asm')
-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