From: ceb Date: Sun, 3 Jul 2005 16:48:55 +0000 (+0000) Subject: annotations to i2c-test-reply X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=648b10ed44a5914feb7572faf9c6b3dafff4e347;p=trains.git annotations to i2c-test-reply --- diff --git a/cebpic/i2c-test-reply.asm b/cebpic/i2c-test-reply.asm index 82ec2a9..1d444b4 100644 --- a/cebpic/i2c-test-reply.asm +++ b/cebpic/i2c-test-reply.asm @@ -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