Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18

Thread: What's in a PicAxe?

  1. #1

    Default What's in a PicAxe?

    Forgive me if this is an old question, if it is perhaps someone can direct me to an answer... The question goes like this - once upon a time I used to program PICs using Assembler. This was a masochistic passtime but I was paid for it! The PICs were destined for automated test gear and had to be rigorously controlled in both hardware and software to prevent the manufacturer making revisions that would invalidate all sorts of things. When I was free to choose hardware for my own projects I wanted to get away from Assembler (I flirted briefly with C - very briefly :-) then found the PicAxe. Since I was used to PICs this was a logical progression.

    But now I've got to wondering, just what is the PicAxe architecture like? The hardware is defined and is a PIC which implies that the embedded software is different. So what happens to the program I write, how does it become machine code? I read references to a compiler. The code written in Assembler for a PIC is assembled into machine code then loaded into the PIC hardware. Does the PicAxe compiler create machine code directly or some intermediate code that the PicAxe then operates on (I've written compilers that have done both). If, on the other hand, the Basic code is loaded into the PicAxe then it's not compiled but interpreted - I'm guessing this doesn't happen because it would be awfullllllllly slow. So, is the PicAxe a PIC with extended software - there must be something going on because of the differences between the PIC and PicAxe functions available. If so, is the PicAxe embedded software in any way revision controlled and do we get to know when revisions change? Educate me please...

  2. #2
    Senior Member
    Join Date
    May 2012
    Location
    Berwick Upon Tweed
    Posts
    821

    Default

    Quote Originally Posted by whiteoaks7 View Post
    I'm guessing this doesn't happen because it would be awfullllllllly slow.

    It does and it is ...
    Time is natures way of stopping everything going wrong at once

  3. #3

    Default

    Quote Originally Posted by JimPerry View Post
    It does and it is ...

    Ohh.. the shame of it... programming since 1968, 62 languages, and now (holds hand to forehead in a tragic gesture) I'm writing interpreted Basic!

  4. #4
    Moderator
    Join Date
    Jan 1970
    Location
    North Norfolk blow-in.
    Posts
    5,960
    Blog Entries
    1

    Default

    Quote Originally Posted by whiteoaks7 View Post
    snipped
    . If so, is the PicAxe embedded software in any way revision controlled and do we get to know when revisions change? Educate me please...
    There is some information in
    Computer
    System
    Program files
    Programming Editor
    firmware.txt

    and

    http://www.picaxe.com/Hardware/PICAXE-Chips/

    See details > Revision history
    e

  5. #5
    Senior Member
    Join Date
    Dec 2011
    Location
    Cambs. UK
    Posts
    217

    Default

    I was under the impression they were just a bubble of plastic filled with magic smoke that no longer function once the smoke is released, now you go letting me down with talk of technology and science, dissapointed or what.....

  6. #6
    Senior Member
    Join Date
    Sep 2011
    Location
    Bath,UK
    Posts
    740

    Default

    If you have written a compiler; then in the nicest possible way, I can't help but wonder why you are asking these questions, because I think you should instinctively know the answers.

    Like you, I don't know exactly the software architecture used, but my guess is as follows in answer to your questions:

    Q. How does it become machine code? It doesn't.
    Q. Does the PicAxe (programme editor) compiler create machine code directly? No
    Q. Does the PicAxe (programme editor) compiler create some intermediate code that the PicAxe then operates on? Yes
    Q. If, on the other hand, the Basic code is loaded into the PicAxe then it's not compiled but interpreted - I'm guessing this doesn't happen because it would be awfullllllllly slow? Not necessarily so, as you can see with a PICAXE.

  7. #7
    Senior Member
    Join Date
    Jan 1970
    Location
    Perth, Western Australia
    Posts
    3,458

    Default

    Quote Originally Posted by whiteoaks7 View Post
    If, on the other hand, the Basic code is loaded into the PicAxe then it's not compiled but interpreted - I'm guessing this doesn't happen because it would be awfullllllllly slow.
    Interpreted, yes. But the "compiler" tokenises your code to improve efficiency. On your speed concern, I have found that there very few tasks that the modern PICAXE can't do.

  8. #8
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    11,088

    Default

    If you have a read through the document I posted here: http://www.picaxeforum.co.uk/showthr...ions-and-Speed
    that will give you some insight to the tokenised and compressed BASIC files as downloaded into the PICAXE chips.

    A read of this thread to the end may also provide you with some further clarifying information:
    http://www.picaxeforum.co.uk/showthr...tstrap-program


    EDIT:
    The fact that the downloaded code is compacted as well as tokenised does incur some time delay to extract tokens and values which may cross byte boundaries. The “efficiency” is with respect to program memory use.
    westaust55

    Hey Hamlet, 2B OR NOT 2B = $FF

  9. #9
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    19,831

    Default

    Quote Originally Posted by whiteoaks7 View Post
    Does the PicAxe compiler create machine code directly or some intermediate code that the PicAxe then operates on (I've written compilers that have done both). If, on the other hand, the Basic code is loaded into the PicAxe then it's not compiled but interpreted - I'm guessing this doesn't happen because it would be awfullllllllly slow.
    A traditional interpreted Basic will convert the entire source to a tokenised form and keep it all in program memory, primarily so it can fit in a small memory while an interactive LIST command can show the entire source code as originally written.

    PICAXE Basic compiles into tokens which represent only the entities needed for the command to be executed which can be considered intermediate code which is then interpreted.

  10. #10
    Senior Member
    Join Date
    May 2011
    Location
    Atlanta, GA
    Posts
    775
    Blog Entries
    24

    Default

    Quote Originally Posted by whiteoaks7 View Post
    Ohh.. the shame of it... programming since 1968, 62 languages, and now (holds hand to forehead in a tragic gesture) I'm writing interpreted Basic!
    Well, we're only a few years apart in the programming area, and while I am double-digit in language counts, I am no where near 62! However, in defense of the PICAXE architecture, it is an evolutionary form of the old BASIC Stamp design; kind of on steroids. Amazingly, the chips perform remarkably well, are economical, and the system is well-documented and supported largely by this diverse member forum. You can get your hands around a weekend PICAXE project easily, multitasking at the design while watching some brain-sucking TV program. There are a multitude of ways to increase efficiency, assuming you are up to venturing from the most common 20 commands.

    I am vocal often in the area of architecture, but I am always supportive of the effort made by RevEd and their continued backward-compatibility. The PICAXE is kind of like a Swiss-Army knife... it is many things all rolled into one. You certainly cannot go wrong for the price of the chips and workable prototypes are easily created. I have often (cough, cough) used the PICAXE for a prototype and then converted the design into C/C++ or perhaps an algorithm into assembler .S files.


    - Ray

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •