Picaxe too slow, how to speed up?
May 6, 2009
Hello guys. I am working on my laser tag project using a picaxe (btw if anyone's interested tell me :=) )
I now have one problem regarding IR transmission of data. Since i am gonna have a picaxe receive data from 3 different "sensor areas" i cannot just leave it on SERIN because this would mean the picaxe is only going to monitor one of the sensor zones at a time. Instead i want it to be ready to receive data from any of these 3 sensor areas as soon as they have something to transmit. Because of this i am making the transmitter of data send a high bit lasting less than a millisecond before the actual data i want to transmit. This way the receiver knows which pin to SERIN. The problem is that after doing some test, i realized that the receiver needs time to switch between this: (which is the checking of the pins)
if pin1 = 0 then
if pin2 = 0 then
if pin3 = 0 then
serin 1, T2400 , b0
The tests says it needs between 15ms and 20ms.
That's a LOT, especially for my project, where i have to simulate a rifle firing up to 20 bullets per second. "0 bullets/sec means 50ms per data transfer INCLUDING the checking of the pins and switching to SERIN. Unless the SERIN takes 30ms (actually i don't know how it takes and don't know how to measure it), this 20ms for the switching are too much. Do you know a way to resolve this problem? Either by speeding up the picaxe (say 8MHz instead of 4), finding another way of monitoring three different input before going on SERIN, etc...