]> cloudbase.mooo.com Git - avrcpm.git/commitdiff
* Software-UART works with 2400 and 4800 Baud.
authorLeo <erbl259-lmu@yahoo.de>
Sat, 27 Apr 2013 13:12:56 +0000 (13:12 +0000)
committerLeo <erbl259-lmu@yahoo.de>
Sat, 27 Apr 2013 13:12:56 +0000 (13:12 +0000)
git-svn-id: svn://cu.loc/avr-cpm/avrcpm/trunk@215 57430480-672e-4586-8877-bcf8adbbf3b7

avr/Z80int-jmp.asm
avr/config.inc
avr/init.asm
avr/svnrev.inc
avr/sw-uart.asm

index 442650bee45cccdf8c4eb2047de1329b31d8b080..0ef24d39584ce17a658630cc7fb4891c29b91a7a 100644 (file)
@@ -121,16 +121,16 @@ noprintpc:
 
        ;TODO: hier kommt die Interruptbehandlung rein
 
-       cpse    intstat,_0                      ;Fast path if no trace, int, break, ...
+       cpse    intstat,_0                      ; 2 Fast path if no trace, int, break, ...
        rjmp    int_test
 
 int_instr:
-       mem_read_ds zl,z_pc                     ;zl = memReadByte(z_pc)
-       adiw    z_pcl,1                         ;++z_pc
-       ldi     zh,high(opcjmp)                 ;
-       icall
-       rjmp    main                            ;
-
+       mem_read_ds zl,z_pc                     ;11 zl = memReadByte(z_pc)
+       adiw    z_pcl,1                         ; 2 ++z_pc
+       ldi     zh,high(opcjmp)                 ; 1
+       icall                                   ; 3  (+4 ret)
+       rjmp    main                            ; 2
+                                               ; / 25 cycles minimum (NOP)
 int_test:
        sbrs    intstat,i_trace
        rjmp    int_notrace
@@ -458,20 +458,18 @@ do_fetch_af:
 ;      ret
 
 do_fetch_mbc:
-       movw    x,z_c
-       mem_read_d z_a
+;      movw    x,z_c
+       mem_read_ds z_a, z_bc
        ret
 
 do_fetch_mde:
-       movw    x,z_e
-;      ldd     xh,y+oz_d
-;      ldd     xl,y+oz_e
-       mem_read_d z_a
+;      movw    x,z_e
+       mem_read_ds z_a, z_de
        ret
 
 do_fetch_mhl:
-       movw    x,z_l
-       mem_read_d opl
+;      movw    x,z_l
+       mem_read_ds opl, z_hl
        ret
 
 do_fetch_msp:
@@ -550,20 +548,18 @@ do_store_hl:
        ret
 
 do_store_mbc:
-       movw    x,z_c
-       mem_write_s z_a
+;      movw    x,z_c
+       mem_write_ds z_bc, z_a
        ret
 
 do_store_mde:
-       movw    x,z_e
-;      ldd     xh,y+oz_d
-;      ldd     xl,y+oz_e
-       mem_write_s z_a
+;      movw    x,z_e
+       mem_write_ds z_de, z_a
        ret
 
 do_store_mhl:
-       movw    x,z_l
-       mem_write_s opl
+;      movw    x,z_l
+       mem_write_ds z_hl, opl
        ret
 
 do_store_msp:
@@ -2031,7 +2027,6 @@ do_op_prefixED:
        mem_read_ds zl,z_pc                     ;zl = memReadByte(z_pc)
        adiw    z_pcl,1                         ;++z_pc
        ldi     zh,high(EDjmp)                  ;
-;;;    ldi     zh,high(0)                      ;
        ijmp
 
 
@@ -3184,8 +3179,8 @@ do_store2_a:
 
        checkspace PC, 4
 do_fetch2_mhl:
-       movw    x,z_l
-       mem_read_d opl
+;      movw    x,z_l
+       mem_read_ds opl, z_hl
        ret
 
        opctable CBjmp, PC      ;+256
@@ -3991,12 +3986,12 @@ do_op_rrd:
        checkspace PC, 13
 
 op_LDxx_common:
-       movw    x,z_l                   ;HL
-;      mem_read_ds temp, z
-       lcall   dram_read               ; temp = (HL)
-       movw    x,z_e                   ;DE
-;      mem_write_ds x, temp
-       lcall   dram_write              ; (DE) = temp
+;      movw    x,z_l                   ;
+;      lcall   dram_read               ; temp = (HL)
+       mem_read_ds temp, z_hl
+;      movw    x,z_e                   ;
+;      lcall   dram_write              ; (DE) = temp
+       mem_write_ds z_de, temp
 
        cbr     z_flags,(1<<ZFL_H) | (1<<ZFL_P) | (1<<ZFL_N)
 
