Friday, 30 August 2019

Updating sensors and going forwards


So, today I’ve been looking at alternate chips for the sensors, as to add the extra medical and reporting systems to the current sensors based on the Picaxe 08M2 is really pushing the envelope of what it can do.



 

In a nutshell, the Picaxe 08M2 chip has 2048 bytes of memory available to hold the program. Currently it’s at about 1600-1700 bytes, so getting a bit of a squeeze in there.

With what I’m planning to do for the medical system and other bells & whistles, @im pretty sure that’d fill it and possible go over it hence why I was looking at other solutions.

 

The picaxe with the next highest program memory is the 20x2 which has 4096 bytes of program memory available and twice the amount of Ram. BUT it’s also twice the price.

 

Price difference:

08M2 =  £2.26 inc vat

20X2 = £4.49 inc Vat

 

Program memory capacity:

08M2: 2042 bytes

20X2: 4096 bytes

 

Ram:

08M2:128 bytes

20x2: 256 bytes

 

 

Thing is, the picaxe chips are based on pic chips with a bootloader/interpreter pre-loaded onto them.

In the case of the picaxe 08M2, it’s actual PIC chip is the Pic12F180

 

Looking through the specs for the Pic shows the available program memory is actually 7k/7168 bytes which would be PLENTY. But the 5k of program memory is taken up by the picaxe bootloader

Program memory capacity:

08M2: 2042 bytes

Pic12F180: 7168 bytes

 

I knew the Pic chips had more memory available due to the nature of the Picaxe chips… But I didn’t realise it was quite that much until today!

 

So, that pretty much sealed the fate of the Picaxe based sensors. They work and they work with the Data system, but they can’t have the advanced medic system built in.

They CAN however be flashed back to their original Pic chip, so as long as I stick to the same pin in/out setup (Essentially the same circuit) I can convert the Picaxe based sensors to Pic based sensors by reprogramming them.

 

The catch-up period, where I essentially recreate the sensors in C does mean that sensors with built-in medical system are unlikely to be ready in time for Babylon 5 episode 2 next year. BUT we’ve got working sensors that can do fancy things like Armour, stun & radiation/lingering damage so provided we were to build enough for every player and not worry about anyone bringing their own sensors we can still used some of the enhanced features.

 

Overall that’s going to be the best way forward I think, as it’s the best compromise of fast/cheap/good as while switching to the larger picaxe in the sensor would likely be faster, we are also trying to keep the costs down as switching to the larger chip means essentially making the existing sensors obsolete, whereas switching to C and flashing the existing 08M2 chips back to their Pic baseline state means we can still use the existing kit.

 

Plus…. From a slightly more selfish viewpoint – C coding is a more sellable skill then Picaxe coding 😊

 

I’ve also started poking a little at maybe, possibly in the future coding an android app so that with a small usb plug in, you can use an android device as a med box/ref box as well as dedicated med/ref boxes. – But that’s for future development.

No comments:

Post a Comment