Also, you can dynamically allocate to PSRAM, so you can decide at run-time where you want your arrays.
https://forum.pjrc.com/index.php?threads/malloc-free-for-extmem-and-dtcm.63695/post-265250
Total RAM (RAM1 + RAM2) is only 1MB, so if you have code + data (static or dynamic) that approach or exceed 1MB, you'll need to assign some data to PSRAM (EXTMEM) and/or keep some code in FLASH (PROGMEM). Don't worry about it too much in advance...
No, you cannot get source code from a Teensy. T3.6 stores the binary image in flash that is part of the microcontroller, as opposed to external flash like T4.x. You are probably out of luck.
You could use "Serial3.flush()" rather than "delayMicroseconds(1150)". The flush() call will block until all the data has been transmitted. Information on the serial hardware is listed at td_uart.html
You definitely can update the Teensy firmware over a serial link. Whether it can be the same one you use to update the Nextion, I don't know. I suggest you try the FlasherX examples first, to get a sense of how it works. Try the examples of...
That warning was put in by the original author of Flasher for the T3.2. I extended it to support all T3 and T4, thus the X,and always left in that warning. For T4, there is no way that you can brick the device, so it’s “safe” in that sense. If...
The buffer must contain the binary image, not the hex lines. Since the hex lines are being sent via Ethernet, you can either convert to binary as the packets are received, similar to receiving via UART, or you can write the hex lines to SD and...
I don't know what you mean by tether, or running the same sketch, but assuming you get the signals to do what you want, there might be minor differences in the start times and minor differences in the clocks on the two Teensy, but those should be...
You should have a delay between Serial.begin() and the first Serial.print(), like shown below. You'll see this in most of the TeensyDuino examples. Without the delay, the println can execute before the USB serial is up and running and capable of...
I think you could come up various ways of connecting the two Teensys, so the button signal that turns on the LED actually goes to both Teensy via RS-485, which is good for the types of distances you're talking about. There would be some small...
Don't use F_CPU, use F_CPU_ACTUAL, which despite being all caps is a variable, not a macro, and it gets updated even when you change clock speeds at run-time. You can search the forum for more info.
After reading through this entire thread again, one recommendation is to stop and begin again. Your first post begins with a rejection of the Arduino IDE. We all get why Arduino is a big let-down for professional programmers, which includes many...
Sometimes it is helpful to add Serial.flush() immediately after your debugging Serial.print() statements. This causes the print to occur immediately so you don't get fooled/confused about how far your program got before the problem occurred.
I was also a Modula2 user. The good old days!. The H file is analogous to the DEF file, but with caveats. Modula2 was "object-oriented", so the thing you were defining in the DEF file was like a C++ class. Your transmitPacket and receivePacket...
I went to the Adafruit learning guide, and it has a link to their SSD1327 library on Github. It's a library, with both CPP and H files, and you can install it via the Arduino IDE. Just go to the library manager and type in SSD1327 to the search...
You have to distinguish between definition and declaration.
"TransmitPacketType transmitPacket" is a definition. Every time that appears in a CPP or INO file, whether directly or via #include of an H file, the compiler thinks you want to define...
TransmitPacketType transmitPacket;
ReceivePacketType receivePacket;
The H file defines these two variables, and that H file is #include'd in both the CPP file and the INO file, so that's why you're getting duplicate definitions. It looks...
For Arduino 2.x, you don't have to manually download and install TeensyDuino as you do for Arduino 1.x. Instead, you use the Board Manager in 2.x to select the Teensy board package, and it will do the download and install for you. See the...
Graeme says he is searching for RTOS, as in FreeRTOS, etc. These may not be OS in the sense of managing memory or multiple cores and/or programs, but they have long been called RTOS and do provide the features he lists.
There is a FreeRTOS port...
It looks like the two programs you posted are identical. Did you mean to post two different programs? I'm guessing, but don't you need to somehow "enable" event handling? I don't think simply defining SerialEvent1() is enough for it be executed.
I've uploaded an annotated copy of the NXP Reference Manual. It's linked from the Teensy 4.0 and Teensy 4.1 pages under Technical Information (where the plain old manual was). Here's a direct link to the PDF...
You don’t need to (and should not) include a copy of eeprom.c in your sketch, but at the top of your INO file you do need to add a declaration of the erase function and declare it extern “C”, as shown below. There is no need to call the 64K...
Your IntervalTimer is set for a period of 5000 us, or 5 ms. It's fine to read your encoder from the ISR, but you should not write to the SD from the ISR. The reason is that it can take much longer than 5 ms to open and write to a file. Even if...
Many (most?) Arduino libraries and drivers are not reentrant, so you cannot always use TeensyThreads in a preemptive mode. You must use it in a cooperative mode, which typically means define the timeslice as very long and make sure that task...
I recently posted a sketch that is based on Manitou's work with GPT input capture. I had some trouble with his test sketch, but I know that what I posted does work. Link below...
AFAIK this is already how it works; teensyloader only erases the flash area required for the sketch. LittleFS uses the highest portion of unused flash (below the area reserved for EEPROM emulation) so as long as the new sketch doesn't intrude on...
Nope I'm planning on analogWrite(). Each nozzle has a flow meter and based on the flow rate will feed to a PID and then analogWrite(OUTPUT);.
The equal on off in the original post was just where I left off playing with it. There was no special...
@luni, I gather this syntax is a called a lambda? I will remember it as a clear and simple example of how to use it to define a function "inline" rather than separately. Do you have any insight into why this syntax is called "lambda", or why it...
Sorry, that was a bug. Can you try version 1.4.3?
The following code correctly generates 500kHz signals on pin 0 and 1 using the PIT and GPT1 modules. It works for 24Mhz and 150MHz clock frequency settings.
#include "TeensyTimerTool.h"
using...
His original example showed equal on/off time, but guessing he will vary duty cycle to control spray. He says 10-20 Hz, so likely will use digitalWriteFast() rather than analogWrite().
You might want to look at Dan Drown's Teensy NTP Server. I'm not sure if by "network" you mean Ethernet network, but Dan's project shows how to derive an accurate timestamp using a 1 PPS signal from a GPS module. The basic idea is to use input...
At some point the interrupt processing load is going to be too high for the T4 to handle. It's not a "hard" limit, but I think you're bumping up against it. To generate higher frequencies, use the PWM hardware, which can be FlexPWM or QuadTimer...
If all the connections are correct, and it doesn't work, then it may just be too long. The built-in SD card on T4.1 is quite fast. and you generally can't extend something like that as far as you're trying to do here, with a ribbon cable. Does...
The root of the word quadrature is "quad" or "four". The idea is you have two square waves (A and B) with 90-deg phase offset, and by counting the rising and falling edge of both A and B you get 4x the resolution, and by keeping track of the...
Are you referring to your function named communicationProcess() in firmware.ino? If I understand that code correctly, it sends just one variable of size 1 to 8 bytes per call to Serial.write(). Also, do you mean 600K bytes/sec or 600K values/sec?
The timer handler runs every 20 us, and I think it's taking about 10 us on each execution. Binary would be a lot faster, but I just wanted to show that if you have a reason to use CSV, it can be done. This is a much higher data rate than most...
Can't dispute that binary logging is faster, but I've always been able to log to text (csv) files, and it's so nice for files to be readable and not to need another program on the host (PC) to read and translate a fixed binary format. The sketch...