chiark / gitweb /
annotations to i2c-test-reply
authorceb <ceb>
Sun, 3 Jul 2005 16:48:55 +0000 (16:48 +0000)
committerceb <ceb>
Sun, 3 Jul 2005 16:48:55 +0000 (16:48 +0000)
cebpic/i2c-test-reply.asm

index 82ec2a984fa8e816f4967a62e838ecdf2f36fa00..1d444b49891006c55c3ea3687f3631f86de7aee5 100644 (file)
@@ -1,7 +1,19 @@
 ; write a byte to pic0 via the serial port, pic0 will transmit it to
-; pic1, which will then toggle its colour (without checking the contents
-; of the byte)
+; pic1. 
 
+; pic0 will go into morse/register readout panic routine when it 
+; has transmitted the address byte+data byte via i2c.
+
+; pic1 will go into morse/register readout panic routine when it 
+; received address byte+data byte via i2c.
+
+; prints out various debugging letters via the serial port 
+; along the way.
+
+; panic routines may be all a bit confused because I can't remember 
+; whet the original i2c program did when panicing.
+
+;***************************************************************************
 ; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: 
 ;  high H = blue (=green), low L = orange (=red), float Z = black
 
@@ -499,7 +511,7 @@ slave_main_loop
        call    wait_for_i2c_interrupt  ; wait for 2nd (data) byte
        call    led_black
        debug   'B'
-       goto    slave_main_loop
+       goto    vector_panic
 
 ;----------------------------------------
 serial_rx_isr
@@ -532,6 +544,7 @@ serial_rx_isr
        bsf     SSPCON2,PEN,0           ; i2c STOP
        call    wait_for_i2c_interrupt
 
+       goto    vector_panic
        retfie
 
 ;***************************************************************************
@@ -690,12 +703,12 @@ i2c_isr
 ;--------------------
 i2c_master_isr
        debug   'm'
-       goto    vector_panic
+       goto    wait_for_i2c_interrupt
 
 ;--------------------
 i2c_slave_isr
        debug   's'
-       goto    vector_panic
+       goto    wait_for_i2c_interrupt
 
 ;----------------------------------------
 wait_for_i2c_interrupt