Max functionality in Min physical space

Jeremy Leach

Senior Member
This is just a pretty abstract idea to kick around ...

I like the challenge of getting the most out of limited resources, so was thinking: Could have an 08M (8 pin) and a 24LC512 EEPROM (8 pin) side by side on a 16 pin DIL forming a 16 pin logical 'device'. The EEPROM holds 'code' and the 08M holds a simple interpreter to run the code.

Ok, the idea of interpreting from EEPROM is not new and has been discussed before, but here I'm just wondering about the idea of maximum functionality from a picaxe system using the minimum of physical space. i.e what gets me is that with 64K bytes of 'code' on the EEPROM, it might be possible to do some quite amazingly complex things, even though it might be very slow. And there might be some apps where speed isn't the issue, and where this might actually be useful. And before anyone says 'just try it' I don't even know what to try ....it's just to see if anyone could think of any uses ;)
 

hippy

Technical Support
Staff member
I think you've already seen the two limitations; speed and need, then there's cost. Why use an 08M when a PICmicro would be faster, and if an 08M plus Eeprom costs more than a PICAXE which could do the job it's not cost effective, especially when put on a DIP carrier. Once an Eeprom is hooked up there's not a lot of I/O left.

It's a great idea, and nothing wrong with it; it is after all what a PICAXE really is, just not particularly useful in the real world ... although I'm sure someone could find a use in some applications.

I 'have a thing' for CPU design and one day I may even build a hardware CPU, but designing interpreters, Virtual Machines, and instruction sets has keept me happily amused so far. Embarking on such projects can teach people a lot; the balance between CISC and RISC, balancing chip abilities against instruction set, comparative architectures and a whole lot more.

One thing discovered early on is that it's a choice between a really simple design with a limited insruction set which requires a lot more simpler instructions and super-fast execution to get things done or a more complicated design withe more complex instructions which can do ore in less time. The challenge is in finding a balance between the two and there is a whole realm of possibilites. The real limit is what one can build or use. There's a whole other side as well in writing a software assembler or compiler and a bootloader to get the code into the system's memory.

There's an amazing degree of satisfaction when ones own interpreter adds one and one together and gives the correct result, but others may have more fulfillling lives :)
 

moxhamj

New Member
A few of my projects have run up to the limits of picaxe code space. 64K is nice. I'm playing with this http://www.instructables.com/id/Robot_Brain_Build_a_single_board_computer_in_an_e/

I must say it is nice to have 64k of ram, a meg of disk space, strings, floating point maths, file save, arrays etc, all running at compiled speed which is about 50x picaxe speed.

Picaxe relevant? Absolutely, because this board is going to go wireless and picaxe is the perfect device to do the low level handshaking via RF before handing over to the bigger (higher current consumption) board. A hybrid of old and new technology.

I don't know about eeprom and picaxe. I think you would need a good understanding of how the picaxe compiler works, for a start. You also may need lots of ram space...

But sorry, it does fail the "minimum space" test.
 

westaust55

Moderator
Basically in line (I think) with what Hippy is saying, The BASIC interpreter within the PICAXE could not directly interpret the data from the EEPROM.
You would have to write an interpreter in BASIC which would read in each byte, determine if it was an instruction token or a data value and act upon the data as read in.
Such things can certainly be done but think it is more of an academic project that commercial.
I went down that path of writing an interpreter in both C and Pascal to act as a new language many years ago. Great learning experience but unsure what you ultimately might use it for.

Speed would be very slow – as a wild guess, it would be akin to a PICAXE running a BASIC program at something like 0.25 MHz rather than 4MHz.

Someone mentioned recently that to establish i2c in a PICAXE needs (from memory here) about 84 bytes and in the case of an 08M you have also just used up 2 of the 5 IO. If you move up to an 18X at least the i2c comms handling is there in the PICAXE and you have 11 more IO for external interfacing.

Then there is the issue of how do you download the programs into your external EEPROM. Not impossible but adds to the hardware.
 

Jeremy Leach

Senior Member
Yes, the idea was to write a very simple interpreter in picaxe basic ...which is a topic touched on a number of times before. I think I agree with the conclusion that it's more an academic project and there might be some more fulfilling things to do (!) .... but there is still an outside chance someone might have an application. I admit that getting the 'code' into EEPROM and designing the code would be a problem in itself.
 

hippy

Technical Support
Staff member
@ Dr_Acula : That board looks nice, but that is perhaps its inherent downfall; a board - 22 IC's plus two crystal oscillator modules. There are numerous options to go for once one decides to go the Single Board Computer (SBC) route. Flavour of the month seems to be this one ...

http://beagleboard.org

Plenty of others available as well, right up to full PC systems on credit card sized boards capable of running Linux and/or Windows.

For "maximum from minimum", in the spirit Jeremy meant it, I don't think you can beat the PICAXE model ( which is why we're here ! ). A single chip solution with the Eeprom/Flash on board and interpreter as Firmware is an attractive solution, as is any micro with a bootloader and tools to use and program it easily. It's the 'next level of compression up' on what Jeremy suggested.
 
Last edited:

Michael 2727

Senior Member
If Rev-Ed removed all of the pre-loaded Tunes in an 08M could you shuffle that
space around for better use. That's my wish list. (keeping other tune functionality though)

"Play" 1, 2 or 3 is ok for the first 3 days but by then you want to write your own anyway.

08MX (in the tone of Homer Simpson) Mmmmmmmmmm !!!
 

Technical

Technical Support
Staff member
If Rev-Ed removed all of the pre-loaded Tunes in an 08M could you shuffle that space around for better use.
Nope, the play tunes are in program memory space in the 12f683, you can't write to that at run-time (PIC restriction) so would make no difference.
 

westaust55

Moderator
Yes, the idea was to write a very simple interpreter in picaxe basic ...which is a topic touched on a number of times before. I think I agree with the conclusion that it's more an academic project and there might be some more fulfilling things to do (!) .... but there is still an outside chance someone might have an application. I admit that getting the 'code' into EEPROM and designing the code would be a problem in itself.
I guess if you were to go down this path, it would be worth considering adding a Ramtron RAM chip as well. I am thinking about a FM24C16A (2k bytes) as a form of gLCD buffer.
See my post athttp://www.picaxeforum.co.uk/showthread.php?p=74767#post74767
For smaller apps, the FM24C04 with 512 bytes is another option. These are in SOIC8 format and pin compatible with the 24LCxxx series EEPROMs.
 
Top