Detect PICAXE type in a flowchart

TerryRy

Member
I have the need for my flowchart to be able to automatically detect if the installed PICAXE is a 8M2 or 20M2 and therefore run an appropriate input/output testing sequence for newly assembled PICAXE stamps. These are the only 2 device possibilities and it would be nice to set a variable accordingly.

I expect that I will need a insert a block of basic in my flowchart to achieve this.
 

hippy

Technical Support
Staff member
In your BASIC cell you could put something like ...

Code:
#ifdef _08M2
  #error this is an 08M2
#endif
#ifdef _20M2
  #error this is an 20M2
#endif
Replace the #ERROR with something more useful, set a variable to one value for an 08M2 another value for 20M2, include that in a procedure, for example.
 

westaust55

Moderator
If you are trying to detect the PICAXE type in the actual hardware you could try (untested):
A connection (try 100 kOhm) from the SerialOut/DAC output to the adjacent I/O pin.
First set the DAC low and test B.0.
Then set the DAC to highest value and test B.0 again
For an 08M2 the DAC output is wired to pin B1 thus the change in voltage level will be seen.
For a 20M2 the DCA is wired to pin B.0, so a 20M2 would not see the change.
 
Top