Instead of this (which would be appropriate when using a pin as a *digital* input. . . leaves the bus keeper that Mark T mentioned enabled):
pinMode(ACUR1, INPUT);
pinMode(ACUR2, INPUT);
Use this (which is appropriate when using a pin for...
I put this line in the setup function and the behaviour did change, but now it looks like this:
Neither of the 2 types of reported values are centered around Zero now.
Ran the code twice just to make sure, and both times it looks like this...
That makes sense. Here is all the code:
PhotoOpto.ino:
#include "config.hpp"
IntervalTimer timer;
volatile int timeCounter = 0;
int totalTime = MEASURE + LED_ON + ISO_EXC_GAP + MEASURE + LED_ON + (TIME_PERIOD * 1000);
// times at which...
Thanks for the suggestion, jmarsh. Will give that a shot and report back.
As for the current sensor issue: these are analog voltage from a single or dual channel analog sensor, with CURsens1/2 being the readings directly from the sensor (in the...
Hello all! I just completed the project and found an issue with the risingEdge and fallingEdge functions. Basically for some strange reason my phone behaves the opposite, so when I hang up it plays the greetings and records, when I pick up the...
I am curious if you overclock the F_BUS in (kinetis.h line:764 file) will things improve ?
This may help a bit:
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial && millis() < 2000 ); // 2 sec...
No, there isn't any such comprehensive library hardware usage documentation. While some libraries are fairly simple and use SPI, Wire or Arduino GPIO functions to do their hardware access (most of Adafruit's libraries for various chips do this)...
Without that the code cannot be run as posted - nor can it be seen what other pins are involved.
Indeed, that changes the situation with test code presented p#2:
pinMode(27, INPUT_DISABLE);
Ah, yeah - maybe there is a misunderstanding here. I am referring to peripherals as parts of the MCU that are external to the m7 core, like for example the lpspi, eDMA or PIT.
I assume that for our case it is simpler to directly interact with...
While playing around with another project realized that I pretty much forgot how to use the Teensy SDFat that comes with Teensyduino to access the partitions on a SD card. Pretty always use MTP responder when I wanted to do stuff like that or...
No, because the Sustain pedal might be pressed (which delays acting on Note Off) and recently released keys may still be sounding due to the release phase of an ADSR envelope.
Here is a list of the Libraries in Teensyduino:
Obviously you are not limited to these libraries, many more general libraries can be used.
AccelStepper
Adafruit_NeoPixel
Adafruit_nRF8001
Adafruit_STMPE610
Adafruit_VS1053
ADC
AltSoftSerial
Artnet...
While playing around with another project realized that I pretty much forgot how to use the Teensy SDFat that comes with Teensyduino to access the partitions on a SD card. Pretty always use MTP responder when I wanted to do stuff like that or...
A quick update. I have a Teensy3.1, but it needed to be de-soldered from it's current usage.
I tried the floppy decode/read and the behaviour was the same as observed on the Teensy3.2. Only about 1 read in 10 returns the correct data. Note: this...
Effectively you will be using the Teensyduino libs if you are using a Teensy.
A lot of people use PlatformIO with Teensy but it is NOT a PJRC supported platform.
Paul does a lot to help those people using PlatformIO with their problems but it is...
Thank you for the fast answer!
One major concern I'm having with using the Arduino libs is that I don't know what peripherals they are using and/or configuring. Is there a sortof overview which libraries use which peripherals and which...
Some additional information regarding USB/Teensy3.X/overclock.
I replaced the Teensy3.0 board with a Teensy3.1. I re-ran the "serial USB transfer debug" program (all hardware code removed).
At 96MHz overclock I got random lock-ups. Serial...
I would suggest using Teensyduino and the Arduino IDE so that all the libraries become available to you.
Use VisualMicro and VisualStudio if you don't like the look and feel of the Arduino IDE.
Some forums have the ability to mark a thread as solved, which at times can be nice.
Not sure if that ability is available with this forum provider and if it might be useful or not.
Are you saying that after every analogRead, the pin should be reconfigured using pinMode?
Since the pin is being used to read analog values from, wouldn't using pinMode set the pin to INPUT_PULLUP or INPUT_PULLDOWN which would render the pin...
It does not #include anything else. It only contains variable definitions like the numbers that decide the LED modulation and measurement timing. Do you still need to see the code?
I'm sorry, I did not understand this. What do you mean by...
Hi folks!
I'm an electrical engineering student from Germany, and me and a friend of mine are working on an open-source EMG-based upper limb prosthesis, which is also part of my master thesis.
We are currently looking for a microcontroller to...
I have I have just tagged the first alpha release of my program to convert the .cpp and .h generated by the decoder to a format to something that can be read form a file at runtime and recreated dynamically. The project is available at here. The...
Pads default to having their keeper enabled unless you use pinMode() to reconfigure them, which causes problems with ADC (page 3407 of the reference manual mentions this).
Missing config.hpp -
Created code that may follow desired text in a simple fashion?
void setup() {
analogReadResolution(12);
analogReadAveraging(32);
}
elapsedMillis aTime;
void loop() {
static int aSum=0;
static int aCnt=0;
if...
Yep, that's fixed in the latest push. It's currently at v0.26.0-snapshot and there's a good chance I'll make a new release soon.
I had added my own const IPAddress operators for comparison operations because previous Teensyduinos didn't have the...
I have a program that acquires time multiplexed analog data from a single pin (pin #27) on a Teensy 4.1.
Each measurement is a single value that's reported using Serial.print averaged over ~500 microseconds, with some values being averaged by...
Hey mate. Did you have any luck with this? I'm pretty interested to try this. I know there's other boards that can do this but I want to stay within the teensy ecosystem.
For most uses rollover is immaterial if you compare timestamps correctly and never want to wait too long, using the idiom:
if (micros() - previous_timestamp >= DELAY)
{
previous_timestamp += DELAY;
// do stuff
}
The key point is the...
Many thanks to all of your replies. Now I think I got the full picture.
1) code to erase/program serial flash is stored in flash FASTRUN Code, but not executed from there
2) code to erase/program serial flash is copied at startup to FASTRUN Code...
Using SLA resin for 3D printing and potting the Teensy in the case can provide a nice finish and protection. Incorporating small pogo pins for connectivity is another creative solution. Regarding sharing the FreeCAD file, you can explore...
The new 0.59.4 core seems to be messing with QNEthernetv0.25 and v0.26:
~/Documents/Arduino/libraries/QNEthernet/src/QNEthernet.cpp: In member function 'bool qindesign::network::EthernetClass::begin(const IPAddress&, const IPAddress&, const...
Check out the "Memory" section of the Teensy 4.1 page for detailed documentation.
https://www.pjrc.com/store/teensy41.html#memory
Might also be worth mention, if you're used to the way NXP's SDK does things... well, we're a bit more creative...
Something must be wrong with the way you're testing. If you show us what you're doing, maybe we could spot the problem. Recommend starting with a photo of your test setup. It could be a "simple" mistake or misunderstanding which you could look...
In short: no. The code is stored in the flash but at startup gets copied into the ITCM memory and runs from there. It's still possible to execute code directly from flash (functions tagged with the FLASHMEM attribute don't get copied to ITCM and...
Try adding
asm volatile("dsb");
to the end of the ISR function. The Teensy 4 CPU is so fast that it can finish the ISR before external hardware register writes have finished, which causes the ISR to immediately re-trigger. The DSB instruction...
There are two pads with a connection between them that you should cut if you're going to power the Teensy externally and use the USB connection at the same time. You can see it in this picture:
In the bottom right picture (labelled USB Device)...