Serial Communications between Two AXE200 units (28X2)

nfk

Senior Member
I've been reading on the forum about the problems associated with serial comms between two PICAXE chips (e.g. http://www.picaxeforum.co.uk/showthread.php?t=8393&highlight=serin+problems).

What is the most reliable way to communicate quickly between two AXE200 units (28X2 modules which are fitted with a resonator)? I've tried SEROUT and SERIN between the 28X2 module and a 20X2 and I had to work at 2400 baud to get it to work reliably - with two 28X2 modules I can't get it to work at all. I only need to send two bytes of data.

Any help much appreciated.

Nigel
 
Last edited:

nfk

Senior Member
Aaaaarg!!! I don't know what I've done but now it works fine! :eek:

Anyway, here's the code for the...

Transmitter:

Code:
setfreq m8

	symbol baud=N9600_8
main:
	for w0=0 to 8192
	serout C.1,baud,("P")
	serout C.1,baud,(b0)
	serout C.1,baud,(b1)
	next w0
	goto main
...and receiver...

Code:
setfreq m8

	symbol baud=N9600_8
main:
	serout c.1,N19200_16,(254,"H")
	serin c.3,baud,("P"),b0,b1	
	serout c.1,N19200_16,("Data=",#w0," ")
	goto main
This is working easily fast enough for my purposes.

Cheers,
Nigel

PS And for those of you that celebrate it - a very Merry Christmas!
 

MFB

Senior Member
If the link only works some of the time at a low rate, the problem may be temperature drift in the PICAXE internal resonator. Try trimming the serial output rate by using the calibfreq command.
 
Top