I am trying to adapt the Teensy TLC5940 library to work with the TLC5943 (16 bit PWM instead of 12 bit). Data Sheet TLC5943
For this project I am using a Teensy 4.0.
The main difference between the two LED drivers is...
You need to pass -fdata-sections and -ffunction-sections to the GCC compiler when compiling ALL code and --gc-sections to the linker to eliminate unused data and functions in the ELF executable. Perhaps those aren't...
Hi There, I've got 2no Teensy 4.0's connected to two separate HOTAS systems, they had both been running and working fine for +12 months - then ~2 weeks ago, I went to play a flying SIM game and my HOTAS wasn't...
Hello,
Wow, go to sleep and wake to ideas, thanks. A bunch of these thoughts match where my head was going as I laid in bed thinking rather than sleeping. I dont need perfect 40Hz for extra data so I will...
I also use Visual Studio but with Visual Micro.
Using that you can use the LTO compile/link options.
I believe that it's the LTO option that takes out unused code.
I did as suggested, found a sym file, and gave it a good look over. Filtering out everything in section .text.itcm and then doing a column block sum on the sizes came up with almost exactly the count of bytes in RAM1,...
Thank you defragster, that's interesting. In my case this time there is no powered hub, it's direct. Could it be that the draw was too high for too long and that chip failed?
Have used USB Host here direct and with powered hub - never on batteries and have not seen this on T_4.0 or T_4.1.
There is a chip onboard that switches the power pin on the USB Host and feeds directly from the...
Just did that to post and it gave build error so posted that ... Seems to have built and worked fine but some linkage to altered file location is missed and triggered 'error'.
So that should give info on sizes.
Run...
@PaulStoffregen - when build of sketch Export it seems the updated path may not be used at some point?
Did the Sketch/Export on Windows and got this that worked as expected - first time tried and it is in indicated...
If you use the "export compiled binary" option in the Arduino IDE it should place some extra files in the sketch folder, including a symbol listing with sizes to see what is taking up the most space.
BTW, I would be interested in any suggestions. I am making a portable THD audio signal analyzer using a Teensy 4.0. Looking around for a good screen to display my 16384-point FFT output. The typical tht screen doesn't...
If a thread tries to claim a mutex that isn't available, it HAS to switch. That's a co-operative switch, compared to a pre-emptive switch (triggered by end of the thread's timeslice, e.g. a timer triggering).
Not saying mutex interaction can't cause trouble ... just that the by design Threads won't switch during normal interrupts that default to mid level PRI.
UART code is fed by interrupts which would be safe - but any...
What it really needs is semaphores, since they aren't "owned" by any thread and are typically safe to use in interrupt handlers (handler releases a semaphore which a regular thread is waiting on). A volatile int can do...
Just looked - seems this is #ifndef __IMXRT1062__:
IntervalTimer context_timer;
...
/*
* Implementation strategy suggested by @tni in Teensy Forums; see
*...
Whether it used an interrupt to switch threads or not, for a co-operative switch (the current thread needs to be paused because the resource it needs is owned by someone else) the stack would get switched regardless....
Didn't check, but wondered what priority TeensyThreads uses for what is assumed an interrupt for task switching? If that were lower, then higher PRI interrupt code would be safe to complete and exit.
If not lower...
Generally you can't use a mutex from an interrupt handler context, which is where the intervaltimer callback is called from. Reason being if the mutex is blocks, the program will switch to a different thread including...
simple "int func()" here the other day was CrashReport'ing when it had no 'return intX;' - didn't see the build warning for far too long ...
Used the addr2line that was on the computer that used to work and it gave...
And actually you don't need to use the "power of"- function to achieve just a 2^n result. You can also just left shift a value of 1 by n; that gives you the same result but is much faster.
void...
No, you're wrong. In both modes data is sampled on the falling and shifted out on the rising edge. That's the reason why both modes work. The only difference between SPI_MODE1 and SPI_MODE2 ist the Clock Polarity at...
Hello,
I am working on a data logger for a trackday (race track) motorcycle. The full code requires CAN bus, GPS into Serial1 etc so below is a skeleton of the same structure and though doesn't repeat the issue as...
Hey it works! It was the mode, needs to be SPI_MODE1 or 2 as Synvox suggests (MarkT said it too!). And though I tried all the modes before, I think this was before I had tied the RESET pin to HIGH, an oversight on my...
So I'm designing a module that reads and then sends analog and digital inputs over CAN bus.
I'm having trouble deciding how to tackle the digital input design.
In motorsport electronics these type of inputs...
Hi there, I believe I'm in this situation and I don't now how it happened / what caused it other than indeed running my circuit (off a battery via 5v pin) a bit longer than usual. The result is the Teensy still works...
Guys, I think I figured it out!
Pin A0 aka Pin 14 was apparently used by the audio shield as S/PDIF-out as well.
So I tried pin A2 and configured it as INPUT_PULLDOWN and that gives me the desired result! :-)
It...
That breakout board is wired for Rev B or Rev C. At the time it was made (mid 2019), Rev B was the latest version.
Rev D won't work (unless wires are used to route the signals where needed).
A quick question. Was using the PJRC Teensy 4.0 beta version breakout board with a couple of audio adapter version D. Cannot access SD card on audio adapter with WavFilePlayer. Tried various SPI settings with no luck....
I tried your suggestion and I get:
c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe:...
This error means your variables + code are too large for RAM1.
Try adding DMAMEM to one of the large arrays, like this:
DMAMEM float fftinL;
float fftinR;
When ORD is 32768, each array takes 256K.
And for info below the message after succesfully compiling with ORD=16384:
Opening Teensy Loader...
Memory Usage on Teensy 4.0:
FLASH: code:56120, data:136376, headers:8204 free for files:1830916
RAM1:...
Hello
I already posted this but don't see it on the new post so I'll post again. I am trying to compile some code . I have the error msg:
c:/program files...
My oh my! Such a simple and in restrospect... obvious ...thing I should have tried.
Set both flags to false and it works perfectly. The debug flags should only be used with the IDE open anyway. I'm guessing the IDE...
Well that fixed it.
And now that I think about it, the xcode prompt came up after i reinstalled the teensy boards the same way initially.
I had replaced the platform.txt file with a modified one which I thought were...
Before you pour a lot more time into custom python code with DIY udev rules, only for the sake of troubleshooting I'd recommend testing with Arduino IDE serial monitor using the PJRC published udev rules. Make sure...
The pathname looks as if trying to use the files meant for Arduino 1.8.19, but you have Arduino 2.1.0. The Teensy package is slightly different for Arduino 2.1.x than it was for Arduino 1.8.x. Even though the code is...
I just installed the Arduino IDE but it wasn't recognizing the plugged in Teensy 4.0 and every time I tried to verify/compile, it would throw up this error:...
I ended up using an other battery module that has a higher charging current.
This module has no 3V bus so I am trying to measure the voltage directly at the battery as you suggested.
With a voltage divider...
Hi Paul, thanks for your reply,
Sorry for the confusion, I didn’t mention it but when I change the Teensy, I also change the Serial parameter with the corresponding number.
What's more, the number I've indicated...
I played around with it for a bit and it doesn't look like there is going to be an easy fix. On the LVGL page I found the instructions for setting it up and they use the drivers from NXP's SDK. The big problem is that...
I would probably format the flash FS...
For example look at the LittleFS example LittleFS_Usage
You will see it starts off calling: myfs.quickFormat();
You can also do low level format as well.
Some of...
Either of these should work. From: ...\libraries\LittleFS\examples\Test_Integrity\QSPI\functions.ino
case 'F': // Low Level format
Serial.print( "\nFormatting Low Level:\n\t" );
lastTime = micros();...
I'm using the LittleFS and MTP libraries to easily transfer data to-from a Teensy4.1 with a W25Q128JV qspi flash soldered on the bottom side.
Everything was working fine until I tried to transfer a file that exceeded...
Good to know. The Hack showed it wasn't as 'hoped' the same underlying buffer used for IP-based TCP.
Is there a solution to the p#12 lost/delayed TCP data? Or is that the nature of TCP that items need to be handled...
The best introduction is probably at https://www.pjrc.com/teensy/td_libs_Audio.html, but then it’s mostly a case of looking at the existing objects, figuring out how a simple one works, and having a go at modifying it...
Use of "ATTRS{serial}" restricts this udev rule to 1 specific Teensy board. If you plug in a different Teensy, even if it's the same Teensy model, it will have a different serial number which causes this overly...
`EthernetFrame` is for raw Ethernet frames (probably not what you want here), `EthernetUDP` is for IP-based UDP, and `EthernetClient` is for IP-based TCP.
Indeed, the original design goal was for all instances to be static. The main issue with deleting instances is the input queue can "own" audio blocks at the end of an update, which then get used on the next update. ...
I would like to help with that, but I've tried before to understand the Audio library, but I don't even know where to start.
The truth is that I've been using it a lot, and someday I would like to deep into it to...
So I fixed that and still had the issue. I believe it resolved when I converted the lowercase .wav file extensin to be upper case.
Is it required for the file extension to be upper case as well? If not...
Seems like it should, Yes. Per the notes left above it might reduce overhead of TCP and quick testing shows no problem sending 28 bytes in 10us from one and received fine on another Teensy.
Seems the send might take...
It wasn’t designed in from the start, for some reason. I’ve had a go at remedying this, see https://forum.pjrc.com/threads/66840-Roadmap-quot-Dynamic-Updates-quot-any-effort-going-on. If you give it a try, please do...
Ok! Thank you for your response, I was going crazy looking at my code
Why Teensy doesn't support deleting audio objects? Is it just because its not coded or is there something else going on?
Correct - the SD card's SCK signal is on Teensy pin 13, which is also the built-in LED pin. This is unfortunate, but unavoidable. The only way to turn the LED off is to physically remove it, but that won't help the...
C0G are available in small values only (for suitable small packages), decoupling MLCC's are normally X7R or similar as the stability and microphony is not usually an issue and these types are much smaller (far higher...
Indeed forum search can be lame - when it doesn't work. Though with usable keywords - as in this case - it did find and narrow well enough.
I use BING and have the browser do site ref when it starts "PJRC" and it...
If the scanner was set up to use UDP? then using that would be an option. Seem that TCP messages still being used?
As for how to use the '.setReceiveQueueSize' - that just came up in a text search when I saw what the...
Hello @defragster,
Please forgive my newbie question. Should I be using a EthernetUDP instead of EthernetClient client?
If I continue to use the EthernetClient, how do I use...
Oh, I considered asking about that but forgot. The datasheet, section Layout Guidelines, says there should be 10μF plus 100nF at the power pins (digital and analog). Those would be a low-ESR electrolytic and a C0G...
Using the UDP the default queueSize had to be increased that was with:
// UDP port.
EthernetUDP udp(32); // (##)-packet buffer allocate for incoming messages
Looking at:...
recalled and found this thread: pjrc.com/threads/68148-Teensy-4-x-RTC-battery-life?p=294269&viewfull=1#post294269
Search that worked was: RTC Battery Life
This has been asked before on the forum. I seem to recollect that some cheaper ones have a longer life than the more expensive variety.
If you google PJRC RTC Battery Life I am sure you will find some useful...
I am using this shield to add a battery to the teensy:
https://www.sparkfun.com/products/15716
Any idea how long the battery will last?
Have a nice day,
schlank
I wrote the attached code to interface to that sensor. The code is a modified example from the QNEthernet library.
As a way to check for consistent operation, I calculated the time between each update. It should be...
hi there, just a quick update on this project (still no video) :-(
I have changed the midi output of this bass back to normal usb-MIDI client, since I can use it with a laptop directly when I am on the road...
Hello,
the SPI Mode should be SPI_MODE1 or SPI_MODE2 (either should work), so either CPOL=0 AND CPHA=1 or CPOL=1 AND CPHA=0 but not both 0 or both 1.
In the Datasheet they do not state if /RESET has an internal...
Hi everyone,
I have a Teensy 3.5 connected via USB to a Raspberry Pi. This Teensy sends data frames to the Raspberry via the serial port.
The Teensy is recognized by the Raspberry thanks to a predefined name...
Unfortunately, this data type does not work. Still no output. Now it's getting confusing because that should be exactly what that transfer() method expects, right?