Hi,
we're moving from Teensy 3.5 to Teensy 4.1 on a custom pcb.
On 3.5 we use Serial2 (pin 9 and 10) to talk to modem but is on different pins on 4.1. (pin 7 and 8)
To prevent us to modify pcb we need to use FlexIo library but I can't make it work, modem do not respond.
The sketch I use is very simple:
Any hint ?
Thank you,
Lude
we're moving from Teensy 3.5 to Teensy 4.1 on a custom pcb.
On 3.5 we use Serial2 (pin 9 and 10) to talk to modem but is on different pins on 4.1. (pin 7 and 8)
To prevent us to modify pcb we need to use FlexIo library but I can't make it work, modem do not respond.
The sketch I use is very simple:
Code:
#include <FlexIO_t4.h>
#include <FlexSerial.h>
#define MODEM_RX_PIN 9
#define MODEM_TX_PIN 10
#define MODEM_POWER_PIN 12
#define MODEM_RESET_PIN 11
#define MODEM_BAUD 115200
FlexSerial modem(MODEM_RX_PIN, MODEM_TX_PIN);
void setup()
{
pinMode(MODEM_POWER_PIN, OUTPUT);
pinMode(MODEM_RESET_PIN, OUTPUT);
digitalWrite(MODEM_POWER_PIN, LOW);
digitalWrite(MODEM_RESET_PIN, LOW);
// waits for Arduino Serial Monitor
while ( ! Serial ) { }
Serial.print("turn on modem...please wait...");
digitalWrite(MODEM_POWER_PIN, HIGH);
delay(5000);
digitalWrite(MODEM_POWER_PIN, LOW);
delay(7000);
Serial.println("ok!");
modem.begin(MODEM_BAUD);
}
void loop()
{
int ch;
if ( Serial.available() )
{
while ( (ch = Serial.read()) != -1 )
modem.write(ch);
}
if ( modem.available() )
{
while ( (ch = modem.read()) != -1 )
Serial.write(ch);
}
}
Any hint ?
Thank you,
Lude