Compile a .BAS file as an .HEX file and upload to PICAXE... Possible?

akard

New Member
Hi,
there is some possibilities to create a compiled .HEX (or like...) file from a .BAS file and upload it to PICAXE?
 

akard

New Member
yes but I must supply another people to upload the program in the picaxe without give him the source .bas code...
so I must give him only the compiled version of the software (hex version), not the source code (bas version)...
 

Buzby

Senior Member
You should have asked :

Hi, is there is some possibilities to create a compiled .HEX (or like...) file from a .BAS file, email it to a customer, who then uploads it to PICAXE?
Then the answer is no.

There is way of transferring a compiled file to another PICAXE, but it needs a specific circuit and a bit of VB or C program on a PC.

Cheers,

Buzby
 

akard

New Member
You should have asked :



Then the answer is no.

There is way of transferring a compiled file to another PICAXE, but it needs a specific circuit and a bit of VB or C program on a PC.

Cheers,

Buzby
this is very interesting... how?
 

nick12ab

Senior Member
yes but I must supply another people to upload the program in the picaxe without give him the source .bas code...
so I must give him only the compiled version of the software (hex version), not the source code (bas version)...
The PDF does not document any facility in the compiler that creates a binary or hex file from the PICAXE program. You will have to program a PICAXE while 'sniffing' the data lines to see what is being transmitted with the assistance of a second COM port. The transmitted data can be dumped to a file and a program which you'll have to make yourself can recreate the rest of the download process.
 

Buzby

Senior Member
Hi akard,

The specific circuit is that the target has to be an X2 PICAXE, with an external EEPROM on I2C.

You supply the customer with :
1 - A simple PICAXE program which accepts serial input and stores it in the I2C EEPROM.
2 - A program on a PC which sends the serial data.

After these programs run the PICAXE then executes a BOOTI2C and starts running the new code.

Rev-Ed have never promoted this idea, probably because it's gives access to the compiled code, which is a big step towards reverse engineering it !.
( I'll let you work out how to get the data to send, and it's a *lot* easier than sniffing the comms lines ! )

Cheers,

Buzby
 

Buzby

