M2-X2 power consumption, X2 multitasking, X2 slots Rom

GrahamGo

Senior Member
Hi, just a few assorted questions that have been niggling me!

1. Is there info around that compares the various Pixaxe part #'s, power consumption at various voltages vs clock speeds etc, I notice this parameter isn't mentioned in any spec sheets.

2. Why can't the X2 be compiled to multitask like the M2 series? I have found various multitasking solutions using a timer. But what stops the X2 performing similar to the M2 series using the standard compiler's Start0, Start1.... etc?

3. On the larger X2 series I see 4 "slots" which I understand are used to extend the programming space, but lets say a program uses slot0 only, can slots 2-4 be used as a rom area to store lets say a graphics LCD font table?
 

nick12ab

Senior Member
  1. PIC micro datasheets all have detailed information about power consumption in them. For example, the PICAXE-28X2 (based on the PIC18F25k22) has this info on page 431. See the datasheet.
  2. Rev-Ed market multitasking at the educational market and specifically refer to the 'M2 educational parts' on page 62 of the manual.
    The M2 educational PICAXE chips support parallel task processing... Parallel tasks are designed for educational use to simplify programming by
    younger students.
    If you try to use multitasking with any command other than the basics (pause, wait, toggle, high, low, let x = y etc), the program pauses while waiting for the command (serin and infrain will cause the worst problems) to complete.
  3. As far as I know, the only way to do this would be to have a two-dimensional array of variables in LOOKUP commands, get the program in the first slot to set variable(s) for requesting the data then run the slot with the lookups in. A 'run 0' command would be placed after the lookups.
 

mrburnette

Senior Member
[*]As far as I know, the only way to do this would be to have a two-dimensional array of variables in LOOKUP commands, get the program in the first slot to set variable(s) for requesting the data then run the slot with the lookups in. A 'run 0' command would be placed after the lookups.
Blocking commands will always be a problem with the current PICAXE firmware/interpreter but you can utilize the unnamed variables to great advantage and essentially make the multi-tasking programs simple shells that utilize as many subroutines as possible. By swapping memory in the subroutines, you can use the unnamed variables in a named manner... of course, nothing is 'free' and the swapping does use some processor resources (read, eats time.)

Example: http://www.picaxeforum.co.uk/entry.php?36-Extending-PICAXE-named-variables-by-300-or-more!
- Ray
 

GrahamGo

Senior Member
Thanks.
1. It didnt occur to me to go this route, but I see the 28X2 pulls approx 10m/a @ 64mh/z, a ballpark # which is all I need right now. I need to order some Picaxe Parts. But I can't seem to find SMD Picaxe parts sold in the USA.
2. So is this an issue of the Program editor and Logicator etc blocking - rather than the X2 missing some physical attribute like ram or something? I viewed the unnamed variables demo, and get that. But I don't get them in the concept of using them with multi-tasking programs as shells etc. I guess I would need to see a simple example to grasp that. To new to this I am afraid.
3. Was just a question to ask if this "wasted" program space could be usefully utilized.
 

nick12ab

Senior Member
1. It didnt occur to me to go this route, but I see the 28X2 pulls approx 10m/a @ 64mh/z, a ballpark # which is all I need right now. I need to order some Picaxe Parts. But I can't seem to find SMD Picaxe parts sold in the USA.
If the issue is not having a PCB drill and not size then you can just bend the DIP PICAXE pins outwards.

2. So is this an issue of the Program editor and Logicator etc blocking
It's not an issue of Programming Editor or Logicator blocking it on X2 parts, it's an issue with the X2 parts (not that it's an issue at all). It's likely that PICAXEs with multitasking were introduced in order to kill off the solitary 'advantage' a certain competitor that came out in 2009 had. As the X2 range was introduced before then (I think), Rev-Ed wouldn't have seen the need to add that capability to the X2 parts. 28-pin microcontrollers are rare at my school anyway and there's never been an X2 part so adding the multitasking feature would just be a stupid gimmick that hogs program memory and the target audience of the X2 picaxes are unlikely to want it.

Also, all PICAXEs are only single core so making it easier to code for little KS3 kids writing code for their little LED christmas trees or traffic lights by adding multitasking doesn't make the PICAXE execute stuff faster and there will be some sort of code workaround on parts that don't do multitasking.

Remember that on the X2 parts you now get two timers and both of them have programmable intervals so you could utilize one of them in making delays whilst still executing other commands.

3. Was just a question to ask if this "wasted" program space could be usefully utilized.
I totally agree with you about dividing the slots into separate programs being a waste of space. It would just be more convenient to have one 16KiB program then the call stack could be shared and any part of the program can be jumped to without extra jump variables. However, considering that (almost) everything the X2 parts do that the others don't are blockiong commands, multitasking would also be a waste of space.
 

GrahamGo

Senior Member
Picaxe prototype, the idea of bending the leads is neat, but I would rather use the SMD size if possible, I checked the USA suppliers but they don't seem to stock them, maybe I can buy them in the UK and get them shipped - I will check.

"Quote" you can utilize the unnamed variables to great advantage and essentially make the multi-tasking programs simple shells that utilize as many subroutines as possible. By swapping memory in the subroutines, you can use the unnamed variables in a named manner. "Unquote"

I would love to see an example code snippet of this if possible - thanks!
 
Top