If I'm trying to write code to be portable between MCUs it has to be the Wire library.
Similarly Teensy's Wire library should behave the same as the one that regular Arduinos use.
FWIW I'm also seeing another issue (not using slave mode, although it may be playing a role) where the transmit FIFO seems to be getting out of sync, the values being returned by endTransmission()/requestFrom() end up being related to the...
An I2C logger using FlexIO3: https://github.com/A-Dunstan/flexio_i2c_spy/tree/main
Logs all bytes with their ack/nack responses, and whether the transaction ended with a STOP or RESTART. Should be able to handle data transfers of up to 256 bytes...
It won't because in the arduino world using digitalWrite() on an input pin is how you control the pullups, and Teensy does the same thing so that code stays compatible.
The FAT16 filesystem has a limited number of file entries available for the root directory. FAT32 removes this limitation, or (a more sensible solution) you could place your files in a subdirectory. You should still be checking if a valid File...
You'll have to edit the default MPU config in startup.c in the Teensyduino core files.
To be able to write to FASTRUN memory you would want to change READONLY to READWRITE on this line.
To be able to execute code placed in regular data memory you...
#include <smalloc.h> and use sm_malloc_stats_pool() (with &extmem_smalloc_pool as the first argument) to get the number of total, used and free bytes of dynamic extmem.
It never returns a pointer, it returns a File object which has a method to evaluate it and return a bool.
Buffer = AF_VC0706.readPicture(BytesToRead);
Where does the memory come from that this function returns? Are you meant to release it when...
If that's the board that dogbone06 made with the industrial grade IMXRT1062, are you using the modified clock speed setup code that applies higher voltage settings? It's prone to brownouts without it.
The peripheral clock (also known as IPG) isn't meant to be run at more than 150MHz (core 600MHz / 4), and things do tend to break when you go over it. I really wouldn't expect a divider of 2 to work at all if the core CPU speed was set higher...
Because I know USB on the Teensy is the fastest serial interface and it maxes out at roughly 30MB/s. So that's borderline which really only leaves a parallel method, which in turn pretty much means using FlexIO but the number of consecutive pins...
Consider the case where you want the Teensy to act like an I2C EEPROM, here's a transaction sequence to perform a read:
This should be pretty trivial to implement: register a function with onReceive() to catch the address byte and register...
Are there known issues with Wire in slave mode not properly recognizing repeated STARTS correctly, when used on T4.x? I have a pretty good idea what the problem is but I'm a bit puzzled how people are using slave mode for it to have gone unnoticed.
Another fun bug discovered:
- create a static DMAChannel object, using the "DMAChannel(bool allocate)" method with allocate set to false. No initialization is performed, the members of the class will be set to zero (static memory is cleared at...
It's the simplest method of ensuring all of the block variables get updated atomically. If interrupts weren't disabled, another routine could run when only some of the variables had been changed.
If you don't trust a dead simple signal diode to block a reverse voltage of 1.7V you may as well just give up completely, because no component is going to be up to your standards.
Diodes only have a forward voltage drop because they only conduct in the forward direction (mostly). If the diode has the anode connected to the Teensy it can only conduct away from the CPU - meaning when the input is high (5V) the diode will not...
This can also quite easily happen if dynamic memory runs out e.g. if you're using C++ objects like String or std::vector (exceptions aren't supported on Teensy).
With the NXP security stuff there's ways to at least figure out how it works without having to go down the NDA route yourself, e.g. there are SDK samples and application notes floating around that show where the registers are and how to poke them...
Exactly, it doesn't take much to see that the MPU has no open code now and doesn't look like it will in the future.
The linked datasheet is just electrical specifications, not a programming guide with register descriptions and such.
Qualcomm's...
I don't think this new board is fit to be called an Arduino unless we can see every little piece of code that it runs, which includes everything that runs on the Dragonwing MPU - no magic binary boot or gpu blobs, etc. I can't see that happening...
Copying this here because I have run into this issue several times lately: https://forum.pjrc.com/index.php?threads/issues-with-dmachannels.76608/post-360727
A quick sum up: a lot of the Teensy 4.x I2S initialization code (and also SPDIF) feels...
If you relocate the stack from the end to the beginning of DTCM, you will definitely find out if it's overflowing: https://forum.pjrc.com/index.php?threads/easily-detecting-stack-overflows-moving-stack-to-beginning-of-dtcm.74258/
You can cherry-pick examples that will round either way. Samples of -3 and -4 shifted by 2 will end up with a difference of 0, whereas -2 and -3 will end up with a difference of 1.
The problem with shifting is that a negative value, no matter how...
I feel like there should be some limit checking in there rather than a direct cast (truncation) to 16 bits.
Also note that for negative values, shifting will round down but a division will round towards zero. E.g. -1 >> 1 = -1, but -1 / pow(2,1) = 0.
I was thinking more like this, only a couple of wires to connect (I2C SCL and SDA) and the LEDs are multiplexed by the driver so they won't pull a lot of current like using a 74HC595 would. You'd just need to come up with some dot patterns for...