Senior Member
Clive said :
And that code is specifically written to be user readable -
So the assembler is great for educational use, ( that's what PICAXE is designed for ), but not much use for keeping your IP safe.
 

Technical

Technical Support
Staff member
PE6, when released, will have an updated assembler code export option. This will allow 'raw PIC code' to be exported from PICAXE BASIC.
 

srnet

Senior Member
So a commercial user will have no need to purchase PICAXE chips anymore ?

(assuming they dont want the end user to be able to re-program the product)
 

Technical

Technical Support
Staff member
Correct. Obviously compiled BASIC will be quite different (e.g. no debug etc. features via the download cable) but can also be modified to merge assembler libraries (e.g. floating point) etc.

PE5 already has an introductory (but very dated) version of this via the 'Convert BASIC to assembler' function, in PE6 this will be greatly expanded and updated for modern generation PIC silicon.
 

Buzby

Senior Member
... Obviously compiled BASIC will be quite different ... but can also be modified to merge assembler libraries (e.g. floating point) etc.
Does this mean an inexperienced user could 'brick' a real Rev-Ed PICAXE ?.

( I'm not bothered about people 'bricking' knock-off clones, but I wouldn't want to see the forum filling up with even more 'program won't download' questions. )
 

Jeremy Harris

Senior Member
Does this mean an inexperienced user could 'brick' a real Rev-Ed PICAXE ?.

( I'm not bothered about people 'bricking' knock-off clones, but I wouldn't want to see the forum filling up with even more 'program won't download' questions. )
If I've understood things correctly (not that easy as I think a whole raft of posts here have been deleted recently) then the compiled code from the new PE6 will have to be downloaded to a bare PIC, using a PIC programmer, rather than a Picaxe with the built-in interpreter.
 

Buzby

Senior Member
Yes, the deleted posts did say that the assembled code goes into a raw PIC.

My concern is that the whole 'new' PICAXE system might be based on this idea, i.e. no firmware.

Can Rev-Ed at least confirm that there will be no way, using PE6 alone, to brick a PICAXE ?.
 

Technical

Technical Support
Staff member
To program assembler programs you need a PIC programmer like a Microchip PICKit and also third party software like MPLab to compile your assembler/drive the PIC programmer (when you program the raw PIC). So it's a completely different process and experience to programming a PICAXE chip via the AXE027 download cable. It's not even a PICAXE system at all, so no, you cannot damage a PICAXE chip - unless you deliberately take it way and put it in a PIC programmer. This has always been the case in the past as well, so nothing new there.

Assembler is really designed for advanced/commercial users who want to go that step further, it's not for most beginners. The principle difference is for those advanced users who in the past would have needed to purchase an expensive third party BASIC compiler and learn a different BASIC dialect. With PE6 they won't need to, although they will still need to purchase a PIC programmer.

PE6 simply has an 'export to assembler' button. After that it is up to you how you use the assembler. PE5 has always had this exact same menu and its never caused confusion in the past, so there is no reason why it should do so now.
 
Last edited:

Jeremy Harris

Senior Member
As I said in a post that's now been deleted (for a reason I'm not at all sure of), I think this is a great step forward. The ability to develop a programme using a Picaxe, test it, iron out the bugs etc, then move on to explore that same code using a compiler and see how it translates into assembler has to be a really powerful educational tool. Depending on the performance difference I think it may also be a powerful tool for hobbyists, too.
 

Buzby

Senior Member
Thanks for the clarification. I think I've got it now.

Simple users, like me, will still use PE, AXE027, with Rev-Ed firmware in PICAXE chips. We will be nannied, won't be able to break anything.

Other users will use PE with extensions, ~MPLab, a PIC programmer, and raw PICs. They will have free reign, and can do anything.

Is that right ?

Cheers,

Buzby
 

Buzby

Senior Member
... Depending on the performance difference ...
That's a big question. Just because it's in assembler doesn't mean it is always faster.

I'm not sure that the assembler output of PE would be optimised with the sort of clever stuff going on inside the firmware.

Rev-Ed have said '... that code is specifically written to be user readable ... ', which is a good idea for education.
This will show one way that high level BASIC structures translate into registers and flags, but whether that is the best way for speed is another matter.

My concern is that if the 'new' PICAXE is too open it will lead to the fragmentation that has plagued products like Arduino and Micromite, and, many years ago, MSX computers.
 

Technical

Technical Support
Staff member
My concern is that if the 'new' PICAXE is too open
We think you're missing the point, nothing is actually new and it is not a 'PICAXE' feature. So "'new' PICAXE" is not a good description. Nothing with regards to PICAXE use changes.
There has always been an assembler export option in PE5, PE6 just makes it better that the (10 year old out-of-date) PE5 version!
Compiled assembler will always be much faster as the interpreter is removed.
 

srnet

Senior Member
Well all good news.

I guess even normal hobby users will start buying PICAXEs for 'development' and then use the much cheaper PICs for finished projects.

And no doubt will be after support when the PIC running the compiled program does not quite behave in the same way as the original PICAXE.
 

Jeremy Harris

Senior Member
The main problem is that this thread has now got me fired up and very keen to see PE6!

No pressure, but it would be great if it was to come out fairly quickly, as I can immediately think of two projects where I would very much like to have a play with compiled code.
 

Buzby

Senior Member
The main problem is that this thread has now got me fired up and very keen to see PE6!
It's not assembler for PIC that I want to see most in PE6, just better tools to work with the PICAXE we have now.

Part of the fun is trying to 'push the PICAXE envelope', it's not much fun if the solution is 'use a different envelope' !.
( If I was a commercial user my view might be different. I've seen what difference a small hardware saving makes to a product with 100,000 sales per year.)

What I would really like to know is if there is going to be an X3 addition to the PICAXE family, introduced at the same time as PE6.
The length of time since PE6 was first mentioned has been plenty enough to write an assembler and tweak the editor and simulator, so I've got a suspicion that the long time is because PE6 is being built to support a new PICAXE generation, as well as the M's and X's we have now.

Rev-Ed are not a huge faceless company like the big boys. Rev-Ed have a very close relationship with their users, the regular input from Technical and hippy on this forum is testament to that. It would be a vote of confidence if Rev-Ed could confirm or deny that a new PICAXE baby is due.

Cheers,

Buzby
 

John West

Senior Member
The more I read, and the more I see Rev. Ed. actually DO, the more I'm impressed with the PICAXE line and the the company as a whole. You guys really do care. That's a rare business model these days, and one that requires sheer genius to maintain. My hat's off to you. I think I'd better buy some more "stuff."
 

jedynakiewicz

Senior Member
The more I read, and the more I see Rev. Ed. actually DO, the more I'm impressed with the PICAXE line and the the company as a whole. You guys really do care. That's a rare business model these days, and one that requires sheer genius to maintain. My hat's off to you. I think I'd better buy some more "stuff."
Somewhat off topic, but I would like to reflect that sentiment entirely. Rev.Ed. is a superb company to deal with. Their products are so well supported; it is quite astonishing just how much resource they commit to that aspect. When I started getting into PIC technology some years ago I went through the well-tramped pathway of starting off with an off-the-Maplin-shelf programmer; waded through books on assembler; looked at range of higher level languages with compilers; bought another programmer because I thought it might be a bit better but then regretted it because I misunderstood what it could do...and so forth. Then along came PICAXE and I moved forward suddenly with astonishing speed in what I could achieve. Educationally, economically, sales, support, documentation, just about in every respect, I have found the PICAXE route unparalleled. Long may it continue and the sooner we get our new toys (PE 6) the better. (That is one thing that RevEd perhaps should not do; keep us all on tenterhooks for so long... Like many others on this forum I almost wish that they had not told us of PE6 so long ago - patience and anticipation just give way to frustration).
 

Paix

Senior Member
Should we be checking significant dates?

22 May comes readily to mind as that was the date in 1996 when Revolution Education was registered with Companies House.

Birthdays of significant leading lights, Technical, Hippy etc?

Will it be a baby boy or a girl? The statements are becoming increasingly positive . . . "PE6 just makes it better". Not, "PE6 will just make it better". Technical IS playing with product . . . Hmmmmmmm.
 

russbow

Senior Member
(That is one thing that RevEd perhaps should not do; keep us all on tenterhooks for so long... Like many others on this forum I almost wish that they had not told us of PE6 so long ago - patience and anticipation just give way to frustration).
Ah, but they invited all of us to submit suggestions for PE6 improvements. Things have moved on a lot in the past 10 years and to be given an opportunity to contribute to the changes is another mark of customer service.
 

PADJ

Member
Ah, but they invited all of us to submit suggestions for PE6 improvements. Things have moved on a lot in the past 10 years and to be given an opportunity to contribute to the changes is another mark of customer service.
Only if it leads to actual change. It's been 15 months since the Wishlist thread was started, and there hasn't been much change.
Some get frustrated, others move to alternative platforms.
 

Hemi345

Senior Member
What I would really like to know is if there is going to be an X3 addition to the PICAXE family, introduced at the same time as PE6.
The length of time since PE6 was first mentioned has been plenty enough to write an assembler and tweak the editor and simulator, so I've got a suspicion that the long time is because PE6 is being built to support a new PICAXE generation, as well as the M's and X's we have now.
I keep seeing these posts anticipating a new M3 or X3 line and wonder what all you're wanting that isn't currently offered in the existing line? Faster speeds? Decimal math?
 

Buzby

Senior Member
We have never had a wishlist for new firmware features, only for new things we would like to see in PE.

If a firmware wishlist was added, then my first request would be strings !.
 

srnet

Senior Member
If a firmware wishlist was added, then my first request would be strings !.
Dont start ....

In a minute or two, the doomsayers will chip in saying how completely wrong the Rev Ed business model is and how they must compete with the well known "A" product or we all doomed ......
 

John West

Senior Member
Actually, I'd almost rather learn to do tricks (like offsetting numerical values when doing math calculations to avoid negative numbers,) with the straightforward command set we now have in the PICAXE than to learn a bunch of new commands with convoluted bells and whistles that only apply in certain circumstances. A simple foundation is a solid foundation.
 

PADJ

Member
In a minute or two, the doomsayers will chip in saying how completely wrong the Rev Ed business model is and how they must compete with the well known "A" product or we all doomed ......
I think it is clear that RevEd/Clive know they need to change.
Maintaining the base PICAXE products and adding optional advanced features may just do it. But it's a big task for his very limited resources.
 

DamonHD

Senior Member
I keep seeing these posts anticipating a new M3 or X3 line and wonder what all you're wanting that isn't currently offered in the existing line? Faster speeds? Decimal math?
More code memory and better power management together (ie >4kB in one segment + nap + wake-from-nap interrupts maybe): I've currently filled an 18M2+ to bursting even with all my code ticks of nearly 30 years and I'm having to start on AVRs at least for a parallel stack.

Maybe even better build tools (libraries and linking): I've had to sort of re-invent the concept to get my stuff done.

Rgds

Damon
 

srnet

Senior Member
More code memory and better power management together (ie >4kB in one segment + nap + wake-from-nap interrupts maybe): I've currently filled an 18M2+ to bursting even with all my code ticks of nearly 30 years and I'm having to start on AVRs at least for a parallel stack
What current consumption were you getting in NAP on the 18M2 and what were you getting if you ran the 18M2 as normal but with the clock speed reduced to 31khz ?
 
Top