The mask for the C/D FLEXPWM timers is ALT 2 (ref page 515)
*(portConfigRegister(ChannelC)) = 2;//Maske;
*(portConfigRegister(ChannelD)) = 2;//Maske;
See...
Type: Posts; User: manitou
The mask for the C/D FLEXPWM timers is ALT 2 (ref page 515)
*(portConfigRegister(ChannelC)) = 2;//Maske;
*(portConfigRegister(ChannelD)) = 2;//Maske;
See...
my T4 micromod (7/13/21) and ATP carrier show all ATP edge pins are good. I just probed ATP pins with GND wire and this Loop()
void loop() {
for (int j = 0; j < MM_PINS; j++) {
if...
It is common practice to use TCF1EN. if you choose to use TCFIE, then in the ISR you need clear the TCF bit
TMR4_SCTRL2 &= ~(TMR_SCTRL_TCF);.
If you don't clear the TCF (or TCF1) bit in the ISR,...
Why not just use Teensy hardware PWM and avoid the ISR overhead all together ?? Here is sketch that generates 23 hz on pin 11 at 80% duty
void setup() {
analogWriteFrequency(11, 23.44);
...
To keep a T4 ISR from firing twice, it is recommended to add asm volatile ("dsb"); to the ISR
The Teensy 4 PWM can generate a square-wave (without CPU intervention). The PWM frequencies are discrete divisors of 150 mhz. so you can't get exactly 24mhz. Try this in setup()
...
the .cpp file you attached looks to be the original from the github site ??
I added a scope snapshot to post #5 showing LC pins 2,14,7
Hmmm, If the FTM timer is ticking at 4 MHz, then to generate a data pulse will require a tick to generate a HIGH bit and then a tick for a LOW bit, so the data rate for galvanometer data will be 2...
See follow-up thread
Re: a better fix?
A better solution is to remove the if(txPing & 2) logic from the isr in the library, so the dma.sourceBuffer() is executed on every DMA ISR.
// if(txPing & 2) {
// txPing...
here is sketch that demonstrates using TPM2/DMA to set the lower 8 PORTD bits on Teensy LC (tested with scope on PORTD pins)
// PORTD pins 2 14 7 8 6 20 21 5 TPM2
#include <DMAChannel.h>
...
for what it's worth, here is small T3.2 comparator sketch. I used a scope on pin 22 and pin 10 to measure latency
// comparator latency test COMP1 T3.2
// test with 1khz PWM from pin 22
// pin...
The GPT timers can have an external clock source. In the Teensy 4 ref manual search for "GPT1_CLK" to see which pins are used for each GPTx timer. Also see GPT2 external clock example at...
this DHT lib https://www.arduino.cc/reference/en/libraries/dhtlib/ says it is designed for AVR processors -- Teensy 3.2 is ARM not AVR. lib is using AVR registers for IO
// replace...
if you "got it working using just SPI", did you find the performance lacking? When I do a 1024-byte SPI.transfer() with SPI clock at 40MHz, I measure a data rate at 37.4 megabits/sec. I believe...
you could also do a reset, add this to your ISR
GPT1_CR |= GPT_CR_SWR;
GPT1_CR |= GPT_CR_CLKSRC(1); // Set clocksource to Peripheral Clock
How about trying
analogWriteFrequency(16, 8000000); // 16 and 17 max 8mhz uses TPM T3.6 only
analogWrite(16, 128);
after starting the analogWrite() you could print out the various TPM1...
Works for me too.
Here is complete example using FreqCount to measure frequency on pin 14. (For Teensy 4, gateinterval is in microseconds ! Who knew. web page documentation needs updating.) ...
see discussion on "slow PWM" for Teensy 4 using XBAR
https://forum.pjrc.com/threads/25164-2Hz-analogWriteFrequency-on-Teensy-3-1?p=247337&viewfull=1#post247337
LECTURE ON:
Using unbounded string operations results in hard-to-debug programs and programs subject to hacker exploitation. So having a max size value is the more desirable API. Kudos to Teensy....
Re: readStringUntil()
The teensy Stream library has a 2nd argument for readStringUntil(), see hardware/teensy/avr/cores/teensy4/Stream.h
String readStringUntil(char terminator, size_t max =...
I'm not sure why readStringUntil('\n') worked for you. Looking at packets from the weatherserver, there is no \n in the reply TCP packet, just the json string (last character is } ). Maybe...
I was able to get your sketch running with a T4.0 connected to adafruit WINC1500.
Starting weather connection to server...
connected to server...
FWIW:
If I use "double" instead of "float" in sketch in post #4, I don't see a superscalar speedup.
Teensy 4 @600mhz Faster
float
bench1: 0.999970, 2133434 us MFlops 224.99
bench2:...
Yes, when i use INPUT_DISABLE in the loop()
Your assignment is to produce the smallest sketch that behaves differently on your T3.2s -- and then post that sketch to this thread so others can try.
In the Knock example try adding pinMode(A10, INPUT_DISABLE); to the if statement
if (sensorReading >= threshold) {
// toggle the status of the ledPin:
ledState = !ledState;
//...
i don't think the eeprom_initalize() sets or changes any values in the EEPROM.
You might just remove all references to EEPROM.isReady() in your sketch and let the EEPROM read's and write's...
OK, i had a T.32 (batch 1805) that had never had its EEPROM used, and the sketch in post #1 hung! After running one of the T3.2 EEPROM examples, then the post #1 sketch ran. ;)
looking at eeprom.c, it looks like for read's and write's it tests if eeprom is ready, and if it is NOT, it calls eeprom_initialize(). So maybe one needs to run one of the examples from teensy...
The last line of MCU etching contains a batch production date. CTER1644B is year 2016 and week 44. ) I don't have any "recent" T3.2's. I have one with CTAD1806B. I fetched the EEPROMex library,...
I have no EEPROMex.h any where on my linux file system???
google tells me it is part of https://www.arduino.cc/reference/en/libraries/eepromex/, an AVR extension to the Arduiono EEPROM library. ...
your sketch in post #1 works for me on T4.0 with Adafruit ultimate GPS. (No 5v and no level shifters)
3v3 to GPS Vin, GND to GND, T4 pin 7 to GPS Tx, T4 pin 8 to GPS Rx
Time: 16:41:58.000
Date:...
have you tried analogWrite(16,128) on T3.6? I believe that is using TPM1 channel 0. I have some test functions for T3.6 TPM, see
https://github.com/manitou48/teensy3/blob/master/k66TPM.ino
you...
As noted on T3.2 card, backside pins 25 and 32 are PWM. So the simplest solution is to use analogWrite()
analogWriteFrequency(25,48000);
analogWrite(25,128); // 50% duty
Here is what the pin...
you should declare any external variables that are getting updated in the ISR as volatile
volatile unsigned int ISR_Cnt = 0;
here is a working example https://github.com/manitou48/teensy4/blob/master/gpt_isr.ino
I think the Everspin read/write currents refer to the power drawn by the MRAM chip on the PCB Vin and not to the current on the SPI pins.
Do you have another SPI device to confirm SPI on Teensy...
Here is a simple float/double sketch that I've run on ESP32 and Teensy 4. you can change the #if 0 to #if 1 to select float or double. Try it on your hardware.
// ll2utm
// double/float...
Looking at the source, the timeStatus values are
typedef enum {timeNotSet, timeNeedsSync, timeSet
} timeStatus_t ;
So the value of 2 is "timeSet", maybe if statement should read
if...
I think the Teensy 4 NXP SDK has examples using the ACMP comparators and DACs, see boards/evkmimxrt1060/driver_examples/cmp/polling/. The T4 "internal" DACs are only 6-bit. Here is a simple...
Just for the record, I have a SanDisk 8 GB uSD (SDHC, fat32) that has had lots of file activity. A directory listing from SD example listfiles on various Teensy 3* and 4* microSD drives (both SPI...
the examples/tutorials you are using are designed for T3*, not Teensy 4. The Teensy 4 has no alternate SPI pins, it will use pins 10-13 for SPI. Pin 13 is SPI CLK, so that'swhy LED is flashing...
Curious, what kind of microscope are you using?
The Ethernet MAC address and USB id are unique. The MCU stencil has a "batch date", me thinks, (shown in your closeup photo), but your concern is with the crystal.
That ppm is a bit high (spec 30 ppm?). My dozen or so T4's are within 10 ppm, though the Teensy4-micromod is 40 ppm, but that's a different PCB layout and different crystal (Sparkfun). Is your...
you should look at the NTP server thread. PID logic is used to discipline Teensy clock using GPS PPS and NMEA. It has software for Ethernet and NTP, but there is a post about a non-ethernet...
A bit messy. capture pins are fixed by the hardware. See page 297 of reference manual (search for ENET_1588_EVENT0_IN), there are 3 possible pins. library is using GPIO_B1_12. I don't know if the...
i have no problems with Teensy 4.1 using IDE 1.8.15/1.54 on Ubuntu 20.04. do you have the latest udev rules?
https://www.pjrc.com/teensy/00-teensy.rules
Voila, touchRead() starter sketch for LC:
#define THRESHOLD 2000
#define LEDPIN 13
void setup() {
Serial.begin(9600);
while (!Serial);
pinMode(LEDPIN, OUTPUT);