Pin definitions

Status
Not open for further replies.

msaine

Active member
Are the "extra" pins on the various teensy board defined? I wanted to use the A14 pin and I don't see it defined in pin_teensy.h Are these pins defined any where?, and if not what pin numbers are they to create my own defines.
 
All pins on the Teensy are active and defined based on the function they provide - at least for the 32 bit ARM Teensy.

Did you get a CARD with the Teensy? Which one do you have?

Ideally your Teensy came with a card - if not here are the images : https://www.pjrc.com/teensy/pinout.html

Find the Teensy you have and see if that helps.
 
All pins on the Teensy are active and defined based on the function they provide - at least for the 32 bit ARM Teensy.

Did you get a CARD with the Teensy? Which one do you have?

Ideally your Teensy came with a card - if not here are the images : https://www.pjrc.com/teensy/pinout.html

Find the Teensy you have and see if that helps.

I guess I was asking where "A14" is defined along with the rest of the misc pins not in the 28 pin footprint. They are not in pins_teensy.h with the rest. If you will note on the card A9 is also pin 23 . then there are pins A10 thru A14 with no "pin numbers" then there are pins 24 and 25 and then A15 is pin 26, etc. I was just checking to see if they are in a define and if so where is it? FWIW I specifically talking about a teensy 3.2 but I'm guessing there are more on the 3.6.

Having the card is only part of the whole. I really hate assuming everyone else has done their job before I blindly use a define; Especially one that is probably rarely used. Just what is the value of A14 :) Maybe I'm to cynical but I have over the last few decades wasted to much time trouble shooting things to later find out someone defined A14 to be garbage.
 
I guess I was asking where "A14" is defined

pins_arduino.h, line 84 (for Teensy 3.2)
pins_arduino.h, line 122 (for Teensy 3.5 / 3.6)

https://github.com/PaulStoffregen/cores/blob/master/teensy3/pins_arduino.h#L84

All core lib source code is on your PC, in Arduino's hardware/teensy/avr/cores/teensy3 folder. If using Windows, the default location (just clicking "Next" during the installer) for Arduino is C:\Program Files (x86)\Arduino. When you have a question like this, you can pretty easily find the answer by a text search through those files using "grep" (commonly used on Linux) or similar programs (perhaps Defragster will recommend a Windows program).


They are not in pins_teensy.h with the rest.

Some stuff is defined in other .h files, in an attempt to follow certain conventions Arduino has defined. This is done for maximum compatibility with the huge ecosystem of Arduino libraries & examples, and long legacy of different versions of Arduino which have used slightly different conventions where to define stuff.
 
Are the "extra" pins on the various teensy board defined? I wanted to use the A14 pin and I don't see it defined in pin_teensy.h Are these pins defined any where?, and if not what pin numbers are they to create my own defines.

Sometimes hard to answer questions like this. I assume you are talking about a Teeny 3.2?

And What do you mean by "Use" Again important to know which board, as on T3.2 the pin A14 is Analog only. Whereas on T3.5/6 it also has a digital pin # of 33 associated with it.

What does this mean? On T3.2, you can not do something like: pinMode(A14, OUTPUT)...

You can however do things like: analogRead(A14);

And as it is also the DAC pin, there are other capabilities.

Also this pin is NOT 5v tolerant: From The 3.2 page:
All digital pins are 5 volt tolerant on Teensy 3.2 & 3.1. However, the analog-only pins (A10-A14), AREF, Program and Reset are 3.3V only.
 
what does any of this response have to do with where are they defined? Yes as I stated I am talking about a 3.2 but the same goes for the other boards. WHERE ARE THEY DEFINED? A simple question not answered by examples of voltage tolerance or usage examples. So far every one is trying to show their prowess in coding and not answering the original question.

Where are they defined!
 
Follow on now that I am back to my computer...

Personally I would suggest not insulting those of us who try to help out... It is sometimes hard when know what some one is asking when there is no context given. I mainly mentioned the electrical aspect as I have seen it more than once up on forums, where someone thinks they can use one of the Analog only pins for something like a button, and they give it +5v and blow the processor...

