emulating timeout in serin command

pworboys

New Member
I have an 18X picaxe and wish to emulate some type of serin timeout (available in nex X1/X2 chips I noticed).

Since my 18x is polling inputs, I can't really stop and wait for a serin respnse, which may NEVER occur.

The 18x is used in a remote monitoring/logging environment with only occassional connection to a PC. I wish to use the PC to dump the contents of the i2c memory, without stopping the monitoring for any length of time.

I have tried some combinations of using interupts (setInt), but just can't seem to get it to work looking at the serin pin.

Has anyone any thoughts on providing a serin timeout emulation utilising code?
 

Jeremy Leach

Senior Member
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.



Edited by - jeremy leach on 23/04/2007 12:33:02
 

manuka

Senior Member
Consider also a dual Picaxe approach, perhaps using a cheap 08 for the monitoring =&gt;<A href='http://www.picaxe.orcon.net.nz/duo08m2.jpg' Target=_Blank>External Web Link</a>
 

Marcwolf

Senior Member
I have tried the approach from the article that Manuka mentioned and I found it works very well.

Have a look at one of my previous postings to find the code. I used an interrupt on the same line a the Serin. So when I pulsed that line high - the PicAXE jumped to the serial in for processing.
<A href='http://www.rev-ed.co.uk/picaxe/forum/topic.asp?topic_id=6547&amp;forum_id=30&amp;Topic_Title=Simple+communcations+between+PICAXE&amp;forum_title=PICAXE+Forum&amp;M=True&amp;S=True' Target=_Blank>External Web Link</a>
At the present time (until 18X1) there is really no way to time out a Serin command.
Take Care

Dave

Edited by - marcwolf on 23/04/2007 13:57:53
 

pworboys

New Member
So it looks like setint is the way to go. I'll need to spend some more time check it and the other suggestions.

Will there be a 18X1 chip? I can only see doco for 28X1(2) and 40X1(2). and if so will it be plug compatible with the 18X for my datalogger AXE110P?
 

Marcwolf

Senior Member
18x1 - ops.. Wishful thinking and very late evening for me.

No 18X.. Wish there was thoug Hmmm... i2c slave on an 18X..

Hey Technical.. Can we have........
 

Technical

Technical Support
Staff member
If Microchip ever release an 18 pin PIC with the correct internal resources necessary for an 18X1 we will naturally produce it. But no such device is available, or even predicted, at present.
 

Marcwolf

Senior Member
Actually I have heard rumors that Microchip are developing a 64 bit PIC chip using nothing but one input NAND gates and quad state buffers :&gt;

Sort of like executing a non-maskable interrupt by grasping a computers power cord with both hands and....

Ok - Its late and my sense of humor is showing

Dave
 
Top