How to use GPIO_B0_04 as output on Micromod Teensy 4.1

ninja2

Well-known member
I'm working on reset control from my T4.1 processor to the ZED-F9P GNSS chip on my Micromod system comprising:

MMod Main Double Board with:
  • Processor: T4.1
  • F0: ZED-F9P GNSS
  • F1: ESP32-WROOM-32 WiFi/Bluetooth
But I'm having trouble getting it to work. AFAIK this is the connection path:
Code:
T4.1 MM processor = B0_04 BGA:C8 Tag:GPIO/40
to
MM connector T4.1 pin:40 G0/BUS0
to
Main Double Board Processor Connector = G0/BUS0 pin:40 Tag:G0-PROCESSOR
to
Main Double Board FC0 Connector = F3 pin:53 Tag:G0-PROCESSOR
to
GNSS ZED-F9P Fn Board Connector = F3 pin:53 Tag:RESET#/ZED_RESET#
to
ZED-F9P chip: RESET# pin:49 tag:ZED_RESET#

Question which pin should I use on the T4.1 to control B0_04?

I tried digital pin D40 but the ZED-F9P froze as soon as pinMode declared it as an O/P :
Code:
#define ZED_RESETpin 40
pinMode(ZED_RESETpin,OUTPUT);
.
.
resetGNSS();
.
.
void resetGNSS(){
  Serial << "RESET ZED-F9P GNSS ...\n";
  digitalWrite(ZED_RESETpin,LOW);
  delay(10);
  digitalWrite(ZED_RESETpin,HIGH);
  }

Maybe I have the right pin, but output defaults LOW following the pinMode()? (the RESET# line has a 10k pull-up on the GNSS fn Board)
 
I may be slightly confused, you mention: Micromod Teensy 4.1

There are Teensy 4.1 boards and there are Micromod Teensy boards.

From this I am assuming Micromod.
As B0_04 is on pin 40:
4040*B0_042:04Wire3(2) SCLQT2_12:4LCD_DATA0

However if you are talking about Teensy 4.1 board and you want B0_04, I do not believe this pin was brought out on the T4.1 (or T4)
 
Maybe I have the right pin, but output defaults LOW following the pinMode()? (the RESET# line has a 10k pull-up on the GNSS fn Board)
Probably. Use digitalWriteFast() to set the output value high before activating output mode.
 
I also wonder at times if it would work to open the pin like: pinMode(ZED_RESET, OUTPUT_OPENDRAIN);
 
you mention: Micromod Teensy 4.1
ignore that 4.1 - just me being slack
I have all your pinout spreadsheets kurtE, in fact they were the only reference with the link to digital pin 40. Curious: where did you source that info?
Use digitalWriteFast() to set the output value high before activating output mode.
Good idea, thanks jmarsh. I assume you're suggesting like this? I'll give it a go ..
Code:
#define ZED_RESETpin 40
digitalWriteFast(ZED_RESETpin,HIGH)
pinMode(ZED_RESETpin,OUTPUT);

Now I'm wondering what is the default pinMode of all pins at startup, floating?
And does it have to be digitalWriteFast() why not plain old digitalWrite() ?
 
Now I'm wondering what is the default pinMode of all pins at startup, floating?
And does it have to be digitalWriteFast() why not plain old digitalWrite() ?
Default pinmode is input so they are floating.

digitalWriteFast() has to be used (to set the output level before setting the output mode) because historically with Arduino boards, using digitalWrite() when a pin is configured for input toggles the internal pullup rather than the output level.
digitalWriteFast() is a Teensy-specific function so it can act differently without worrying about breaking existing code.
 
Back
Top