Hi. I am trying to send messages from chip 40x1 to 08M2 chip. This was my choice because of shortage of RAM, EEPROM and TABLE memory on single chip. All I need is to save data from 0 to 255 to 08M2's EEprom. To trigger read on 08M2 I am using interrupt on input pin. So 40x1 is sender, 08M2 is receiver and I am getting mess on receiver (different data every time). I connected pin 7 (serial out) on 40x1 to pin 2 (serial in) on 08M2 with 10K resistor in series. The same I've done with interrupt connection - 10K in series.
There is my code:
Sender
Receiver:
I tried to monitor received data on LCD as well, but results are messy all the time. Why is this doesn't work?
Thanks.
There is my code:
Sender
Code:
#Picaxe 40x1
main:
b0 = 25 'for example "25" is data we need to send
if pin0 = 1 then 'push button to trigger data send
gosub send_message_to_08
endif
goto main
send_message_to_08:
do
loop while pin0 = 1 'loop here to avoid multiple messages
high 7 'trigger interrupt on 08M2
pause 50
low 7
sertxd(b0) 'send data over serial conection pins
return
Code:
#Picaxe 08M2
let dirsC = %00010001 'Define 2 outputs, rest of pins are inputs
setint %00001000, %00001000, c 'Interrupt on input C.3 when high
main:
'the code
goto main
interrupt:
serrxd [1000],b0 'store received data into b0, timeout 1s '
pause 10
debug 'to monitor
setint %00001000, %00001000,c 'reinitialise interrupt
return
Thanks.