Dual Serial Ports

rod mcmahon

New Member
As the picaxe allows any input/output to be used for serial communication is there any reason why you cannot put two serial ports through a picaxe for dual ( but separate) picaxe to picaxe communication
 

moxhamj

New Member
Absolutely! I've built a board that converts one serial port to 8. There are two main "catches". The first is that a picaxe can't listen to two ports at the same time, so you need a protocol with some sort of handshaking. The easiest is to use the RS232 CTS and RTS lines - put a line high to say "I have some data" or "I want to send some data". The second catch is that the Serin will hang a picaxe, so you might be waiting for data forever on one port while data on the other port is being missd. So again, you need some sort of protocol. There are other ways as well - eg one picaxe just sends data in packets every second, and then the receiving picaxe will only hang for a second.
 

westaust55

Moderator
Dual Serial Ports - possible use for polled interrupts

If you have a PICAXE-08M/14M/20M/18A/18X or a 28/40 in most/all versions then this could be a good application to use the polled interrupt so other things can be done while waiting, then on an interrupt caused by a signal from another device, the program automatically goes to a special subroutine ( named interrupt: ) when a monitored input is sensed to be the the specified state.

I am just starting to work with this feature for keypad entry rather than have the PICAXE waiting for data entry. Look at the SETINT command.

Also see Hippy's info on serial input and interrupts at: http://www.hippy.freeserve.co.uk/picaxesi.htm
 
Top