@@ -4046,10 +4041,16 @@ do_op_LDIR:
 
 do_op_LDDR:
        rcall   do_op_LDD
+#if 1
+       sbrc    z_flags,ZFL_P
+        rjmp   do_op_LDDR
+       ret
+#else
        sbrs    z_flags,ZFL_P
         ret
        sbiw    z_pcl,2
        ret
+#endif
 
 ;----------------------------------------------------------------
 ;|Mnemonic  |SZHPNC|Description          |Notes                 |
index fba09b8f25597effcfdb78f8078374f050821020..fd29616f4ea4412325a255ff23b4c287cc99ada7 100644 (file)
 
 .def   z_c     = r8    ;
 .def   z_b     = r9    ;
+.def   z_bcl   = r8    ;
+.def   z_bch   = r9    ;
 .def   z_e     = r10   ;
 .def   z_d     = r11   ;
+.def   z_del   = r10   ;
+.def   z_deh   = r11   ;
 .def   z_l     = r12   ;
 .def   z_h     = r13   ;
+.def   z_hll   = r12   ;
+.def   z_hlh   = r13   ;
 .def   z_spl   = r14   ;
 .def   z_sph   = r15   ;
 .def   temp    = r16   ;
index e2d48f4455b84ddf3340d766f66c9766506d2d13..c75227dc014286010685e5c67654956361023848 100644 (file)
@@ -172,7 +172,7 @@ ramtestwl:
        ldiw    x,0
        clr     temp3                   ;Error counter
 ramtestr:
-       mem_read
+       rcall   dram_read
 
 ;      ori     temp,0x04               ;simulate error
 ;      andi    temp,0xF7
index 86861f8eb62214d64c22162f3be1908d05d46b4d..d78f63b92287d90981eeaf3f13ab9ad3f43295b7 100644 (file)
@@ -2,17 +2,17 @@
  * (http://www.compuphase.com/svnrev.htm).
  * You should not modify it manually, as it may be re-generated.
  * 
- * $Revision: 213$
- * $Date: 2013-04-19$
+ * $Revision: 214$
+ * $Date: 2013-04-20$
  */
 
 #ifndef SVN_REV_H
 #define SVN_REV_H
 
-#define SVN_REV                213
-#define SVN_REVSTR     "213"
-#define SVN_REVDATE    "2013-04-19"
-#define SVN_REVSTAMP   20130419L
+#define SVN_REV                214
+#define SVN_REVSTR     "214"
+#define SVN_REVDATE    "2013-04-20"
+#define SVN_REVSTAMP   20130420L
 #define SVN_REVMODIFIED        0
 
 #endif /* SVN_REV_H */
index 7e81d98f9fa4676f58e3467243e7e00ef968ec0b..3216293faf3475b44d435f50d2ae237ed90912cb 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #define SSER_BIT_TC    (F_CPU+BAUD/2) / BAUD 
+#define SSER_CHAR_TC   (10 * 1000 / BAUD) + 2
 
 #define RXBUFMASK      RXBUFSIZE-1
 #define TXBUFMASK      TXBUFSIZE-1
@@ -36,6 +37,8 @@ srx_state:
        .byte   1
 srx_char_to:
        .byte   1
+srx_char_time:
+       .byte   1
 srx_dr:
        .byte   1
 srx_lastedge:
@@ -88,6 +91,9 @@ uart_init:
        ori     temp,(1<<ICIE1)                 ;Enable input capture int.  (UART RX)
        outm8   TIMSK1,temp                     ;
 
+       ldi     temp,SSER_CHAR_TC               ;Character TO
+       sts     srx_char_time,temp
+
        ret
        
 ;------------------------------------------------------------------
@@ -132,7 +138,7 @@ uart_init:
        sts     srx_dr,_0
        ldi     temp,1
        sts     srx_state,temp
-       ldi     temp,2
+       lds     temp,srx_char_time
        sts     srx_char_to,temp
        sbis    P_RXD-2,RXD                     ;RXD still low?
        rjmp    srxi_end
@@ -251,7 +257,7 @@ srxi_2l:
 srxi_complete1:
        ldi     temp2,1                 ;We are in start bit now.
        sts     srx_state,temp2
-       ldi     temp2,2
+       lds     temp2,srx_char_time
        sts     srx_char_to,temp2
        rjmp    srxi_complete