Thursday 21 February 2013

The Right Tools



Visit Tagbits to see the full range of tagger products described in this blog.

I'm trying to develop my own software to implement the Milestag protocol, as I wish to add my own enhancements to the system. I am trying to avoid the open source BASIC software that is available as I don't have access to the compiler, so I'm developing mine in Hi-Tech C, which is available to me.

The IR protocol is based upon pulse lengths, best described here. Basically, a data packet has a 2400uS header, followed by zeros of 600uS in length, and 1s of 1200uS in length. There is an inter bit delay of 600uS.
The problem I have with current open source software is that there is an interrupt generated when the header starts, but the rest of the packet is received in the same interrupt session, regardless of the packet length.

I try to conserving CPU cycles when I can, and locking the receive routine in loop whilst it times bits is wasteful. This is not a problem for the current software, but I'd like to implement a timer driven fat16 routine to pull sample data of an SD card in the future, so I can get rid of the ISD1790 that is used to play back samples in the current design.

To get me there, I've written a routine which interrupts when the IR signal changes state. When the receive pin changes state, the interrupt routine resets the PIC TIMER0, and re-configures the interrupt to fire on the opposite edge. Using this method, only 10s of uS are spent in the interrupt routine, and TIMER0 is used to accurately time the period between each transition.

So, to test this properly I plugged my pulse generator into my Milestag UMT clone, whilst doing in circuit debugging using a Microchip ICD2 debugger, with a AC162055 debug header.

The pulse generator allows me to time pulses to within 20nS, so I fired off pulses of 2400uS, 1200uS and 600uS as used by the Milestag protocol.
I got TIMER0 values of 0x95, 0x4A and 0x25 respectively, which compare favourably with a 50% ratio between each value. I modified my code to allow a +/- 15% deviation from these values, as the PICs use internal RC oscillators that may have some variation.

With this in place, and my Milestag gun set to transmit a shot packet of player ID 'Sheik' which has a value of 0x2E and a shot power value byte of 5.



And here's the data as received by the PIC. 0x2e 0x05 as expected.
With this in place, I have the infrastructure to receive all Milestag packets.

Thursday 14 February 2013

Mendel90 Kit: Completed

I finally got my Mendel90 kit printing today, after replacing the duff PSU I had with an 'offical' one from Chris. It's taken me about a full day to get it built, which is quite reasonable. The first models I printed were the Android bots from the gcode file supplied with the kit:



The quality is superb. I'm using some bluish transparent PLA that I've had lying around for ages from Fabadashery.

Here is the statutory video of it:

Sunday 10 February 2013

In clear sight



Visit Tagbits to see the full range of tagger products described in this blog.

Steve at Operation Lasertag asked me if I could help with replacement sights for this:



It's a Hasbro laser tag unit that he rents out for use at customers own party venues. The problem is that the sights tend to get lost and spares are no longer manufactured.



He asked me if I could use my iron sight design as a replacement.

The gun has a picatinny style mount for the sight to sit on so I combined my iron sight with the clamps I designed for a picatinny mounted focus tube the other week:



It has two shaped brackets that are clamped with two bolts to hold the sight in place. Here it is fitted to the gun body:



The final units will be made in red and green PLA to identify each team.

Saturday 9 February 2013

Almost There



I've finally wired the electronics on my Mendel90 Kit. Going to try and find time to fire it up this weekend.



Update: Disaster. PSU is duff!! Need to get a new one!!