IIRC, the ATMEL studio it handles ATMEL chips only, i.e. AVR, SAM.... Teensy uses NXP processors, I doubt that you can use ATMEL Studio for NXP processors.
The ATMEL Studio is using a very old version of...
Did you see the example showing how to use the 23S17 (SPI version of the chip) https://github.com/luni64/EncoderTool/blob/master/examples/2_multiplexing/multiplexed_MCP23S17? If you need the I2C version, adapting the...
You would need to set your ATMEL Studio to the toolchain which is used by Teensyduino and use the same compiler switches. But this would be the same as using the Arduino IDE and select a Teensy board. So, I'm afraid you...
You can not link an object file compiled for one processor to an object file compiled for another processor. Object files contain the actual machine code which is totally dependent on the processor.
@clinker8 I need to fix an EncoderTool issue for the ESP32. To fix it, I need to touch the part of the code which generated the compile issue you had some months ago. Can I talk you into trying the code in the...
These encoders are just mechanical switches. If you can not pull the pin down, something is probably wrong with the encoder or your wiring.
Here what I usually do in such cases...
If you don't have a harsh environment, you can simply connect the C pin to GND and directly connect A/B to the Teensy. Just use pinmode(INPUT_PULLUP) for the pins. No need for resistors or capacitors. The quadrature...
Actually you don't even need the surrounding struct you can directly put/get your array:
#include <EEPROM.h>
float focusCalib12]4];
void setup()
{
EEPROM.put(0, focusCalib);
EEPROM.get(0, focusCalib);
Seems to be the usual clash with the arduino #defines for abs, round etc. Try to #undef them. IIRC mjs513 already has a PR removing those #defines from the core
Edit: Here it is:...
Random returns uint32_t if its parameters are uint32_t. However, as you observed, it only returns values from 0 to 2^31. Same for the standard C "rand()" function. C++ provides much better random generators in its...
Works here using IDE 2.1.0. Adds a folder "build" to the sketch folder which contains this:
For small snippets I like the compiler explorer, it life-generates the asm while you type your c++ code. Here an...
Would be good to add the same info to the IntervalTimer::update function which also accepts floats. You might also consider removing the leftover specialization of the update function (see PR701)
You declared your struct "testType" nested in the class TestHeader. This is OK but probably not what you want.
If you want to access this type you need to fully qualify it. E.g. in Test.ino you need to write
...
I have absolutely no stakes in it. I was just interested if Pauls statement from #2 is correct. If this behaviour of elapsedMillis should be fixed / documentend / ignored is another question which needs to be decided by...
This is certainly a better definition than "something complicated" :-)
But, even if I delcare stopwartch static, the println will trigger a reload of ms. Anyway, I think the example shows that elapsedMillis is not...
I think Shawn is right. Below a simple example demonstrating the problem. A 1s timer is resetting the elapsedMillis variable `stopwatch` in its callback. In a tight loop the LED is switched on when the stopwatch value...
Maybe another process opened the port and blocks it? Maybe you did open another uploader or Terminal and didn't close it, maybe some Zombie process? In those cases rebooting your PC should help. Does it upload after...
This is what is autogenerated for a new Teensy (4.1) project.
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags...
I stand corrected. As usual: "If nothing helps, read the fucking manual" :-) https://docs.platformio.org/en/latest/platforms/teensy.html#platform-teensy
One doesn't need to directly set the compiler flags, there are...
@pr8x: Here (windows)
<user>\.platformio\packages\framework-arduinoteensy
you find board.txt. Once you understand the unusual file format you can easily find the required info
The problem is that PIO doesn't have such a menu. You can easily set compiler options but you need to know that e.g. -Os goes with -specs=nano-spec in teensyduino. Something like a translation of the tools menu to...
There are two versions of the standard library for this toolchain: newlib and newlib-nano. specs=nano.specs switches to the nano version of the libray. There probably is a reason why teensyduino only uses newlib-nano...
Here a prove of principle. It uses GPIO6_16- GPIO6-31 which are routed to teensy pins. Of course, if you want to output 5000 pulses at 500kHz the pulstrain will be 10 ms long which is borderline if you need a pulsetrain...
How many steps do you expect per 10ms interval from your motion planner? If it is not too much, you could simply send them to the controllers @700kHz in a 10ms periodic interrupt (or triggered by the arrival of a new...
There is no need to do the encoder readout with your own code. There are a lot of proven libs around doing this for you. Here an example using the EncoderTool. The library allows to attach a callback function which will...
I think I know what is going on here: Looks like you compiled with -DF_CPU=48000000 which worked. Then you just changed your makefile to -DF_CPU=72000000 and recompiled without a 'make clean'. Thus the core was not...
Looks like those steppers have some unusual step pattern. Here a library to drive them: https://github.com/clearwater/SwitecX25. This lib is directly driving the motor (not step/dir). However, you probably need some...
I saw your PR. Wouldn't this PR eliminate Pauls macros completely? Probably a risky thing? Maybe just converting the macros to functions which shouldn't clash because the STL lives in the std:: namespace? Anyway, as...
As thebigg mentioned, the Arduino/Teensyduino #defines of standard functions (abs, round...) can mess up the standard library if STL headers are included after Arduino.h. It looks like the new toolchain (or the current...
IMHO PIO is pretty much THE current development system for embedded development. Installation is super simple, you'd install it from within vscode (it's just an extension to vscode). There should be plenty of...
Why do you think the waveform is not centralized already? If you imagine vertical lines through the centers on both LA pictures above you will see exactly what you have drawn? (of course after swapping 2/3)
Starting...
Here is what I usually use in PIO.
platform = teensy
upload_command = C:\toolchain\TyTools\tyCommanderC upload $SOURCE --autostart --wait --multi
extends =TeensyBase
board = Teensy40
Unfortunately changing this to other means of identification (e.g. same USB Port) would be quite some rework.
Reading/Writing to the serial port from a c# PC application is not really difficult. See here for...
Paul could give a reliable answer, but I don't think you can change this. It is probably burnt in some read only memory. Couldn't you simply store your revision etc information in the EEPROM and send it on request to...
Disclaimer: I didn't work on TeensySharp for years and I could be wrong.
When TeensySharp reboots the board it triggers the process and then waits until a board with the same serialnumber but the halfkay PID appears...
Your code does not compile (breakTime clashes with some function defined in the core) I renamed it to brkTime:
IntervalTimer t1, t2;
constexpr uint8_t pins4] = {0, 1, 2, 3};
void switchOn()
{
static...
I tested it with 100kHz (@256MHz) with which is kind of borderline. Execution times get into the same order of magnitude as the delays so the duty cycle calculation need to be corrected.
Using the PWM capabilites of the timers is of course the most elegant and precise method. If you just need a quick and dirty method you could use 2 IntervalTimers to generate the signal (fixed 0.25% phase shift). It is...
This works here to distinguish a cold boot (power on boot) from a reset
bool isWarmBoot()
{
static DMAMEM unsigned bootCheck; // DMAMEM is not zeroed during bootup
if (bootCheck != 0xAAAA'AAAA)
{...
For those not following the other thread here a link to some usage examples for the extended IntervalTimer interface: https://github.com/TeensyUser/doc/wiki/Using-the-new-callback-interface