I am seeing that the max output current of a digital pin on a 4.1 is 4mA. So to drive a typical TH red LED requires a transistor in order to get enough current?
Back to original sketch now from playfultechnology per the DDWH disclaimer (whose changes were really good ideas). It's running with my mic gain set to 37 dB. The greeting.wav is pretty loud/distorted so I need to...
That's right :)
You're quite right. I've corrected my fork, which also updates the pull request that's been pending since 3rd February...
Yes. I think a lot of his changes are very useful, so the "do not use" is...
The update req'd a dog walk:D. Just got back and opened 2.0.4 and the board list showed 1.58.0. Installed with no problems. Various issues with String and time_t appear fixed!
Awesome, thanks.
FYI, probably...
@PaulStoffregen
https://www.pjrc.com/teensy/package_teensy_index.json
worked for me for both 0.58.4 and 1.58.0 to allow these versions to show in the boards manager. It auto updated the index after I changed it....
Download the latest version of TeensyDuino. Version 1.58 will be available later today.
EDIT: Sorry you can download it from: https://github.com/KurtE/MTP_Teensy
I've found this class useful for collecting statistics for a stream of data in a single pass. Simply call `update()` with the new sample and it does single-pass calculation of the mean and variance. Note that I've used...
What tells you that I didn't do the last of the tweaks? (in #6 above)
Is it that I didn't use AudioPlaySdWavX ?
And as a side note, the README from playfultechnology states "DO NOT copy the play_wav_sd.cpp and .h...
I've put the tentative 1.58 release files on the server. If you want to give them a try with Arduino 2.0.4 or nightly, use this URL in File > Prefs
https://www.pjrc.com/teensy/td_158/package_teensy_index.json
So I loaded the code, then saved it to C:\users\tevalis\desktop\teensy progs\audio-guestbook.
It then saved as C:\Users\Tevalis\Desktop\Teensy progs\audio-guestbook\audio-guestbook\audio-guestbook.ino
When I try to...
Good Morning Paul (and all),
If you are following the MassStorage... thread, you probably have noticed a few comments about corruptions of lists. Yesterday I did find a very possible set of conditions that maybe...
I have a fully digital power bench working with the Teensy3.5 using its DAC for controlling the Output.
Is the MCP4922 an alternative for that purpose in case the Teensy3.5 is going down?
Alas, I get .18 on the 3.3. She's dead, Jim. I wish I knew what I did, Teenys are very robust. Maybe I have carelessly brushed a hot 5V wire somewhere.
First step to diagnose U4 overheating is measuring the 3.3V power.
If you see only millivolts, the short is probably metal. Often this sort of failure is fixable, if you can find and remove the stray metal.
But...
I cannot exclude that possibility.
Thank you very much for the screenshot; that really clears things up. I wasn't taking account of SAI1_CLK_PRED and SAI1_CLK_PODF. So, as far as I understand, the output frequency...
I’ll have to see what I can do around this. It’s a design that was originally for the 3.5 boards that I’m altering for 4.1, but I probably have a few options for lowering the impedance of these input circuits
Thanks...
I managed to copy the code out of digital.c in the cores area and customise it to work. Looks very similar to this, but I also added the before/after checks from pinMode() just to be safe. Thanks so much for pointing me...
Have you visually inspected the board under magnification to verify that the soldering looks good and no parts look cracked/burned? Read elsewhere where someone found a cracked cap (fortunately it was not critical) to...
You can go here to understand what the "blink" codes mean and can progress from there: https://www.pjrc.com/store/ic_mkl02_t4.html (near bottom of page).
According to that information; 3 Blinks = Flash Chip Error,...
Yep, I definitely did it before, and I just did it again, 3 times, 13, 17, and 60 seconds. As soon as I plug it back into the USB, that chip starts to cook. I guess I'll just order another one. Dang it!
Have you tried resetting it to factory? Does the factory reset run and does that revive it?
Memory Wipe & LED Blink Restore
Teensy 4.1 will fully erase its non-volatile memory and return the flash memory to a...
Try this for your loop()
void loop() {
delay(1000);
uint64_t tmi = rtc_get_64();
// Convert the time value to seconds
uint64_t time_seconds = tmi >> 15;
uint64_t time_microseconds = ((tmi &...
Just to conclude: I ended up soldering on an sdcard adapter to the teensy as shown in post #18 here
No more noise. I was hoping for a cleaner solution, but this works.
I often use differential i2c.
Then ordinary RJ45 cables can be used.
I have succesfully used 10Meter cable @400Khz by use of HQ shielded CAT6a cables.
I use PCA9615 / PCA9615 (if an irq is needed).
...
I've seen the other threads about this being a power short problem. This is not my first Teensy, I had some new code running fine: https://imgur.com/gallery/kZRfvxw/comment/2315634137. The only problem I was having...
I ran more tests with serialEvent and _serialEvent_default. Here's a simple test program.
extern const uint8_t _serialEvent_default;
elapsedMillis timeout;
void setup() {
pinMode(13, OUTPUT);
...
As far as I can tell, readSectorsCallback() is still forcing the user to wait. It would probably be more useful it was a non-blocking operation that triggered the callback when the read was complete.
Also, just to be a pain with the questions, is there any guidance around what is 'too slow' for a rise time? In this setup the full rise from 0 to 3.3v is about 8uS, but probably around 4uS to 2.7v. That is somewhat...
Users seem to ignore that ChatGPT is a language model not a knowledge model. I.e., it is trained to generate texts which look as human written as possible. Which it does quite qood I'd say. If you ask it to write a...
When getting it to write code you can paste the compile error into the chat it will attempt to fix the issue. But you have to close that loop yourself rather than it automatically checking it's own output.
If you...
Wow, that fixed it, thanks! I wouldn't ever have thought to try that as a fix for this type of issue. So the falling interrupt can fire on a rising pulse if it is too slow?
Is there any way to enable the hysteresis...
Looks fine on a first glance.
I can have a closer look but it would make things easier if you could prepare a minimal sketch which compiles and shows the issue without the midi stuff, buttons and other hardware
Try a
pinMode(20,INPUT_PULLUP)
This, as a side effect, will activate a hysteresis on the input which prevents double triggering on slowly rising input signals.
This makes it slightly more obvious:
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(10, OUTPUT);
attachInterrupt(20, pinFallingISR, FALLING);
}
void loop() {
Still the same thing with that asm("DSB"); added unfortunately. Doesn't matter which toggle method is used.
In my actual sketch the ISR is quite a bit longer than the example, but it's probably still exiting fairly...
That pretty much says it. It's a pity. Capacitive sensing is such a useful feature! I guess the newer chips just don't do it natively.
I believe the CapacitiveSensing library would still work on the 4.x but it...
Try adding this to the _ISR() code: asm("DSB");
That short _ISR() code exits and is likely returning given how the 1062 tracks interrupt completetion. Done so fast the update to 'handled' isn't noticed before the...
I managed to make it so that commands are initiated in user code (the first call queue_Data_Transfer), but then all the subsequent calls related to the command are handled in the callbacks. Seems to work nicely. I'll...
So, I thought I was going crazy but I think there's an issue with the edge triggering interrupts on Teensy 4.1. If I set a RISING or FALLING interrupt using attachInterrupt then I will occasionally see the ISR getting...
Hi all,
This is the situation, on my Power meter build with Teensy4, I installed also a ESP32 to get wireless all data the ESP32 and Teensy4 works perfectly and I can load the firmware for the ESP32 via pass trough...
Also, I tried plugging in a drive that uses 4KB sectors - instant reboot the first time it tries to read a sector. Seems the SdFat code is hardcoded to use 512byte sectors so it causes a buffer overflow, probably...
Here is my code using your suggestions for extracting the 64-bit RTC in 1/32768 second increments. I able able to get time in seconds, in the upper 64-bits, but struggling with the microseconds, as you can see:
...
I tried something similar but used a class - disable/store original interrupt state in the constructor, restore in the destructor. Saves having to catch all the exit points of the function.
I also tried just reference...
Looks like ChatGPT gave you bogus code that doesn't even compile.
ChatGPT is really the ultimate in "book smart". It knows enough raw info to cobble together answers that look plausible. But when you actually try...
Forgot to add in my previous post (so you don't have to go hunting for the information): PR 672 just affects _serialEvent_default and not the others. I had only added `extern` to that variable.
(See also:...
Okay, I'm relieved. Thanks for double-checking. I was concerned because my tests, printing the value from inside `yield()`, showed that it was zero. Maybe it was because I was using GCC 11.3.1-beta2 (from Teensyduino...
I've updated the list of changes since 1.58-beta3. It's a *lot* of small stuff. If I missed anything important or didn't credit the right people, please let me know.
I tested serialEvent. I also checked the value from Arduino sketch code and it was 1, not 0.
But I didn't try the hardware ones like serialEvent1. Will do that this evening.
Ok, it sounds like `_serialEvent_default` being zero inside `yield()` isn't a problem, then? To confirm, this line of code, as it stands right now, won't execute (without adding `extern` to the `_serialEvent_default`...
What version of the firmware does your airlift/esp32 have? Mine has 1.2.2. I'm wondering if this makes a difference. I'm going to look into upgrading it tomorrow.
I spent some time fiddling with LTO last night. It's far too broken to enable in the Arduino menu for a stable release.
Also looked at the serialevent and yield optimization. It is indeed confusing. Long term, we...
The fix in PR 682 doesn't address LTO builds. It addresses an issue that was introduced by PR 672 for _all_ builds, including for non-LTO builds. This is the important detail. Right now, even without building with LTO,...
I have no idea why Arduino 2.0.4 isn't updating the package index on those old macs, but I'm pretty sure there's nothing I can do about it. Recommend giving it overnight to maybe right itself automatically... before...
Yah, that was not the problem. As stated the 'package_teensy_index.json' file is not the latest on old macs for some reason. It updated fine from 0.58.1 to 0.58.2 to 0.58.3. If I remove the file from...
Ya, I agree that user code should have to wait while the data is read / written. Things would get pretty messy otherwise. In my non-blocking USBDrive init, I do the initialization as a state machine inside of Task()...
Please forgive me for being a broken record, and I acknowledge you've likely seen this PR and are likely still deciding what to do, but I think this particular fix is important to restore `yield()` to its behaviour...
(on Windows) IDE 2 was already open here and didn't see it at first glance so closed IDE 2.0.4 and then looking at Teensy boards after restart it was there near the bottom over 0.58.2 as 0.58.3 was missing from list -...
Note: most of the cases that this would hopefully fix are those that are initiated from the user code. Like: please write 4096 bytes to the file... Things like Reads are mostly handled by first doing the queue out of...
Installed 0.58.4 fine on M2 MacBook Air with Ventura and IDE 2.0.4.
On MacOS Catalina with IDE 2.0.4 can't get 0.58.4 to show up. Did the shift-apple-P and can see the new date modified on...
Hi Everyone,
I am working on a project that requires more than 8 encoders (and other peripherals on other Teensy pins). I'm using the EncoderTool library to multiplex 8 of them using a 74hc165 shift register as well...
Thought I saw something where you mentioned that but couldn't find it again. Congratulations. Been retired now for about 7 years. Missed it at first but that went away fairly quickly :)
@yeahtuna - I just got home from work, I might be called back in tonight:( I am really glad this has solved your issues:) I will try it out tonight if I can. I also have some retirement things to take care of first....
I also keep getting a popup that "Connection Failed: Activation of network connection failed".
It looks like my ethernet port is just unable to connect to the teensy if I'm understanding this correctly. Maybe it some...
I'll try it out today, but I feel like it's using duct tape to fix a problem. Obviously commands need to begin in user code, but subsequent calls to queue_Data_Transfer should probably be done inside the callbacks so...
Installed W11 using IDE 2 todays nightly build.
Ran a couple of tests. So far so good!
Will try on Ubuntu although I think my hard on that machine is toast and/or the install is.
Thank-you so much. This fixes the issue for me. I can't tell you how many hours I have spent pouring over the UBSHost code desperately trying to fix this issue.
@KurtE
Tried your changes with the MIDI test sketches and didn't notice any issues crop up. So thats good.
Then I ran my mtp-test-integrityV2 test sketch and ran 2 writes:
Start Big write of 2048000...
Installed on windows 10 x64 no issue with IDE
Version: 2.0.5-nightly-20230311
Date: 2023-03-11T03:07:12.638Z
CLI Version: 0.31.0
Install output
Tool teensy:teensy-discovery@1.57.2 already installed
Tool...
That's very interesting (or strange, if you prefer...). There seem to be some fixed-gain stages in the SGTL5000 mic amplifier, of which +40dB has the highest gain, so it may be the variable-gain stage is causing most of...
Note: I just pushed up a new fork/branch: https://github.com/KurtE/USBHost_t36/tree/queue_transfer_protected
Where I updated:
bool USBHost::queue_Data_Transfer(Pipe_t *pipe, void *buffer, uint32_t len, USBDriver...
Also from b3 notes {near here}
Plug in a T_4.0 - in addition to T_4.1:
As p#2 build coremark for T_4.1 selected in IDE 1.8.19: Upload no problem.
As p#2 build coremark for T_4.1 selected in IDE 2.0.4:
Teensy.exe...
*** I love that stuff. Have a good supply of it, left over from my wirewrap days. HOWEVER - looking at that boot chip - I think
even the 30-gauge stuff is too big.
Or is it? The boot chip is an MKL02Z32VFG4...
Windows 11:
Ran installer on 1.8.19 and all went well.
Built COREMARK to a T_4.1 no issue: "CoreMark 1.0 : 2407.90 / GCC11.3.1 20220712 (flags unknown) / STACK"
Opened IDE 2.0.4 and did Board update to 0.58.4 no...
Sounds good. I am playing a little with the USBHost stuff, to maybe plug a few more possible data corruption possibilities.
For example, in RAWHID you do a sendPacket
It simply calls through to the HID code:...