Compiler/assembler by Revolution

binary1248

Senior Member
I am fiddling with a project that is going to require fast execution beyond what my current PicAxe chips are capable.
I wish Revolution provided a true compiler/assembler. It could be configured to only work with PicAxe chips by assuring the chips be preprogramed by revolution (as they are now configured) with a bootloader, thus preventing unscrupulous persons from buying microchips directly from other suppliers.
.
Am I wrong or is their such a compiler available. I want to debug the code in the current basic/picaxe structure but be able to program the chip with assembly code.
Paul
.
.
Looks like I misspelled in the title, but can't seem to edit.
Corrected by Martin, thanks.
 
Last edited:

Buzby

Senior Member
I think you've got a long wait for assembly in PICAXE.

If there was was an assembly option it would let anyone write a 'dump ROM' routine, and all Rev-Ed's secret code would be out in the open.

Cue lots of fake chips, and no end of 'my chip won't work' posts in the forum. :)

If PICAXE aint fast enough, you need a different chip. ( Not beginning with 'A', hopefully )

Cheers,

Buzby
 

binary1248

Senior Member
Buzby,
To protect the PicAxe I would like to see, as stated above, some way that the compiler would work only with PicAxe chips.
It could be configured to only work with PicAxe chips by assuring the chips be preprogramed by revolution (as they are now configured) with a bootloader,
Well, PicAxe has spoiled me and made me lazy. I have looked at compilers but the complexity and support equipment (IDE) has me wishing for the simpler days, Write, Compile, Program, Run, Debug in circuit.
 

stan74

Senior Member
I typed free basic pic compiler into google and use the 1st one that comes up on my pc for coding pic and atmega. It's just like picaxe basic but generates real assembler you can see with the equivalent asm after each line of basic.new V0.97 is out march 1st.
you can reprogram the pins on a pic..honest.Totally free. Try it. Sorry re and arduino c++ users ..sketches bah
sort you crt clock out. look on sourceforge
 

techElder

Well-known member
I typed free basic pic compiler into google and use the 1st one that comes up on my pc for coding pic and atmega
Stan, that isn't exactly helpful to the OP. Could you provide a name or a link to that product?
 

julianE

Senior Member
I typed free basic pic compiler into google and use the 1st one that comes up on my pc for coding pic and atmega. It's just like picaxe basic but generates real assembler you can see with the equivalent asm after each line of basic.new V0.97 is out march 1st.
you can reprogram the pins on a pic..honest.Totally free. Try it. Sorry re and arduino c++ users ..sketches bah
sort you crt clock out. look on sourceforge
I tried the mentioned compiler and though good it's no picaxe basic. I too would be willing to pay a premium price for the convenience of picaxe basic if there were a way to protect it on the chip. I just ordered 20 more picaxe chips to replenish my supply and though more expensive then the raw chips it's well worth it in time saved. I seldom need the speed but a lot of the fancy new modules need it.
 

srnet

Senior Member
Buzby,
To protect the PicAxe I would like to see, as stated above, some way that the compiler would work only with PicAxe chips.
So how would you prevent a suitable bit of assembler reading and printing out the contents of the chip ?

Even assuming it were possible, there must be a good reason why its not been done after all these years, so its a safe bet its not going to be done.
 

Buzby

Senior Member
If you had a decent 3rd party BASIC compiler for PIC, you could write macros to emulate each PICAXE instruction. Then you could compile PICAXE BASIC .txt files. ( Probably best to use the output from the pre-compiler. )

A lot of work, but would it be worth the effort ?

Cheers,

Buzby
 

Jeremy Harris

Senior Member
This topic comes up fairly regularly here, and I think that there is a longer term plan to include a way to compile Picaxe BASIC in the future development of PE6. About a month ago I posted this: http://www.picaxeforum.co.uk/showthread.php?29657-Picaxe-what-next&p=306948&viewfull=1#post306948 and the reply from Hippy to that post suggests it is still in the pipeline, although not an urgent priority.

I can understand that, as the major focus for Rev Ed is education, and there's probably no significant demand from that sector for a compiled code option.
 

stan74

