Let's Make Robots!

Inter PICAXE serial communications advice? -SOLVED-

Main code summary: The 28X2 raises a pin high, triggering the interrupt on the 08M2. The 28X2 then sends a number (1 to 5) via serial connection to the waiting 08M2. The 08M2 then I2Cs the correct bits to an I/O expander to turn on an LED pattern:

28X2:

main:{
for b28 = 1 to 5
 LED_code = b28
 'debug
 call I2C_LED_code
 pause 1000
next b28
goto main
}
I2C_LED_code:{
high serint
pause 2
low serint
pause 2
serout ser_pin,N2400_8,(LED_code) 'set for triggering the interrupt with 08M2
return
}

08M2:

HI2CSETUP I2CMASTER, PCF_byte, i2cfast, i2cbyte 'set for I/O expander I2C
setfreq m8
setint %00010000,%00010000 'reset interrupt; rising edge,serint pin
}
main:{
serin ser_pin,N2400_8,LED_byte
if LED_byte <> LED_byte_hist then
 select case LED_byte
  case 0
   goto main
  case 1 'looking
   call looking
  case 2 'locked
   call locked
  case 3 'alert
   call alert
  case 4 'startup on
   call startup_on
  case 5
   call startup_off
 end select
endif
goto main
}
looking:{
hi2cout latch_register, (blue)
return
}
locked:{
hi2cout latch_register, (green)
return
}
alert:{
hi2cout latch_register, (red)
return
}
startup_on:{
hi2cout latch_register, (white)
return
}
startup_off:{
hi2cout latch_register, (none)
return
}
interrupt:{
serin ser_pin,N2400_8,LED_byte
setint %00010000,%00010000 'reset interrupt; state,pin
return
}

Believe me when I tell you the pins are connected correctly like the interrupt going to C.4, etc etc etc. No special resistors involved either. I tried pullups/downs out of frustration and they didn't result in anything different. I can get a non-interrupt version of the program to work fine but the above gets me nothing. I've spent several days on this and I'm having varing degrees of non-success. I'm getting ready to cry blue smoke here.

FWIW I'm trying to get the serial communications done on the C.3 pin of the 08M2 and the C.3 pin of the 28X2. I know the C.3 pin needs an external diode on th 08M2 for serin commands but it doesn't make a difference if it's there or not. I even had the serial byte get picked up on C.4 when it should have been on C.3. I'm chalking that up to a low battery but this is the kind of thing that's making me nuts-o-bonkers-crazy. I even moved the serial in line to C.4 on the 08M2 but the results were the same.

Ok, time for some thumb sucking and then some sleep. Four days wasted on this bug. Thanks for lookin.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

did-int you have trouble with the bread board when you were waking your m8 walker ? or something like that 

might need to get a new 1 :) just saying