SERIN and interrupts

rosswakelin

New Member
Hi all,

The Picaxe manual says that certain commands like pause etc. are able to be interrupted using the "setint" command. Does that apply to serin?
What I am trying to achieve is to have a system that either responds to a single button being pushed, and to commands received over the serial port, at the same time, so I can't just go into a SERIN wait state. I would prefer not to have an 08 dedicated to the serial reading if I can help it.

Thanks
 

moxhamj

New Member
There is no interrupt for serin, and many of us have less hair as a result!

After much pondering over several years, I've gone for the dedicated 08. It is only another $4.
 

manuka

Senior Member
Jeremy Leachhas offered this approach in the past, apparently as part of a Weather Station setup
Instead of running the Serin command, check the input for 'line high' status in a loop and have the loop timeout.

If the sending device sets the line low by default and high just before (e.g 1 ms) it sends this can work very effectively.

Because the line is high before the send you need to use the T option in the Serout/Serin commands.
Like Dr_A I normally just use a 2nd 08, & shamefully confess to not having yet tried Jeremy's approach- has anyone else?
 
Last edited:

hippy

Ex-Staff (retired)
I've used Jeremy's approach and variations of it. It only works if in control of sending the data ( from another PICAXE/micro or PC ).

For other cases, an additional PICAXE or use an X1 and high-speed serial.
 

rosswakelin

New Member
Bah humbug

Oh well, it was worth a try. The serial is coming in from a wireless link so Jeremy's solution won't work. Time to break out an 08 by the sounds of it.

Thanks for the help
 
Top