Senior Member
I tried the mentioned compiler and though good it's no picaxe basic. I too would be willing to pay a premium price for the convenience of picaxe basic if there were a way to protect it on the chip. I just ordered 20 more picaxe chips to replenish my supply and though more expensive then the raw chips it's well worth it in time saved. I seldom need the speed but a lot of the fancy new modules need it.
I didn't mention the names of the free compilers I use except they're free and got basic in the name...like free and basic. The one compiler is written with the other. OK.. symbol is define, high c.1 is set c.1 on and a few other differences but the learning curve is the same. I bought an arduino 2 weeks ago, connected it and flashed a program converted from picaxe and worked first time. I couldn't do that in c++. I can program my RPi with basic not python and it runs 50 times faster. But this isn't the place to discuss it. There was a thread a few months ago..picaxe,what's next and a few people agree with me. I'm sorry to say it but if you can't use the compiler I hinted at then you might as well give up. I just loaded google chat if you want to discuss this. Show me a picaxe program and I'll convert it.That's how I learned picaxe from other basics. Your loss.
 

stan74

Senior Member
This topic comes up fairly regularly here, and I think that there is a longer term plan to include a way to compile Picaxe BASIC in the future development of PE6. About a month ago I posted this: http://www.picaxeforum.co.uk/showthread.php?29657-Picaxe-what-next&p=306948&viewfull=1#post306948 and the reply from Hippy to that post suggests it is still in the pipeline, although not an urgent priority.

I can understand that, as the major focus for Rev Ed is education, and there's probably no significant demand from that sector for a compiled code option.
I can't see picaxe changing..education is in the name but they don't teach students to use valves any more..You don't put I can use picaxe basic on a cv
 

stan74

Senior Member
julianE,get a uno for a few quid,it's easier than a pic and pickit 2 although that's integrated in the ide.just plug n play, no chip on breadboard or pickit needed,that saves £15, pins have sockets,crystal oscillator fitted,powers off usb. Bought my 1st 2 weeks ago with an acrylic clear case,20 multi coloured jumpers and a usb lead for £7 and haven't downloaded the arduino ide c++ malarky. No d-a on uno though. If I hadn't found these I'd probably not bother programming chips or my Rpis. I've built robots which have pauses in the code with picaxe and posted how fast it was to do but now I need fast code. I guess I've spent 80 quid on stuff from rev ed so not moaning and couldn't do what I can now without using picaxe but I could say that about the zx81 "I owe it all to clive sinclair"
 

Circuit

