Name:
inputtype
Syntax:

INPUTTYPE mask

Mask - is a variable/constant which specifies the input pin type.

Description:

Make pin an input of hardware silicon type TTL (0) or ST (1).

Microcontroller inputs can be of two types, TTL compatible or ST (Schmitt Trigger). On most PICAXE chips this type is predefined by the internal silicon design and cannot be changed and most chips have a mixture of both types. See the tables below for more details about the type of each PICAXE chip input.

Wiith improvements in silicon technology, on the more recent M2 parts, each input can be user configured to be either the TTL (0) or ST (1) type.

The type is defined by a mask which is a word length value where bits 0-7 correspond to B.0 to B.7 and bits 8-15 correspond to C.0 to C.7. Setting a bit to 1 makes it a ST type input, setting a bit to 0 makes it a TTL type (power up value is 0, TTL, on all pins).

The differences between TTL and ST input pin types are as follows:

Schmitt Trigger (ST)

Status 'high' if > 0.8 * Vsupply

Status 'low' if < 0.2 * Vsupply

Eg, with a 5V supply: high > 4.0V, low < 1.0V
Eg, with a 3V supply: high > 2.4V, low < 0.6V

TTL (Supply voltage > 4.5V)

Status 'high' if > 2.0V

Status 'low' if < 0.8V

Eg, with a 5V supply: high > 2.0V, low < 0.8V

TTL (Supply voltage < 4.5V)

Status 'high' if > 0.25 * Vsupply + 0.8V

Status 'low' if < 0.15 * Vsupply

Eg, with a 3V supply: high > 1.55V, low < 0.45V

Values between the high and low voltages are 'floating' and cannot be reliably used as either a high or low signal. Therefore in general TTL inputs are considered more versatile, as, for instance, at a 5V supply they will be guaranteed a 'high' signal at above 2V instead of at above 4V. However on some occasions Schmitt Trigger inputs may be desired.

Input Pin Types:

  08M2 08M 08
Serin TTL TTL TTL
C.1 TTL TTL TTL
C.2 ST ST ST
C.3 TTL TTL TTL
C.4 TTL TTL TTL
  14M2* 14M
Serin TTL TTL
B.0 TTL n/a
B.1 TTL n/a
B.2 TTL n/a
B.3 TTL n/a
B.4 TTL n/a
B.5 TTL n/a
C.0 TTL TTL
C.1 TTL TTL
C.2 TTL TTL
C.3 TTL TTL
C.4 TTL TTL

* 14M2 pins can be reconfigured via 'inputtype' command

 

18M2

18X 18M 18A 18
Serin TTL ST ST ST ST
B.0 TTL n/a n/a n/a n/a
B.1 TTL n/a n/a n/a n/a
B.2 TTL n/a n/a n/a n/a
B.3 TTL n/a n/a n/a n/a
B.4 TTL n/a n/a n/a n/a
B.5 TTL n/a n/a n/a n/a
B.6 TTL n/a n/a n/a n/a
B.7 TTL n/a n/a n/a n/a
C.0 TTL TTL TTL TTL ST
C.1 TTL TTL TTL TTL ST
C.2 TTL TTL TTL TTL ST
C.5 TTL n/a n/a n/a n/a
C.6 TTL ST ST ST ST
C.7 TTL ST ST ST ST
  20X2 20M2* 20M
Serin TTL TTL TTL
B.0 TTL TTL n/a
B.1 TTL TTL n/a
B.2 ST TTL n/a
B.3 ST TTL n/a
B.4 ST TTL n/a
B.5 TTL TTL n/a
B.6 TTL TTL n/a
B.7 TTL TTL n/a
C.0 TTL TTL TTL
C.1 ST TTL ST
C.2 ST TTL ST
C.3 ST TTL ST
C.4 ST TTL ST
C.5 ST TTL ST
C.6 TTL TTL TTL
C.7 TTL TTL TTL

* 20M2 pins can be reconfigured via 'inputtype' command

  28X2 28X2-5V 28X2-3V 28X1 28X 28A 28
Serin ST ST ST ST ST ST ST
A.0 TTL TTL TTL TTL TTL ADC ADC
A.1 TTL TTL TTL TTL TTL ADC ADC
A.2 TTL TTL TTL TTL TTL ADC ADC
A.3 TTL TTL TTL TTL TTL ADC ADC
B.0 TTL TTL TTL n/a n/a n/a n/a
B.1 TTL TTL TTL n/a n/a n/a n/a
B.2 TTL TTL TTL n/a n/a n/a n/a
B.3 TTL TTL TTL n/a n/a n/a n/a
B.4 TTL TTL TTL n/a n/a n/a n/a
B.5 TTL TTL TTL n/a n/a n/a n/a
B.6 TTL TTL TTL n/a n/a n/a n/a
B.7 TTL TTL TTL n/a n/a n/a n/a
C.0 ST ST ST ST ST ST ST
C.1 ST ST ST ST ST ST ST
C.2 ST ST ST ST ST ST ST
C.3 ST ST ST ST ST ST ST
C.4 ST ST ST ST ST ST ST
C.5 ST ST ST ST ST ST ST
C.6 ST ST ST ST ST ST ST
C.7 ST ST ST ST ST ST ST
  40X2 40X2-5V 40X2-3V 40X1 40X
Serin ST ST ST ST ST
A.0 TTL TTL TTL TTL TTL
A.1 TTL TTL TTL TTL TTL
A.2 TTL TTL TTL TTL TTL
A.3 TTL TTL TTL TTL TTL
A.5 TTL ST ST ADC ADC
A.6 TTL ST ST ADC ADC
A.7 TTL ST ST ADC ADC
B.0 TTL TTL TTL n/a n/a
B.1 TTL TTL TTL n/a n/a
B.2 TTL TTL TTL n/a n/a
B.3 TTL TTL TTL n/a n/a
B.4 TTL TTL TTL n/a n/a
B.5 TTL TTL TTL n/a n/a
B.6 TTL TTL TTL n/a n/a
B.7 TTL TTL TTL n/a n/a
C.0 ST ST ST ST ST
C.1 ST ST ST ST ST
C.2 ST ST ST ST ST
C.3 ST ST ST ST ST
C.4 ST ST ST ST ST
C.5 ST ST ST ST ST
C.6 ST ST ST ST ST
C.7 ST ST ST ST ST
D.0 ST TTL TTL TTL TTL
D.1 ST TTL TTL TTL TTL
D.2 ST TTL TTL TTL TTL
D.3 ST TTL TTL TTL TTL
D.4 ST TTL TTL TTL TTL
D.5 ST TTL TTL TTL TTL
D.6 ST TTL TTL TTL TTL
D.7 ST TTL TTL TTL TTL
Applies To:
14M2, 20M2
See Also:
Related Create:
Share:
Print:

Select input pin types

Demonstrate how to use the inputtype command to set the type of input pin

Code Example:
main:	inputtype %0000000000001111	; make pin B.0 to B.3 ST
	inputtype %0000111100000000	; make pin C.0 to C.3 ST
Copy Code Submit an Example

Submit Your Own Code!

You must be logged in to submit code examples. Login now.

Comments

  • Login to leave a comment.