If your DAC update rate is not too high, there are lots of I2C options, too. Try googling "Adafruit DAC Qwiic". They have various breakout boards for 1-chan 12-bit, 4-chan 12-bit, 1-chan 16-bit, etc.
Can you tell which model Teensy and what version of TeensyDuino you are using?
If you can create a small program that shows the problem and post it here, it might be possible to help you trouble-shoot. If that's not possible, the only thing I...
The code for delayMicroseconds() from cores\Teensy4\core_pins.h is shown below. The max value that works correctly will be however many usec are equal to 2^32 clock cycles. For 600 MHz, that would be (2^32)/600 = 7158278.82, so 7158278, or 7.158...
I suggest you take a look at the libraries EasyTransfer and SerialTransfer. They are not cross-platform, but they are simple enough that you could implement either one on the PC side. They both have they same purpose, which is to send/receive...
Two quick suggestions, only read micros() once and use digitalReadFast() as shown below. Not sure what your calculation is doing, but are your variables accurlim, duration, plotttimer declared as "volatile"?
void isrCP() {
uint32_t us =...
I 'm trouble-shooting an issue with writing to SD using SdFat, and I noticed the code below in SdioCard::begin(SdioConfig sdioConfig). A signed int is used, which I think can cause CARD_ERROR_ACMD41 to be incorrectly returned, depending on the...
You may not be able to achieve a 5-MHz interrupt rate, and if you do, you'll have little or no time for other I/O or calculations. I think you need to look for a different approach.
Pin 9 should be okay. Try using FREQMEASUREMULTI_RAISING as MEASURE_TYPE. I have never used the MARK types, so I can't say for sure they all work. Add code in loop() to wait some amount of time for data before printing "No Signal Found". T4.1 is...
If you are using the code from msg #4, try using the FreqMeasureMulti library instead. FreqMeasureMulti will provide much better accuracy because the period measurement is done in hardware, not in the ISR (software) of msg #4.
I don't have any code, but if you google "zero crossing detection algorithm" you will find many references, and Paul's previous reply gives a good outline of this method.
No, but I made a guess on a common problem with seeing no code. Your best bet is to make the smallest possible program that shows the problem and share the code, and also tell us IDE, TeensyDuino versions and platform.
Do you really need to measure the frequency, or do you know you have nominal frequency of 50 or 60 Hz? If you know, you can compute apparent, real, and reactive power without measuring phase angle between AC voltage (vac) and AC current (iac)...
I will have a BNO086 breakout board next week, but I'm certainly no expert on I2C or the Wire library. I'll test it as soon as I get it, though, and let you know what I see.
Adafruit has a breakout for BNO085, and it includes the I2C-related warning shown below. The i.MX RT 1011 is listed as one of the CPUs that may not be able to communicate with the sensor via I2C. Not sure if that might imply trouble with iMXRT...
Yes, you can. I may be corrected on this, but I'm not aware of any SPI libraries for Teensy that control the chip selects through the SPI peripheral. They all just assign GPIO pin(s) as chip selects, and manipulate those using digitalWrite() and...
You could also compile the sounds into the actual program, e.g. by encoding it as a char array with the PROGMEM prefix. Then you can access the data directly without worrying about having to open a file and read it.
You can create a LittleFS file system in the main flash, and store whatever you want there. The T4.0 flash is 2MB, so you won't have a huge amount of space.
In this case, x will be initialized to 0. Global non-static variables that are not explicitly initialized are all initialized to 0 at runtime (before main is called).
Nice. That's a pretty simple fix. Can you say which watchdog you are using, and what is the timeout period? For the watchdogs that only require a sequence of writes to registers, it's clear that this will work. I'm not 100% sure about the...
Okay, that's interesting. That makes me think of a stack issue. Your function signature is shown below, and it looks like you are passing in 3 structures by value. You should try removing the "imu", "rServo", and "lServo" arguments from your...
I don't see anything obvious. I thought you might have an integer division problem in the line shown below, but the left-to-right operation rule saved you.
gyroRadian = gyroRadian + gyro.gyro.z * currentTime/1000000;
One more question. You say your crash occurs after the second call to turnRadians() has completed? If so, that would mean the crash occurs in the forever while() at the end of loop(). Have you confirmed that the 2nd turn call actually completes...
Do you mean Teensy 4.0? Paul designed 4.0 to be as compatible with 3.2 as possible, but the two are still different in many ways that people care about.
The library linked below claims "Complete support for MCP23017", including interrupts, and has an example of clearing them.
https://github.com/blemasle/arduino-mcp23017
Are you using Teensy 4.x? If you look at TeensyDuino file cores\Teensy4\pwm.c, which contains code for generating PWM via both FlexPWM and QuadTimer, you might see something you are missing relative to pins.
I think at most I would add a hook to allow an arbitrary function to be called from within flash_move(). The link below is to a thread on the NXP Community Forum that discusses the differences between the various watchdogs. I can't believe there...
I'm pretty sure you could update the flash_move() function in FlasherX to periodically service the watchdog. I don't think I would try to call the feed() function directly, but if you had a few statements inline to write to WDT registers, it...
Yes, I override yield() to be a cooperative task switch. The code below is from Arduino core file hooks.c, and it seems pretty explicit that this is how yield() was intended to be used. EventResponder may have some advantages, but I find this...
You will not be able to have a single 500KB array in the 1MB RAM. You could break it up into two smaller arrays. One would be a static variable, and the other would be on the stack. I don't think there is any "standard" way of doing that. Another...
2Mb is only 250KB, so that might fit in Teensy 4.0/4.1 RAM (1MB total) if you don't have too much code, which goes into RAM by default. Teensy 4.1 has pads for optional 8MB or 16MB of PSRAM, and that might be well-suited to your purpose.
Just guessing wildly, but maybe if you don't enable realtime messages until later, the clock messages will be in the queue read by usbMidi.read()?
Also, I don't know if it matters, but your code does not wait for Serial to actually be ready, as...
You can also measure the period of one or many signals directly in hardware with Paul's FreqMeasureMulti library. FlexPWM timers are used to do the measurements, and the associated ISR writes the period value to queue that can be read from your...
Why would the content of the hex file matter? What is erased is not a function of the content of the hex file except for the size. As far as I've seen, the hex file is always "contiguous", i.e. it explicitly contains data for every address from...