inputype clarification please - TTL or ST?

dgc188

New Member
As still a bit of a newbie to using PICAXE, I have been trying to make head or sense of the determination as to what pins are TTL and which are ST and which can be changed and which cannot. The latter part of the query, re changeable pin types, I understand would relate only to the M2 versions.

Reading through the downloadable manual (Pt.2 - v.7.9.2, 10/2015) shows one set of detail for 'some' of the pins (TTL or ST) while the on-line commands page shows something different in some places. And trying to decipher the Microchip datasheets relative to which of the PICAXE chips relate to which of their nomenclatue is mind boggling and then deciding does that information relate to the chip I have in my hand.... and some of the forum messages, albeit mostly being relatively old, yet informative, may or may not agree with anything read elsewhere. There's a lot of confusing information to be found out there!

Specifically I am looking at the 18F25K22 (28X2 on the AXE201 board) and the 40X2 (yet to be ordered, so no doubt the latest chip available) and any up-to-date and definitive clarification would be greatly appreciated as I want to be sure I am using the correct pins as TTL input pins.

Many thanks in advance.
Dave
 

dgc188

New Member
Many thanks for the clarification and for pointing me to the now the up-to-date list.

I would like to think that the downloadable manual will updated in due course thus negating the confusion I, and possibly others, have found.

Again, thanks.
Dave
 

AllyCat

Senior Member
Hi,

There is also confusion about the ST Input Voltage Levels: The description(s) "suggest" that the upper (High) threshold is 80% of Vdd (i.e. around 4 volts with a 5 volt supply) but I believe Microchip use a different interpretation. The "real" threshold voltage is much lower, typically just a few hundred mV above the lower threshold (i.e. a few hundred mV of hysteresis), which I believe Hippy did explain on the forum some time ago. EDIT: Probably here.

So in practice you may find little difference between "TTL" and "ST" inputs for most purposes. Also, many PIC(axe) pins are multi-functional and some can change from TTL to ST depending on the exact context.

Cheers, Alan.
 

techElder

Well-known member
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

...

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.

More at BASIC Commands
Schmitt trigger
In electronics, a Schmitt trigger is a comparator circuit with hysteresis implemented by applying positive feedback to the noninverting input of a comparator or differential amplifier. It is an active circuit which converts an analog input signal to a digital output signal. The circuit is named a "trigger" because the output retains its value until the input changes sufficiently to trigger a change. In the non-inverting configuration, when the input is higher than a chosen threshold, the output is high. When the input is below a different chosen threshold the output is low, and when the input is between the two levels the output retains its value. This dual threshold action is called hysteresis and implies that the Schmitt trigger possesses memory and can act as a bistable multivibrator. There is a close relation between the two kinds of circuits: a Schmitt trigger can be converted into a latch and a latch can be converted into a Schmitt trigger.

More at Wikipedia
Reducing the description of a Schmitt Trigger input to a simple change in the threshold voltage (as is done in BASIC Commands) is not very "educational".

Also, the very essence of a Schmitt Trigger input is the fact that with the input level between thresholds the output is NOT ambiguous. The ST input acts more like a latched input until a threshold is crossed.

I would go so far as to say that description is not even close to being correct as far as the ST input is concerned.
 
Last edited:

hippy

Technical Support
Staff member
The statements given reflect the statements provided in the Microchip datasheets, for example parameters D141 and D148 of the Electrical Characteristics for the 18F25K22 (28X2).

There is only so much one can ever write about anything before the succinct message one is trying to convey is drowned out by caveats and detail. The full datasheets are available for those who do need the complete detail.
 

techElder

Well-known member
I've been through this before without enough explanation of why MicroChip describes an input as "Schmitt Trigger" (ST) but only specifies two thresholds. One of my timer applications needed some hysteresis in the detection input, but no one seems to be able to define the input characteristics of an ST input on a PICAXE.

18.8.3 COMPARATOR HYSTERESIS is described in the datasheet, but I can't find any description or diagram that uses the word hysteresis when defining Schmitt Trigger.

Do we really have ST inputs, or are they simply CMOS thresholds instead of TTL thresholds? MicroChip says they are ST, so they must be.

Legend: TTL = TTL compatible input CMOS = CMOS compatible input or output; ST = Schmitt Trigger input with CMOS levels;
There is a mention in the venerable application note AN234, DIGITAL THRESHOLDS AND TIMING (PDF), but it only references the higher CMOS thresholds.

I suppose that someday I'll set up a scope and try to characterize the input, but I've run out of time now.
 

hippy

Technical Support
Staff member
I've been through this before without enough explanation of why MicroChip describes an input as "Schmitt Trigger" (ST) but only specifies two thresholds.
Having two levels seems right to me; when a voltage goes above the higher level it will have switched to a high detection, when it drops below the lower level it will have switched to a low detection. A switch won't occur while the signal remains between those two levels.

Figures 28-81 and 28-83 in my 28x2 datasheet show what those typical switching voltages will be..

but no one seems to be able to define the input characteristics of an ST input on a PICAXE.
We can only really describe the PICAXE input characteristics as being the same as what the PICmicro characteristics are.

18.8.3 COMPARATOR HYSTERESIS is described in the datasheet, but I can't find any description or diagram that uses the word hysteresis when defining Schmitt Trigger.
I would presume the hysteresis is implied in their calling them Schmitt Trigger inputs. That they couldn't be Schmitt Trigger inputs if there were no hysteresis.

MicroChip says they are ST, so they must be.
That's all we could say as well. There doesn't seem to be any reason Microchip would call them Schmitt Trigger inputs if they were not, did not have characteristics of what would be called a Schmitt Trigger.
 
Top