Hi from new member, and a few Q's

Texy

Senior Member
Hi folks, first post here !

I,ve been working on my own design of an altimeter using the popular MPX4115 pressure sensor and a 16F88
and LCD display. I 'cheated' with the maths by using a lookup table within the programming memory of the
16F88. Anyway I got it basically working, but wanted to add more features. This was all programmed in
assembler using MPLAB and an ICD2. Whilst programming in assembler is very efficient code-wise, it is of course very
time consuming, so I started at looking at higher level language programming for the Pic. Wasn't prepared to
learn C, or pay for PicBasic, so very please to find the PicAxe. I,ve ordered some bits including a PicAxe-18X
and will start experimenting as soon as they arrive. Now onto my questions -

I see there is a few threads concerning 433mhz data transmission. As it happens, the company I work for use
Radiometrix TX2/RX2 modules - purely for very short range use. I,d like to use these with my altimeter. Are there
some code examples around for both TX and RX side? Is it as simple using the SERIN/SEROUT commands
to send a data string?

Its not all that clear how to store larger areas of data in program memory, ie larger than 256 bytes, and also
how to read that memory (for address ranges over 0xFF).
My purely 16F88 version started the lookup table at address 0x600 - is it possible
to do the same with the Picaxe-18X ? Again, are there some code examples as the ones in the manual are
a bit vague - see the Table and Eeprom descriptions. Which brings me onto another related question -
why isn't Table supported by the Picaxe-18X, as the 16F88 has read/write program memory ability?

That'll do for now, although I,m sure there will be others.
TIA,

Texy
 

moxhamj

New Member
Yes it really is as simple as using serin and serout. And you can use a huge range of different radio modules. Use the ones you have.

Storing larger data than 256 is a bit more complex. If the data is static eg lookup tables, you can use the I2C bus and serial eeproms. There are examples in the help manuals. I believe there are serial ram chips as well though these seem to be used less and I'm not sure if there are some code examples around. Someone will post one I'm sure.

It would be great if Table was supported on the 18X. But you can work around that. Or use the bigger picaxe chips. I started my picaxe experiments with an 08M. Now I have samples of all the types in the parts drawer and I pull out the right one for the job. You can easily port most code from one to the other.

Keep posting questions. Others have built similar projects to this and I'm sure they will post some very helpful replies.
 

hippy

Technical Support
Staff member
You may find the PICAXE's more limiting than the 16F88, especially if looking for large lookup tables or a lot of data storage, that's the price of the simplicity of programming you gain.

I2C is an easy way to add lookup tables but does create a multi-chip solution. If you are prepared to accept that, you could go for a PICAXE plus 16F88 solution as you obviously know what you're doing there. You can have the 16F88 process the sensor, do any conversions and pass the data to the PICAXE, take whatever the PICAXE sends back and put that on the LCD. There are other configurations I'm sure you can think of to suit what you want to do; you can think of the 16F88 as a smart peripheral for the PICAXE or vice-versa.

As to why the PICAXE-18X doesn't support TABLE - that's likely down to having just 4K of Flash, 2K used for downloaded program leaving just 2K for the firmware interpreter. There's probably no space left in the firmware to add support for it.
 

Texy

Senior Member
Thanks for the quick reply guys.
Ah - I hadn't considered
a..that the code is interpreted, and not compiled (by the editor software),
and that
b..the interpreter is stored on the chip (as part of the bootloader?).

Of course the only reason I used a look-up table at all is the complex maths involved with converting the VO of the sensor into 'feet', which I couldn't/or didn't program in assembler. The PicAxe Basic may be able to aleviate the
program complexity - I,ll have to do some more research.
I,d rather not 'upgrade' to a larger pin-count PicAxe just to get better programming functionality as I don't need the increased I/O pins, but we will see;)

More Q's to follow, I,m sure.

Texy
 

moxhamj

New Member
What sort of complex maths are you doing? Maths in machine code is really hard, but the picaxe has some great math functions which can really shorten the code. The output of a sensor converting into feet might only be a few lines - multiply by a constant to use the full integer range of 0-65535, then divide by another constant to get feet. Those two constants would be integer values and you could work them out on a calculator.

If it is a non linear response, there are still ways to put lookup tables into eprom.

Please let us know as I have seen some amazing shrinking code on this forum when 20 or 30 people go to work on a problem!
 
Top