Secondary Ports - T3.5

Status
Not open for further replies.

Power_Broker

Well-known member
I'm designing a PCB for a project for massive amounts of I/O for a T3.5 and was wondering about secondary ports. For instance, the pinout I have says D26 can be used as an alternate for TX1. Does that mean if I do Serial1.println("hi'); in my code, will D26 output a waveform by default?

If not, how can I configure the Teensy to output on the alternate pins and not the primary pins?

If so, how can I configure the Teensy to only output on the primary pins? For instance, if I have a device connected to the primary Serial1 pins but want to attach a servo signal wire to D26, what do I have to do to make sure I don't accidentally send a serial command to my PWM servo?
 
Alternate pin usages are mutually exclusive.

Each alternate usage has some specific way to make that transition for usage.
 
For instance, the pinout I have says D26 can be used as an alternate for TX1. Does that mean if I do Serial1.println("hi'); in my code, will D26 output a waveform by default?

The primary pins (letters in black) are used by default, if you do nothing special to choose the pin. Hopefully that's intuitive?

To use the alternates, you need to add extra code to configure the pin. Hopefully that also makes sense, that the alternates would not normally be used until you do something special to select them?


If not, how can I configure the Teensy to output on the alternate pins and not the primary pins?

Serial1.setTX(pin). Details here:

https://www.pjrc.com/teensy/td_uart.html


If so, how can I configure the Teensy to only output on the primary pins?

You can also use Serial1.setTX(1), though that's not necessary since the primary pins are used by default.


For instance, if I have a device connected to the primary Serial1 pins but want to attach a servo signal wire to D26, what do I have to do to make sure I don't accidentally send a serial command to my PWM servo?

While not an issue on pin 26 (since pin 1 is used by default), if you has the servo connected to pin 1, you would use Serial1.setTX(26) *before* Serial1.begin(), so that pin 26 is used from the very start of initializing Serial1.
 
Awesome! That clears things up a ton.

I'm guessing I2C and SPI interfaces have something similar to .setTX(1)? i.e. .setCS(1) or .setSDA(1)?
 
I'm guessing I2C and SPI interfaces have something similar to .setTX(1)? i.e. .setCS(1) or .setSDA(1)?

They do indeed, and those functions are documented on the pages for those libraries.

With SPI, the CS pins are normally controlled with digitalWrite() or digitalWriteFast().
 
They do indeed, and those functions are documented on the pages for those libraries.

With SPI, the CS pins are normally controlled with digitalWrite() or digitalWriteFast().
which makes it as clear as MississippiMudPie for an old newby - where are these ?mythical? pages for those libraries - pretty please.
I have wandered far and wide, in my quest for raw, lowdown, basic 'everybody knows that!' (which I don't). Yet w a y b a c k I started using Tiny C - which ISTR ran in 2k of ram after loading from a cassette player ... how are the mighty fallen or something, when a C compilation for teensy 'flash' takes a 2.4 ghz 8 core machine a measly 6 mins.:D
P.S. just recovering from the lurgie, so my temper is not of the best - sorry. you have helped, but I would like to be able to help my self but the Hinterknet is a bit on the big size with lots of gash gen (rubbish). Mike
 
SPI library:
https://www.pjrc.com/teensy/td_libs_SPI.html

Wire library:
https://www.pjrc.com/teensy/td_libs_Wire.html


when a C compilation for teensy 'flash' takes a 2.4 ghz 8 core machine a measly 6 mins.

Maybe you're using Windows and you have a terrible anti-virus program that's massively slowing down filesystem access?

On Macintosh and Linux, compile times are usually just a few seconds if you're previously compiled the same program, or 10-15 seconds if Arduino rebuild everything (like after changing any setting in the Tools menu).

Windows is almost always slower, but not by more than about 2X. If you're seeing compile times measured in minutes, it's almost certainly anti-virus or malware interfering with disk access.
 
SPI library:
https://www.pjrc.com/teensy/td_libs_SPI.html

Wire library:
https://www.pjrc.com/teensy/td_libs_Wire.html




Maybe you're using Windows and you have a terrible anti-virus program that's massively slowing down filesystem access?

On Macintosh and Linux, compile times are usually just a few seconds if you're previously compiled the same program, or 10-15 seconds if Arduino rebuild everything (like after changing any setting in the Tools menu).

Windows is almost always slower, but not by more than aboutr whatever)
OH Shuggar - I wrote a diatribe & windoze dumped it. - probably to the good.
Yes I use Windoze Depender/defender/degrader or whatever - with no way I can see of stomping on it.
and it is not helped by the huge multi kilobyte macro expansions - I'm surprised that W10(home) doesn't blow up like W3.11 did.
And I am NOT unhappy with your answers - it just looks that way 'cos I'm no longer young and willing to trudge through treacle .
(WAAAYY OFF topic - how to I kick Windoze Degrader into the bushes while I grind through Arduino (ug) interface. ( /Eclipse & /Amtel - have had issues with them as well).
TIA Mike
 
Last edited:
With the fear of RansomeWare attacking files - any app doing intense disk work is suspect and held up for some degree of monitoring. It was added to core Win 10 with recent releases in Windows Security/Defender, though it can be disabled and basically only monitors in 'USER" folders {docs,pics,destop}.

It has been added to most other Antivirus like tools. With Defender and added Malwarebytes I had to set up exceptions for Malwarebytes to exclude the SSD area where I do all my Teensy/Arduino work.

My 8 core i7 is finally completing rebuild uploads in under 5 seconds and not too much longer for full initial build.

So back to line one - if Arduino was "installed" then it may be tied into USER folders enough to trigger extra watching. Doing UNZIP install to my isolated SSD drive keeps it clear of protected USER area - and not part of the 'Programs' directory and control area.


As far as devices and libraries - they are documented - if not on PJRC.com in some fashion - then on Adafruit or SparkFun depending on the hardware in use and where acquired. When they are using the Primary pins for the BUS at hand then nothing special is required beyond proper wiring. Extended details for ALTernate pin usage depends on device and library at hand, when available or needed the above sources - or the library code interface will provide a way to specify the alternate pins.


As far as LOST POST - the FORUM code saves text as entered on some schedule. So returning to the thread after restarting browser will show a 'Restore Content' {lower left corner of Quick Reply area} - though indeed most diatribes are best left unposted.
 
With the fear of RansomeWare attacking files - any app doing intense disk work is suspect and held up for some degree of monitoring.
....
So back to line one - if Arduino was "installed" then it may be tied into USER folders enough to trigger extra watching.
YES each and every .ino (and 'ino.ino and .ino.ino.cpp - UH-) sits quite a distance down the User track. Thank You.
Doing UNZIP install to my isolated SSD drive keeps it clear of protected USER area - and not part of the 'Programs' directory a nd control area.
HOKAY si I'll try a bit ot that - though doubt I can Isolate the ssd section of my HD,

As far as devices and libraries - they are documented - if not on PJRC.com in some fashion - then on Adafruit or SparkFun depending on the hardware in use and where acquired. When they are using the Primary pins for the BUS at hand then nothing special is required beyond proper wiring. Extended details for ALTernate pin usage depends on device and library at hand, when available or needed the above sources - or the library code interface will provide a way to specify the alternate pins.
ah - more knowledge TKU
As far as LOST POST ...
that is a quirk of my Hickup Pakhard I swurtcg the toutch pad off and it switches it back on again BUT I'll try the forum unsave when and if
..eft unposted.
Yup.
Thanks:)
 
Status
Not open for further replies.
Back
Top