Let pins= picaxe 20m2

lamxe

Senior Member
Dear All.
When I put this code :
Do
Let pins = %11111111
Wait 1
loop
on picaxe 20m , all port out at SIMULATION go high.
But with picaxe 20M2 not go high at all.
Please help me to know ; must be use other code? or is normal?
Thank you in advance.
 

nick12ab

Senior Member
use let pinsB = %11111111 instead. Note that on the 20M2 you need to first set all those pins as outputs by using let dirsB = %11111111 or individual 'output' commands if you prefer.
 

lamxe

Senior Member
Thank you so much nick12ab.Following your guide,my problem is go out Thanks again for your helpful.
lamxe
 

westaust55

Moderator
As some further explanation, the newer M2 and X2 parts allow most pins on the chip to be bi-directional.
By default, the pins are inputs except for a limited number of cases where a pin can only be an output.
Accordingly it is necessary to set the direction of the pins which you wish to use as an outputs.
The DIRS<port> = %xxxxxxxx ; where <port> is the corresponding port A,B,C,D as available on the respective PICAXE chips (See PICAXE manual 1 pages 9 to 11). For smaller chips the ports are typically &#8220;C&#8221; first available then B and C on mid sized chips. Only the 40 pin chips have all 4 ports available.
(See PICAXE manual 2 page 137)

Then to set the pins for a port high or low
PINS<port> = %xxxxxxxx. (See PICAXE manual 2 page 139)
 

lamxe

Senior Member
Dear Westaust55..
Very helpful.Thank you alot for your time advise me.
Yours sincerely.
lamxe
 
Top