summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2011-07-30 00:26:22 +0000
committerChristian Pointner <equinox@mur.at>2011-07-30 00:26:22 +0000
commitfc6abe82fbb37bdc15db18c86b48393fecccc1d1 (patch)
tree06bc3b7654aad55106141c4cf29b3ec09807fa5a
parentadded get time function (diff)
added time output
git-svn-id: https://svn.spreadspace.org/mur.sat@78 7de4ea59-55d0-425e-a1af-a3118ea81d4c
-rw-r--r--software/ihu/ihu.asm61
-rw-r--r--software/ihu/rtc.inc1
-rw-r--r--software/ihu/tables.inc46
3 files changed, 106 insertions, 2 deletions
diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm
index 93780f7..97a36b3 100644
--- a/software/ihu/ihu.asm
+++ b/software/ihu/ihu.asm
@@ -226,8 +226,7 @@ init
;; -------------------------------------
;; TABLES
-
- ;; TODO: add lookup tables if needed
+ include "tables.inc"
;; -------------------------------------
;; SUBROUTINES
@@ -272,6 +271,64 @@ main
movlw BUF
movwf FSR
call rtc_get_time
+
+ swapf BUF+2,w
+ andlw b'00000011'
+ call digit
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movf BUF+2,w
+ andlw b'00001111'
+ call digit
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movlw ':'
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ swapf BUF+1,w
+ andlw b'00000111'
+ call digit
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movf BUF+1,w
+ andlw b'00001111'
+ call digit
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movlw ':'
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ swapf BUF,w
+ andlw b'00000111'
+ call digit
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movf BUF,w
+ andlw b'00001111'
+ call digit
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movlw '\r'
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
clrf TMP
goto main
diff --git a/software/ihu/rtc.inc b/software/ihu/rtc.inc
index 5a1446c..93eab31 100644
--- a/software/ihu/rtc.inc
+++ b/software/ihu/rtc.inc
@@ -72,6 +72,7 @@ i2c_send_byte_next
bcf TRISB,RTC_SDA
btfsc RTC_BYTE,7
bsf TRISB,RTC_SDA
+ nop
bsf TRISB,RTC_SCL
nop
nop
diff --git a/software/ihu/tables.inc b/software/ihu/tables.inc
new file mode 100644
index 0000000..69584bf
--- /dev/null
+++ b/software/ihu/tables.inc
@@ -0,0 +1,46 @@
+ ;;
+ ;; mur.sat
+ ;;
+ ;; Somewhen in the year 2011, mur.at will have a nano satellite launched
+ ;; into a low earth orbit (310 km above the surface of our planet). The
+ ;; satellite itself is a TubeSat personal satellite kit, developed and
+ ;; launched by interorbital systems. mur.sat is a joint venture of mur.at,
+ ;; ESC im Labor and realraum.
+ ;;
+ ;; Please visit the project hompage at sat.mur.at for further information.
+ ;;
+ ;;
+ ;; Copyright (C) 2011 Christian Pointner <equinox@mur.at>
+ ;;
+ ;; This file is part of mur.sat.
+ ;;
+ ;; mur.sat is free software: you can redistribute it and/or modify
+ ;; it under the terms of the GNU General Public License as published by
+ ;; the Free Software Foundation, either version 3 of the License, or
+ ;; any later version.
+ ;;
+ ;; mur.sat is distributed in the hope that it will be useful,
+ ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ;; GNU General Public License for more details.
+ ;;
+ ;; You should have received a copy of the GNU General Public License
+ ;; along with mur.sat. If not, see <http://www.gnu.org/licenses/>.
+ ;;
+
+ ;; -------------------------------------
+ ;; digit
+digit
+ addwf PCL,f
+ retlw '0'
+ retlw '1'
+ retlw '2'
+ retlw '3'
+ retlw '4'
+ retlw '5'
+ retlw '6'
+ retlw '7'
+ retlw '8'
+ retlw '9'
+
+ ;; -------------------------------------