WHERE ARE THEY DEFINED? - Again hard to know what you mean... That is

a) where there is a #define mentioned? Well grep is your friend... Example:
In pins_arduino.h under the section for the T3.2 (__MK20DX256__) You will see:
Code:
#define PIN_A14 (40)
And several lines down you will see:
Code:
const static uint8_t A14 = PIN_A14;

So you can see that for THIS chip internally it maps to 40...

b) Or do you mean what physical pin on the processor does this Correspond to? Many ways to find this, but you could look at schematic:
https://www.pjrc.com/teensy/schematic.html
And see that it connects to the physical pin: DAC0

c) Or you could mean how does this map to how analogRead works? This is define in the table in cores\teensy3\analog.c again depending on processor:
I believe that currently is line 401...

d) Or maybe how it is used in analogWrite to do digital to analog conversions... That is in analog.c again and there is code that for this processor specifically looks for (pin == 14) and calls off to analogWriteDAC0...

Edit: But if you are instead asking why this pin is not included in the table: const struct digital_pin_bitband_and_config_table_struct digital_pin_to_info_PGM[] = {
in pins_teensy.c (line 41...) which for T3.2 only goes up pin 33... Again that is because this pin does not support digital stuff.. Again this is constrained by the definitions in core_pins.h
Code:
#elif defined(__MK20DX256__)
#define CORE_NUM_TOTAL_PINS     34
#define CORE_NUM_DIGITAL        34
#define CORE_NUM_INTERRUPT      34
#define CORE_NUM_ANALOG         21
#define CORE_NUM_PWM            12
 
Last edited:
Now I see why I couldn't find them. My ignorance for not knowing a teensy 3.2 is really a MK20dx256. I saw those defines and through my ignorance did not realize what I was looking at. In my defense I asked if the "quote extra pins were defined" not how to use them. In my second post I clarified what I meant by "extra pins" and was expecting an answer like: yes they are in suchandsuch file not a code snippet or a detailed IO function explanation. I realize that you all have to deal with all levels of experience and it is hard to satisfy everyone but just remember that not everyone is stupid, some of us are just lacking information and experience in these topics. Biggest reason I hate the Arduino environment is it's inconsistency in documentation.
 
All pins on the Teensy are active and defined based on the function they provide - at least for the 32 bit ARM Teensy.

Did you get a CARD with the Teensy? Which one do you have?

Ideally your Teensy came with a card - if not here are the images : https://www.pjrc.com/teensy/pinout.html

Find the Teensy you have and see if that helps.

Now I see why I couldn't find them. My ignorance for not knowing a teensy 3.2 is really a MK20dx256. I saw those defines and through my ignorance did not realize what I was looking at. In my defense I asked if the "quote extra pins were defined" not how to use them. In my second post I clarified what I meant by "extra pins" and was expecting an answer like: yes they are in suchandsuch file not a code snippet or a detailed IO function explanation. I realize that you all have to deal with all levels of experience and it is hard to satisfy everyone but just remember that not everyone is stupid, some of us are just lacking information and experience in these topics. Biggest reason I hate the Arduino environment is it's inconsistency in documentation.

the first post was a bit incomplete not knowing what Teensy 8 or 32 bit or any other context like under the covers definition - and anything 'On the card' where it is labelled A14/DAC is standard not extra - the follow up post #2 clearly notes : All pins on the Teensy are active and defined based on the function they provide

As far as the files - some are 'overloaded' as Paul notes Arduino has conventions and PJRC hardware tree has evolved with its own conventions to keep up with them as the various MCU's came online. All the Teeny 3.x's and LC fit in one subdirectory with much shared. And there is a new dir for the Teensy4 like for the 8 bit AVR's because they don't share so much - and somehow all three are dropped in a way that works under the a single AVR upper dir.

Indeed it is tough to know anything about the person on either end of these posts - or the issue to be resolved without reading it and the associated details.

As shown in above reply #2 - there was no dismissiveness - but an attempt to connect - with a link - to get to the issue made clear for resolution … @KurtE noted a few of the many ways the OP could be interpreted ...
 
Last edited:
Status
Not open for further replies.
Back
Top