Old versus New Port designations

hbl2013

Senior Member
I very often look at older designs of projects for ideas, and sometimes run into unfamiliar port designations in designs using obsolete chips. One of the programs I am looking at has this statement symbol buttonA = pin2 'Button is connected to input pin 2 . It uses a 18x chip. I can not find this port designation in the Manuals. Which pin is used here? Also which pins are used in the following statements? symbol LED = 3 'LED on output pin 3, and symbol SOin = 0 'Sonar on input pin 0 ?
Can anyone direct me to the appropriate pages in the Manual?
 

AllyCat

Senior Member
Hi,

Generally, the newer chips are "backwards compatible" with the older chips. There is no 18X2, but there is an 18M2 so you can compare the pinouts on pages 10 and 11 of Manual 1. The older chips had dedicated Input and Output pins where the Output pins are now Port B and Inputs are Port C.

But the documentation is not really essential, because many of these issues can be "tested" with the Program Editor. For example the following code should Syntax Check correctly, whilst uncommenting the two other lines should flag them as errors.

Code:
#picaxe 18x
; symbol buttonA = pinb.2
  symbol buttonA = pinc.2 
  symbol LED = b.3 
; symbol LED = c.3
Cheers, Alan.
 

hbl2013

Senior Member
Thanks for the info AllyCat, your suggestion to test the program with the Editor and that way find the correct Syntax, is a good one, and I will use it in the future.
 

BESQUEUT

Senior Member
Thanks for the info AllyCat, your suggestion to test the program with the Editor and that way find the correct Syntax, is a good one, and I will use it in the future.
You also can use simulator to show what is the value for each predefined constant :
Code:
 #simspeed 100
 #picaxe 40X2
 
 
	 sertxd (13,10,"A.0= ",#A.0)
	 sertxd (13,10,"B.0= ",#B.0)
	 sertxd (13,10,"B.1= ",#B.1)
	 sertxd (13,10,"B.2= ",#B.2)
	 sertxd (13,10,"B.3= ",#B.3)
	 sertxd (13,10,"B.4= ",#B.4)
	 sertxd (13,10,"B.5= ",#B.5)
	 sertxd (13,10,"B.6= ",#B.6)
	 sertxd (13,10,"B.7= ",#B.7)
	 
	 sertxd (13,10,"C.0= ",#C.0)
	 sertxd (13,10,"C.1= ",#C.1)
	 sertxd (13,10,"C.2= ",#C.2)
	 sertxd (13,10,"C.3= ",#C.3)
	 sertxd (13,10,"C.4= ",#C.4)
	 sertxd (13,10,"C.5= ",#C.5)
	 sertxd (13,10,"C.6= ",#C.6)
	 sertxd (13,10,"C.7= ",#C.7)
	 
	 sertxd (13,10,"A.0= ",#A.0)
	 sertxd (13,10,"A.1= ",#A.1)
	 sertxd (13,10,"A.2= ",#A.2)
	 sertxd (13,10,"A.3= ",#A.3)
	 sertxd (13,10,"A.4= ",#A.4)
	 sertxd (13,10,"A.5= ",#A.5)
	 sertxd (13,10,"A.6= ",#A.6)
	 sertxd (13,10,"A.7= ",#A.7)
	 
       sertxd (13,10,"D.0= ",#D.0)
	 sertxd (13,10,"D.1= ",#D.1)
	 sertxd (13,10,"D.2= ",#D.2)
	 sertxd (13,10,"D.3= ",#D.3)
	 sertxd (13,10,"D.4= ",#D.4)
	 sertxd (13,10,"D.5= ",#D.5)
	 sertxd (13,10,"D.6= ",#D.6)
	 sertxd (13,10,"D.7= ",#D.7)
	 
	 sertxd (13,10,"tab= ",#tab)
	 sertxd (13,10,"lf= ",#lf)
	 sertxd (13,10,"cr= ",#cr)
	 
	 sertxd (13,10,"b300_4= ",#b300_4)
	 sertxd (13,10,"b300_8= ",#b300_8)
	 sertxd (13,10,"b300_16= ",#b300_16)
	 sertxd (13,10,"b300_20= ",#b300_20)
	 sertxd (13,10,"b300_32= ",#b300_32)
	 sertxd (13,10,"b300_40= ",#b300_40)
	 sertxd (13,10,"b300_64= ",#b300_64)
	 
	 	 
	 sertxd (13,10,"B600_4= ",#B600_4)
	 sertxd (13,10,"B600_8= ",#B600_8)
	 sertxd (13,10,"B600_16= ",#B600_16)
	 sertxd (13,10,"B600_20= ",#B600_20)
	 sertxd (13,10,"B600_32= ",#B600_32)
	 sertxd (13,10,"B600_40= ",#B600_40)
	 sertxd (13,10,"B600_64= ",#B600_64)
B.0= 0
B.1= 1
B.2= 2
B.3= 3
B.4= 4
B.5= 5
B.6= 6
B.7= 7
C.0= 8
C.1= 9
C.2= 10
C.3= 11
C.4= 12
C.5= 13
C.6= 14
C.7= 15
A.0= 16
A.1= 17
A.2= 18
A.3= 19
A.4= 20
A.5= 21
A.6= 22
A.7= 23
D.0= 24
D.1= 25
D.2= 26
D.3= 27
D.4= 28
D.5= 29
D.6= 30
D.7= 31
tab= 9
lf= 10
cr= 13
b300_4= 3332
b300_8= 6666
b300_16= 13332
b300_20= 16665
b300_32= 26666
b300_40= 33332
b300_64= 53332
B600_4= 1666
B600_8= 3332
B600_16= 6666
B600_20= 8332
B600_32= 13332
B600_40= 16666
B600_64= 26666
 
Last edited:
Top