As shown in the attached picture, I have generated with a teensy 4.1 pulses of about 125 nanoseconds which show suprisingly quite high initial and final oscillations.To test the impact of the SRL, I have then tried without success to Disable/Enable the option with the following instructions (commented in the here below initial code):
CORE_PIN2_CONFIG &= ~PORT_PCR_SRE;
CORE_PIN30_CONFIG |= PORT_PCR_SRE;
Compilation of the modified code stopped with following error message:
'PORT_PCR_SRE' was not declared in this scope
17 | CORE_PIN2_CONFIG &= ~PORT_PCR_SRE;
| ^~~~~~~~~~~~
exit status 1
Compilation error: 'PORT_PCR_SRE' was not declared in this scope
In an attempt to fix this, a few libraries where included in the code, but did not solve the problem.
I am curently stuck!
Thank you in advance for helping me on this subject.
___________________________________________
Code:
#include <Wire.h>
#include <WireIMXRT.h>
#include <WireKinetis.h>
#include <TeensyThreads.h>
#include <buffer.h>
#include <color.h>
#include <gfxfont.h>
#include <_Teensy.h>
#include <imxrt.h>
void setup()
{
pinMode(2, OUTPUT);
// Disable SRL
// PORT_PCR_SRE set to 0 (default).
// CORE_PIN2_CONFIG &= ~PORT_PCR_SRE;
// Enable SRL
// CORE_PIN30_CONFIG |= PORT_PCR_SRE;
test();
}
void test()
{
while(true)
{
digitalWriteFast(2, HIGH);
delayNanoseconds(100);
digitalWriteFast(2, LOW);
delayNanoseconds(400);
}
}
void loop()
{
}