Senior Member
Am I wrong or is their such a compiler available. I want to debug the code in the current basic/picaxe structure but be able to program the chip with assembly code.
Technically speaking, there is such a device; the PICAXE store still lists the "legacy" device BAS800 (http://www.picaxestore.com/index.php/en_gb/bas800.html). This is a serial PIC programmer that works with Programming Editor v. 5. It does what you require; it compiles PICAXE BASIC into Assembly language and then downloads the program to a bare PIC. The downside is that it is truly a legacy device; I seem to recall that it will not work on 64-bit systems and it there is a very limited selection of PICs that it will compile for. Nevertheless, the bare PICs are available. My installation shows the following options menu;
BAS800 PIC options.JPG[

The limited range of chips and the cost in relation to current PIC programmers such as the PICkit range rather limit the value for money of this device. Obviously the development costs are tucked away in the cost of the programmer.
Obviously it would be superb if this feature of PICAXE Programming Editor 5 was carried over into version 6 and allowed programming via a PICkit 3 or similar. There were promises of this when version 6 was launched but it remains a "future feature". It is difficult to see how an economic model could be created to finance the development and implementation of such a feature.
 

Rick100

Senior Member
It's not a compiler or a real assembler but the PE 6.0.9.0 added support for some kind of teaching assembler on an 18m2.
http://www.picaxe.com/Teaching/Eduqas-WJEC-A-Level-Assembler/

From the page:
Note that the PICAXE-18M2 chip is emulating a 16F88/assembler and so the chip does not operate at quite the same speed as a PIC programmed in raw assembler code.
I'll bet.:)

It does show that RE puts their efforts into the education market, and who can blame them.
 

julianE

Senior Member
julianE,get a uno for a few quid,it's easier than a pic and pickit 2 although that's integrated in the ide.just plug n play, no chip on breadboard or pickit needed,that saves £15, pins have sockets,crystal oscillator fitted,powers off usb. Bought my 1st 2 weeks ago with an acrylic clear case,20 multi coloured jumpers and a usb lead for £7 and haven't downloaded the arduino ide c++ malarky. No d-a on uno though. If I hadn't found these I'd probably not bother programming chips or my Rpis. I've built robots which have pauses in the code with picaxe and posted how fast it was to do but now I need fast code. I guess I've spent 80 quid on stuff from rev ed so not moaning and couldn't do what I can now without using picaxe but I could say that about the zx81 "I owe it all to clive sinclair"
Thanks Stan for your generous offer to help with the compiler. That's the reason I like Picaxe so much, it's this forum and the very helpful habitue. It's truly a unique place. Every time I open the forum I learn something. I did not know that basic existed for Rpi, I've been using python on pi and had no idea that there was a faster way until you mentioned it. I do have an assortment of platforms, duino, micromite,avr and others. I have the Pickit 3 and an assortment of raw picaxe chips and offerings from atmel with the atmel programmer.

I can't get over the brilliance of people on this forum, I never heard of the Curta calculator so I called a friend that's a physicist and asked him about it, he has never heard of it either, granted he's only middle aged. I once mentioned a need for a proto board and one of the forum members shared his without hesitation. Beautifully designed board that's a joy to use. I posted questions about an oddball gradiometer sensor, within days the brain trust of this forum had the datasheet deciphered for me and I was getting readings from the sensor. I could go on and on.
 

stan74

Senior Member
RE says inline assembler but I was disappointed to find it wasn't in pe6 so downloaded pe5 then found you need a special programming board then found it's interpreted assembler. If there was real assembler then the forum would be overloaded with assembler code problems. The idea is a popular request. When home computers came with basic on rom utility programs written in machine code could be called from within basic to control a port or do fast screen graphics or software scroll and generally add the features basic lacked.
Picaxe is fine for the majority of users who don't mess with hardware that needs fast repetitive calculations.
hippy said else ware picaxe does a command in 15us and I 'think' a 20MHz pic takes 2us but assembler seems more than 8 times faster.
 

stan74

Senior Member
You got all the gear to have a go julianE. Freebasic for the rpi but get the FBide to cos it's command line. Compiles arm code or on windows x86..yes it came out for windows ages ago..no,I'd never heard of it either. Great Cow Basic for pic/avr was compiled with FreeBasic! Nice instant load ide. I found a bug in v0.96, couldn't read arduino a-d. I got a few apologies for that and early rc.
Have you really out grown picaxe? What can't it do for you?
 

julianE

Senior Member
Have you really out grown picaxe? What can't it do for you?
I haven't outgrown the picaxe. There was a time that I wanted to use a microcontroller for radio control airplanes but that has come and gone.
Other platforms have their place, I like the NEC remote control better on duino. I do like using the esp8266 with the picaxe a lot but will try to get better with esp8266/lua combo. There is so much to learn.
 

stan74

Senior Member
julianE, do you mean arduino modules aren't plug and play with picaxe..like the oled is associated with sardino or Rhapsody Pi like all the electronic hobby stuff on ebay. Most stuff works with picaxe but not on a plate. There's libraries for glcds but not picaxe so I wrote my own to mess around with but whereas on other systems my code would do what the glcd library would do and take the same space it's too slow to be of much use on picaxe. so..What you think about fb or gbc.. I think the same about C++ and python. If I could do c++ I wouldn't be here now. microchip say their chips are optimised for c compilers...er?
 

binary1248

Senior Member
From another post by Hippy:
PE6 is still intended to include the capability, it has simply not happened yet. Unfortunately, as is the way with the world, other things come along and sometimes have higher priority. So still coming, but I am afraid I do not have any knowledge or estimate of when that will be.
To protect Revolutions "pay per chip" (which I totally agree with), in addition to using a protected boot loader, I would be willing to pay a yearly fee for a true PicAxe assembler. I too love the robustness and ease of the picaxe development system and the great manuals with easy instruction lookup index (interactive). Even if I go to another method to create machine code, I will always use the current picaxe for code that does not require speed (90% of my projects do not need speed)
Paul
 

srnet

Senior Member
To protect Revolutions "pay per chip" (which I totally agree with), in addition to using a protected boot loader
So please answer the basic question; how exactly would a 'protected bootloader' be implemented ?

Are you sure it is possible, or do you just hope it is ?
 

pxgator

Senior Member
To protect Revolutions "pay per chip" (which I totally agree with), in addition to using a protected boot loader, I would be willing to pay a yearly fee for a true PicAxe assembler. I too love the robustness and ease of the picaxe development system and the great manuals with easy instruction lookup index (interactive). Even if I go to another method to create machine code, I will always use the current picaxe for code that does not require speed (90% of my projects do not need speed)
Paul
I totally agree....I would not mind paying a fee either. As it stands now Picaxe is always my first choice but sometimes it's simply not fast enough. Then it's either Arduino or Teensy. I would love to be able to always use Picaxe. The ease and convenience of the Picaxe system is just great and a PE6 that had floating point and a true Basic to ASM compiler would be fantastic.
Cheers to All
 
Last edited by a moderator:

hippy

Technical Support
Staff member
RE says inline assembler but I was disappointed to find it wasn't in pe6 so downloaded pe5 then found you need a special programming board then found it's interpreted assembler.
The Convert to Assembler functionality in PE5 creates native assembly language and .HEX files which execute natively on a PICmicro chip; it is not interpreted. The functionality is limited, supports only some PICAXE Basic commands, generates native code only for a few PICmicro chips, and requires the BAS805 programmer.

The BAS805 is a legacy product which is primarily intended for schools which have used it in the past.

Similar, Convert to Assembler functionality, is planned for PE6, but I cannot add any more than has already been said about when that may arrive. I know of no intention to add inline Assembler to PICAXE Basic and do not believe we have ever claimed that we do or would support that.
 

stan74

Senior Member
Limited indeed hippy. 12 byte variables only I read..or was it 20. Seems this has been going on long before I joined the forum. Must get boring hearing it.
 

GrahamGo

Senior Member
I found this thread searching for anything on the WJEC assembler. Which shows up PE6. There are some Tutorials and a micro eg. PICAXE 18M2(WJEC-Assembler). There is a syntax error when trying to simulate.
Is this a coming product? I cannot seem to be able to purchase the special PICAXE 18M2(WJEC-Assembler) micro plus there is no mention of it in the Forum.

I am just curious. I would really only be interested in an inline assembler capability, I am a long term Forth code user and this is one feature that I wish was available.
 

hippy

Technical Support
Staff member
I found this thread searching for anything on the WJEC assembler. Which shows up PE6. There are some Tutorials and a micro eg. PICAXE 18M2(WJEC-Assembler). There is a syntax error when trying to simulate.
Is this a coming product? I cannot seem to be able to purchase the special PICAXE 18M2(WJEC-Assembler) micro plus there is no mention of it in the Forum.
Support for WJEC Assembler is included in the latest version of PE6.

This is not a native assembler, it is similar to the earlier AQA and OCR assemblers and allows students to code in Assembler and run that code on a PICAXE-18M2. Behind the scenes the compiler converts the WJEC assembler to PICAXE basic equivalents and runs that. There is no 'WJEC micro' as such; that is a normal PICAXE-18M2.

Most students using WJEC, AQA or OCR assembler will be doing so as part of their school curriculum courses and would approach their teachers to resolve issues rather than come to the forum.

If you are encountering a simulation error; if you could let us know what with, what the code is which is proving problematic, then we can advise on that and investigate further if we need to.
 

GrahamGo

Senior Member
Hi, thank you. I was only enticed by the thought of using some assembler to gain some speed, but if the assembler input is run as Basic, then I guess its not for me. It looks nice though! Cheers.
 

jims

Senior Member
I'm a old timer (been retired 29 years) who has been having fun with Picaxe for several years. No real programming background, but I like to learn new things. I really don't understand what's going on with the discussions about "compiler vs assembler" etc. Have googled (compiler vs assembler) but I'm not sure if the changes discussed in this thread would help me to do a better job with my Picaxe projects. Also...what is the "WJEC Assembler" that Hippy talks about? Thank you, JimS
 

bpowell

Senior Member
I'm a old timer (been retired 29 years) who has been having fun with Picaxe for several years. No real programming background, but I like to learn new things. I really don't understand what's going on with the discussions about "compiler vs assembler" etc. Have googled (compiler vs assembler) but I'm not sure if the changes discussed in this thread would help me to do a better job with my Picaxe projects. Also...what is the "WJEC Assembler" that Hippy talks about? Thank you, JimS
It confuses me as well...

An "Assembler" Takes Assembly code (hardware / platform specific code) and converts it to object-code, or "machine code" in PIC world, it takes assembly instructions like "MOVLW 0xD" and converts them to their HEX equivalent: "30 0D". In PICAXE, there is no assembly taking place.

A "Compiler" takes one language, and converts it to another language. That's all it does. PE6 could be called a "Compiler" because it takes PICAXE basic, and converts it into the tokens that are sent to the PICAXE chip itself. There is no "Assembly" taking place here....as we don't send machine-code to the PICAXE chip. The compiler is a small part of a bigger process called "Compiling"...Compiling really involves: Pre-processing, compiling, assembling, and linking...but that's out of scope of this discussion.

All PICAXE chips are already running a program on them, the PICAXE interpreter...this program was written, Compiled into Assembly, Assembled into Machine Code, and loaded onto the chip. That is what we call the "Bootloader" but it's much more than that...it's the program that runs, takes the code *we* download to a PICAXE, and runs that code. The issue is, there is a sacrifice in speed...as OUR program is actually running ON TOP of another Program...so OUR program can never run at the full speed the chip is capable of, because the chip is busy running the PICAXE Interpreter.

The WJEC Assembler is a misnomer...it's really just the PE6 Compiler doing what Compilers do (that is, converting one language (in this case, Assembly) into another language (PICAXE tokens))...so while you get the knowledge and practice of writing a program in Assembly, you don't see any performance improvement, because the assembly is converted to PICAXE Tokens, and sent to the PICAXE Chip just as a program written in PICAXE Basic would be.

What is being discussed in this tread, is a desire to take a program written in PICAXE basic and to have the PE Programmer Compile that program all the way down to Machine code...and then be able to load that code onto a "Raw" PIC chip (that is, a PIC chip that does NOT have the PICAXE interpreter already loaded onto it)...that way, the resulting program would be able to run at the full speed possible from the CHIP, as it would not be a "Program running on top of a program".
 
Last edited:

jims

Senior Member
It confuses me as well...

An "Assembler" Takes Assembly code (hardware / platform specific code) and converts it to object-code, or "machine code" in PIC world, it takes assembly instructions like "MOVLW 0xD" and converts them to their HEX equivalent: "30 0D". In PICAXE, there is no assembly taking place.

A "Compiler" takes one language, and converts it to another language. That's all it does. PE6 could be called a "Compiler" because it takes PICAXE basic, and converts it into the tokens that are sent to the PICAXE chip itself. There is no "Assembly" taking place here....as we don't send machine-code to the PICAXE chip. The compiler is a small part of a bigger process called "Compiling"...Compiling really involves: Pre-processing, compiling, assembling, and linking...but that's out of scope of this discussion.

All PICAXE chips are already running a program on them, the PICAXE interpreter...this program was written, Compiled into Assembly, Assembled into Machine Code, and loaded onto the chip. That is what we call the "Bootloader" but it's much more than that...it's the program that runs, takes the code *we* download to a PICAXE, and runs that code. The issue is, there is a sacrifice in speed...as OUR program is actually running ON TOP of another Program...so OUR program can never run at the full speed the chip is capable of, because the chip is busy running the PICAXE Interpreter.

The WJEC Assembler is a misnomer...it's really just the PE6 Compiler doing what Compilers do (that is, converting one language (in this case, Assembly) into another language (PICAXE tokens))...so while you get the knowledge and practice of writing a program in Assembly, you don't see any performance improvement, because the assembly is converted to PICAXE Tokens, and sent to the PICAXE Chip just as a program written in PICAXE Basic would be.

What is being discussed in this tread, is a desire to take a program written in PICAXE basic and to have the PE Programmer Compile that program all the way down to Machine code...and then be able to load that code onto a "Raw" PIC chip (that is, a PIC chip that does NOT have the PICAXE interpreter already loaded onto it)...that way, the resulting program would be able to run at the full speed possible from the CHIP, as it would not be a "Program running on top of a program".
Thank you...bopowell. Great explanation!!! I think that I now understand. JimS
 
Top