diff options
author | Christian Pointner <equinox@mur.at> | 2012-06-07 17:43:11 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2012-06-07 17:43:11 +0000 |
commit | 8bd7979da0b89b2757f2dcb3818f92189d05c8ae (patch) | |
tree | eadb010f517b420f8f7ed408c2ea968d51e6227b /software | |
parent | improved port pin definitions (diff) |
improved port pin assigments
git-svn-id: https://svn.spreadspace.org/mur.sat@512 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software')
-rw-r--r-- | software/ctr/ctr.asm | 96 | ||||
-rw-r--r-- | software/ctr/i2c.inc | 56 | ||||
-rw-r--r-- | software/ctr/ttx.inc | 8 |
3 files changed, 80 insertions, 80 deletions
diff --git a/software/ctr/ctr.asm b/software/ctr/ctr.asm index bdff971..281321e 100644 --- a/software/ctr/ctr.asm +++ b/software/ctr/ctr.asm @@ -53,57 +53,57 @@ OSC_HIGH EQU b'01101000' ; 4 MHz ;; I/O Pins ;; PortA -CW_ENABLE EQU 2 -CW_OUT EQU 3 -IHU_SS EQU 5 -IHU_SDO EQU 6 -IHU_INT EQU 7 +#define CW_ENABLE PORTA,2 +#define CW_OUT PORTA,3 +#define IHU_SS PORTA,5 +#define IHU_SDO PORTA,6 +#define IHU_INT PORTA,7 ;; PortB -CLK_1HZ EQU 0 -IHU_SDI EQU 1 -CRX_INT EQU 3 -IHU_SCK EQU 4 -I2C_SDA EQU 6 -I2C_SCL EQU 7 +#define CLK_1HZ PORTB,0 +#define IHU_SDI PORTB,1 +#define CRX_INT PORTB,3 +#define IHU_SCK PORTB,4 +#define I2C_SDA PORTB,6 +#define I2C_SCL PORTB,7 ;; variables ;; page 0 only -ELEMENT EQU H'0020' -ELECNT EQU H'0021' -CHAR EQU H'0022' -PARITY EQU H'0023' -CHARCNT EQU H'0024' -PENTLE0 EQU H'0025' -PENTLE1 EQU H'0026' -PENTLECNT EQU H'0027' -ACK_DATA EQU H'0028' -TMP1 EQU H'0029' -TMP2 EQU H'002A' - -BUF EQU H'0040' -BUF_END EQU H'004F' +ELEMENT EQU H'0020' +ELECNT EQU H'0021' +CHAR EQU H'0022' +PARITY EQU H'0023' +CHARCNT EQU H'0024' +PENTLE0 EQU H'0025' +PENTLE1 EQU H'0026' +PENTLECNT EQU H'0027' +ACK_DATA EQU H'0028' +TMP1 EQU H'0029' +TMP2 EQU H'002A' + +BUF EQU H'0040' +BUF_END EQU H'004F' ;; all pages -BEACON_INTL EQU H'0070' -BEACON_INTH EQU H'0071' -DOT EQU H'0072' -ESPACE EQU DOT -DASH EQU H'0073' -CSPACE EQU DASH -WSPACE EQU H'0074' -TUNE EQU H'0075' - -I2C_BYTE EQU H'0077' -I2C_BIT_CNT EQU H'0078' -I2C_BYTE_CNT EQU H'0079' - -NVSTATE EQU H'007A' -BEACONCNTH EQU H'007B' -BEACONCNTL EQU H'007C' -STATE EQU H'007D' -W_TEMP EQU H'007E' -STATUS_TEMP EQU H'007F' +BEACON_INTL EQU H'0070' +BEACON_INTH EQU H'0071' +DOT EQU H'0072' +ESPACE EQU DOT +DASH EQU H'0073' +CSPACE EQU DASH +WSPACE EQU H'0074' +TUNE EQU H'0075' + +I2C_BYTE EQU H'0077' +I2C_BIT_CNT EQU H'0078' +I2C_BYTE_CNT EQU H'0079' + +NVSTATE EQU H'007A' +BEACONCNTH EQU H'007B' +BEACONCNTL EQU H'007C' +STATE EQU H'007D' +W_TEMP EQU H'007E' +STATUS_TEMP EQU H'007F' ;; ------------------------------------- ;; OFFSET @@ -318,8 +318,8 @@ init movlw b'01100000' movwf APFCON0 clrf APFCON1 - bcf LATB,I2C_SDA - bcf LATB,I2C_SCL + bcf I2C_SDA + bcf I2C_SCL ;; BANK 1 movlb .1 @@ -338,8 +338,8 @@ init movwf INTCON - bcf PORTA,CW_OUT - bcf PORTA,CW_ENABLE + bcf CW_OUT + bcf CW_ENABLE clrf NVSTATE ; TODO: read State from EEPROM movlw .42 diff --git a/software/ctr/i2c.inc b/software/ctr/i2c.inc index 52c90e3..9643355 100644 --- a/software/ctr/i2c.inc +++ b/software/ctr/i2c.inc @@ -31,33 +31,33 @@ ;; ------------------------------------- i2c_start movlb .1 - bcf TRISB,I2C_SDA + bcf I2C_SDA nop - bcf TRISB,I2C_SCL + bcf I2C_SCL movlb .0 return ;; ------------------ i2c_restart movlb .1 - bsf TRISB,I2C_SDA + bsf I2C_SDA nop - bsf TRISB,I2C_SCL + bsf I2C_SCL nop nop nop - bcf TRISB,I2C_SDA + bcf I2C_SDA nop - bcf TRISB,I2C_SCL + bcf I2C_SCL movlb .0 return ;; ------------------ i2c_stop movlb .1 - bsf TRISB,I2C_SCL + bsf I2C_SCL nop - bsf TRISB,I2C_SDA + bsf I2C_SDA movlb .0 return @@ -69,27 +69,27 @@ i2c_send_byte movlb .1 i2c_send_byte_next btfss I2C_BYTE,7 - bcf TRISB,I2C_SDA + bcf I2C_SDA btfsc I2C_BYTE,7 - bsf TRISB,I2C_SDA + bsf I2C_SDA nop - bsf TRISB,I2C_SCL + bsf I2C_SCL nop nop - bcf TRISB,I2C_SCL + bcf I2C_SCL rlf I2C_BYTE,f decfsz I2C_BIT_CNT,f goto i2c_send_byte_next nop nop - bsf TRISB,I2C_SDA - bsf TRISB,I2C_SCL + bsf I2C_SDA + bsf I2C_SCL movlb .0 movf PORTB,w movlb .1 - bcf TRISB,I2C_SCL - bcf TRISB,I2C_SDA + bcf I2C_SCL + bcf I2C_SDA movlb .0 andlw b'00010000' movwf I2C_BYTE @@ -102,18 +102,18 @@ i2c_recv_byte movlw .8 movwf I2C_BIT_CNT movlb .1 - bsf TRISB,I2C_SDA + bsf I2C_SDA i2c_recv_byte_loop - bsf TRISB,I2C_SCL + bsf I2C_SCL movlb .0 - btfsc PORTB,I2C_SDA + btfsc I2C_SDA bsf I2C_BYTE,0 movlb .1 - bcf TRISB,I2C_SCL + bcf I2C_SCL decfsz I2C_BIT_CNT,f goto i2c_recv_byte_next - bcf TRISB,I2C_SDA + bcf I2C_SDA movlb .0 return @@ -125,23 +125,23 @@ i2c_recv_byte_next ;; ------------------ i2c_ack movlb .1 - bcf TRISB,I2C_SDA - bsf TRISB,I2C_SCL + bcf I2C_SDA + bsf I2C_SCL nop nop - bcf TRISB,I2C_SCL + bcf I2C_SCL movlb .0 return ;; ------------------ i2c_nack movlb .1 - bsf TRISB,I2C_SDA - bsf TRISB,I2C_SCL + bsf I2C_SDA + bsf I2C_SCL nop nop - bcf TRISB,I2C_SCL - bcf TRISB,I2C_SDA + bcf I2C_SCL + bcf I2C_SDA movlb .0 return diff --git a/software/ctr/ttx.inc b/software/ctr/ttx.inc index 2e45f28..278574a 100644 --- a/software/ctr/ttx.inc +++ b/software/ctr/ttx.inc @@ -65,13 +65,13 @@ send_char xorwf PARITY,f char_next_element - bsf PORTA,CW_OUT + bsf CW_OUT btfss ELEMENT,7 movf DOT,w btfsc ELEMENT,7 movf DASH,w call dottime - bcf PORTA,CW_OUT + bcf CW_OUT rlf ELEMENT,f @@ -260,7 +260,7 @@ send_parity ;; ------------------------------------- send_beacon - bsf PORTA,CW_ENABLE + bsf CW_ENABLE movf TUNE,w call dottime clrf PARITY @@ -289,6 +289,6 @@ send_beacon ;; TODO write new cnt value to EEPROM beacon_end - bcf PORTA,CW_ENABLE + bcf CW_ENABLE return ;; ------------------------------------- |