Port Numbering:: Starting at 0 vs 1

Status
Not open for further replies.

methods

Member
I don't have a particularly strong opinion on the subject, just a morbid curiosity.

Being a programmer, I lean toward starting at 0. On the Teensy 3.6 CAN port numbering started at 0.

3_6vs4_1.png

On the Teensy 4.1, I see port numbering now starting at 1.

... It is totally unimportant to me, but I am curious. Is that an artifact of::

* Naming on the target chips carrying thru?
* Different Engineer on pin assignments?
* Trying different things to see how they feel? (I do that)

...

I am guessing it is a reflection of the naming convention used on the chip.

thanks,
-methods
 
It could be to bring it in line with Serial ports where Serial (aka Serial0) is USB Serial and Serial1,2,2...etc are real serial ports.
Not making a definitive answer, just surmising.
Happy Christmas everyone, and looking forward to an eventual covid19 free new year.
 
On Teensy 3.2/3.5, you have CAN0
On Teensy 3.6, you have CAN0 and CAN1
on Teensy 4.0/4.1, you have CAN1,CAN2, and CAN3.

It's based on the hardware layout names on the controller as per the RM. In the case of T4.x CAN0 does not exist on the RM, and neither does WDT0 (watchdog reference). If you suggest can 0,1,2 for teensy 4, how would people react to looking for the CANFD controller, or WDT3 for that fact.��

Lucky for you though, the CAN library supports sketch based user objects rather than pre-initialized. So no matter what CANx port you use, you can label it Can0 if you want, or in my case, BCAN and FCAN
 
As far as the CAN support on the Teensy, stupendous. :rolleyes:

I set up a test station the other day, and it took on the order of 3 lines of code to be completely up and spilling hex to the terminal. Those who have been around a couple of decades know how valuable of a time saver that is. CAN used to be a real chore to sort out, especially from one chip to the next.

...

Just recently I had to support a non-Arduino chip for the first time in many years. Beefy guy, but ... not friends with Arduino. It started with a search of barren forums, lurked only by those who want to do work for money. It finished with me having to get all the way down to the CAN timing registers... and that was just to get my baud rate working.

After that -
Tomes and tomes of register settings, flags, and other such bits that could only be understood thru a deep dive into the 420 page manual.

...

I...
As an Engineer...
REALLY appreciate the hard work that some have done to save hundreds of thousands of hours -> for many. Very honorable thing to do.

Any time I can help out, I want to.

Currently we are about to do some Validation runs... It is not hard to sneak side-tests into those long sessions. ... I have to get permission to share the specific data at times, but I will say that the LONG HEADER of the Teensy passed both Shock and Vibration.

A note on Shock and Vibration
If you are a "modular builder" then a trick I have learned is to double-up on all of your headers. Here is an example.

Say you have a pin spread as seen below

5V
GND
Space
AGND
ChA
ChB
ChC
ChD

5V & Ground
A space (for Electrical Isolation)
Analog Ground and 4 ADC's

The total pin count there from side to side is 8 pins. Right off, WE NEVER SPECIFY EXACTLY THE NUMBER OF PINS NEEDED -> Of course... so... that later we can sneak reworks etc thru open pins. So... lets start by calling out a 10 pin requirement.

For a 10 pin requirement we run a 20pin Ribbon Cable header.
Standard 0.1" spacing
2 pins per channel

That leaves us with

Example.png

Now, we have

* A lot of Friction
* Redundant connections

In the eventuality where connectors are cocked a bit, things are vibrating, housings overheat a bit, the wrong housing is specified... having redundant connections all but eliminates kissing contact and other horrific head scratchers.

Over-Specifying on the number of pins gets you slack for rework. If you leave a few channels open you can rework a daughtercard, AND ROUTE SIGNALS IN AND OUT, which is a life saver.

Over-Specifying on the number of pins also buys you a great deal of FRICTION. Friction is your friend... where keeping things in the socket is concerned. I was taught that there are two things:

* Friction
* Stiction

Friction is... obvious. Stiction is a little different. This is the resistance you feel to start moving something as opposed to keep moving something. Most often talked about with suspension. ... Anyhow, you want really high stiction and medium friction for a Module that is removable but must not self-remove.

A lot depends on

* Finish of the pins
* Quality of the Socket Header

Pins with a rougher finish can provide more stiction/friction. One of the rare times where you might consider that a benefit. Much more important is the build of the socket housing. There are hundreds if not thousands on the market, and ALL ARE NOT THE SAME!

* Spring Tension
* Depth of insertion
* Tolerances
* Material properties of the plastic
* Material properties of the contact....

These things become critically important where you start flowing power thru headers. 3A is a number we use frequently. 3A on a pin. ... DOES NOT mean 3A on ALL PINS, as things will soak out thermally, but... anyway.

Live the dream.

-methods
 
If you going the route of redundancy why not route ground between signals to control crosstalk? you can still double up
signals like GND/A/A/GND/B/B/GND/....
 
Thats a good idea. I will give it a try.
Historically I have left pins open and in blocks to allow for additions, rework, add-ons, future. So, I guess... more future proof than noise proof.

When I was last working on ECT Test Fixtures (Everette Charles Technology), we were working so far into the future (in the absence of definition or requirements) that I ended up designing into the test fixture pinouts:

* Current
* Future
* Spare

Banks of pins... instead of trying to define it all in a vacuum.

These are those VG Mass Interconnects

VG.jpg

Example of Connector Selection
https://ect-cpg.com/wp-content/uploads/2018/10/VG_flyer_web.pdf

Oh boy... when you are looking at rows and rows and rows of 34 pins... :eek: the mind swims.

PinsPinsPins.png

* Pins are Cheap, I go square IIRC
* Springs are expensive, on the order of $1 each (So... $42 x 4 on a block)
* Each pin is rated to carry 3A (so skip the power pins)
* IIRC the pin to pin was 120VAC

I remember Hi-Potting one of them and getting to a very respectable 3-4KV, but this was clean at the factory. Some test stations run for decades and the CRUFT builds up.

-methods
 
Status
Not open for further replies.
Back
Top