Search results

  1. J

    Teensy missing Encoder Ticks?

    Awesome, thank you. Also concerning the sampling periode I mentioned earlier works great. I checked it with writing a digital pin high every ISR and reading that pin with an digital analyser. Thx
  2. J

    Teensy missing Encoder Ticks?

    Undestood, thanks. One more question to your lib: In the source of the algorithm https://www.mikrocontroller.net/articles/Drehgeber#Solide_L.C3.B6sung:_Beispielcode_in_C it is shown that when reading the counter variable all interrupts are disabled. I assume it is because the int is volatile and...
  3. J

    Teensy missing Encoder Ticks?

    Ah sorry, I just saw that the algorithm for decoding is from https://www.mikrocontroller.net/articles/Drehgeber
  4. J

    Teensy missing Encoder Ticks?

    Thanks, I still have some spikes in the encoder signal messing up my counting. This is the signal in the logic analyzer. I am wondering if I could filter those spikes with software, not with a low pass but with the logic of the counting algorithm. As your counting algorithm is quite compact, it...
  5. J

    Teensy missing Encoder Ticks?

    Thanks. I have tested it on one motor. Looking good so far. One question: You use the IntervalTimer Library. As far as I understand, the lib uses not FTM Timer but the PIT modules. Are the PIT modules used by any other common library? Y I am asking is, that i have the feeling that the sampling...
  6. J

    Teensy missing Encoder Ticks?

    Okay, To figure out the problem I minimized the project to just one brushed dc motor. I have a logic analyser hocked up to the encoder lines to measure the true count. After reading more about interrupts on ARM based chips, I changed the priority of the pins used with the encoder. I use pin 31...
  7. J

    Teensy missing Encoder Ticks?

    Good day, I have 8 motors, each with 2 channel encoders connected to the t3.5 using interrupts. Leading to a total of 68k ticks in a second. I am using the encoder lib from paul. Sometimes I have the slight feeling that the system could miss some ticks. Is 68kHz too much? On the encoder page it...
  8. J

    OTA update alternative

    Hey, very interesting thread so far. Has there been any successful updates on the workarounds for ota for the teensy family? Thx
  9. J

    Motor Driver problem when uploading new sketch

    Hey, thanks, I tried that. But same issue. In the Oszi image above, when the pwm stops and before the yellow line gets pulled up, in this intersection a pullup wont change the states of the pins. So I guess the teensy actively keeps the yellow line low and the pwm line to the last pwm state.
  10. J

    Motor Driver problem when uploading new sketch

    Hey, I have a T3.5 with an motor driver (MC33926). The interface is with two pwms. The problem: when uploading a new sketch while driving the motor, the motor spins full speed for couple of ms. After looking at the pwm pins with the Oszi I found the following: blue: the line with is driven...
  11. J

    safe shutdown when power loss

    Hey, sorry for the late reply. I took two 10k resistors. Then measured the voltage of the resistor between GND and a ADC pin with analogRead(). If the voltage is below 2.5V I call my saving routine. Greetings
  12. J

    safe shutdown when power loss

    Hey, just as an update: I did a voltage divider on the Vin line so that I can read it with an analog pin. Now I am detecting with this analog read if the 5V drops below a certain level, if so, the eeprom saving routine is started. There will be enough time (plenty of ms (i checked with oszi))...
  13. J

    Reset status register

    Alright, thanks
  14. J

    Reset status register

    Hey, I am using a T3.5. I am having an endstop which will pull the reset pin low to reset the teensy. Why? I use this as a last endstop for safety reasons. So in normal mode the endstop will never be reached. If for some reasons the endstop is reached and the system is reseted I am reading...
  15. J

    SD library - speed

    good point, thx
  16. J

    SD library - speed

    Hey I use opened=true, so the file only gets opended once. Yes I write 512 bytes every 5ms.
  17. J

    SD library - speed

    Alright, stupid me. So I want to make a datalogger which writes every 5ms data to sd card. But in the last attempt I always wrote as fast as possible. Now I have include that I only write every 5ms and now it constantly need 40us to write. I guess the problem with writing afap was that the sd...
  18. J

    SD library - speed

    Hey, I removed truncate and closing. if(opened==false){ if (!file.open("bench.dat", O_RDWR | O_CREAT | O_TRUNC)) { error("open failed"); file.close(); } opened=true; } else{ // if the file opened okay, write to it: file.write(buf, sizeof(buf)); } I now get around...
  19. J

    SD library - speed

    Thanks, when I do the bench test I get: write speed and latency speed,max,min,avg KB/Sec,usec,usec,usec 13088.17,13039,32,37 12952.54,12960,33,38 I then modified the bench test to simple writing to the card: #include <Metro.h> #include "SdFat.h" #include "sdios.h" #include "FreeStack.h"...
  20. J

    SD library - speed

    I am still a bit confused about the SD and SDFAT libraries. The SDFAT one is the faster one, and it even enables DMA. The SD library works since Paul has modified it. Does the SDFAT work with the teensy?
  21. J

    safe shutdown when power loss

    Hey, my plan: working with an T3.5, which is powered on VIN with 5V. When power is lost, I want to save data to eeprom. Idea: feed the 5V into a GPIO and measure. Put an extra Cap on the 3.3V line, which holds the 3.3V line long enough to save data when a LOW is detected on the GPIO. Is this...
  22. J

    SD library - speed

    Alright, thanks. first hint already increased speed. now checking second one.
  23. J

    SD library - speed

    Hey I am using the datalogger example from the sd library with the teensy 3.5: /* SD card datalogger This example shows how to log data from three analog sensors to an SD card using the SD library. The circuit: * analog sensors on analog ins 0, 1, and 2 * SD card attached to SPI...
  24. J

    Teensy for long term job

    Good day, I have been developing a system with several motors and some sensors. Prototype is now working good and solid. My concern is now the long term application of the system. It will be use for approx. 5-7years, running all the time. Are there any concerns on the teensy side for that long...
  25. J

    mpu6050, reading time of data

    Alright, thanks. I will try the mpu9250 with spi.
  26. J

    mpu6050, reading time of data

    Hey , thanks for your replies. Sorry the wire.setclock got lost in the copy to the forum, so i am already using 400khz. The wire.requestfrom() function needs 1.4ms to be executed. Where does the difference between this time and the measured time of 0.2 ms on the oszi come from? Is there any time...
  27. J

    mpu6050, reading time of data

    Good day, I am using a teensy 3.5 and a mpu6050. I am using the standard code to get raw data: #include <i2c_t3.h> const int MPU_ADDR = 0x68; int16_t accelerometer_x, accelerometer_y, accelerometer_z; // variables for accelerometer raw data int16_t gyro_x, gyro_y, gyro_z; // variables for...
  28. J

    I2C_t3 library, changing frequency

    Hey, looking at the i2c_t3.h file, it looks like it is possible to change the i2c frequency, but I dont understand fully how. I am using a teensy 3.5. How exactly can I change the frequency using the i2c_t3 library? Thanks
  29. J

    Detect low voltage (VIN) and save data to eeprom

    Hey thanks for the input. So the szenario is that the power is fully turned off, and I want to detect this. I have been reading about the Vref. As far as I understand it, the data people gather for this is: that as long as VIN is over 3.3V, it will not influence the pin71 reading. I am thinking...
  30. J

    Detect low voltage (VIN) and save data to eeprom

    Hey, I am using a Teensy 3.5 to drive a motor with encoder. As the encoder is not absolute I am saving the current position to the eeprom every time I completed a movement. If the teensy is powerded up, the eeprom is red and the position is known. But if during a movement the power is shut down...
  31. J

    Uploading sketch, what happens to pins

    Thank you both very much, awesome and quick reply
  32. J

    Uploading sketch, what happens to pins

    Hey, thanks for the reply. So my problem is, that I have a motor driver connected to the teensy. The motor is driven with pwm. High means the motor is driving. If I now reset the teensy the motor will drive with full speed. Ergo the pin is set to high, right? Thanks
  33. J

    Uploading sketch, what happens to pins

    Hey, just wondering, while uploading a new sketch. Are all the pins pulled low or high. Or what havens to them? Thanks
  34. J

    ADC Resolution for single PINs

    Good day, in all examples the analogReadResolution() is called in the setup() and chaning the Resolution for all ADC Pins. Is there a way to only change Resolution for specific pins? The same for the analogReadAveraging().? Thanks
  35. J

    Teensy 3.5 stopped working and gets hot.

    One addition: So I think the part with the 3 legs, and the label 'AN w72' is the source of the heat. But I cant find it on the schematics. Is this a diode? Thanks
  36. J

    Teensy 3.5 stopped working and gets hot.

    Good day, I think I had a little voltage spike somewhere in my setup. The led of the teensy lid up for a sec. After it the teensy is not recognized anymore by the pc. It gets quite hot in the area which is marked in the picture: Could it be just a broken condensator? So is there any hope to...
  37. J

    teensy 3.5 port mapping

    Thank you guys very much and sorry for the missing code. And yes the pinMode solved the problem. Thanks for the quick and great support. Greetings
  38. J

    teensy 3.5 port mapping

    Good day, I am fairly new to the teensy. So I tried the port mapping from https://forum.pjrc.com/threads/34808-K66-Beta-Test?p=106291&viewfull=1#post106291 I hooked pin 26 to 3.3V. As pin 26 should be bit 14 from Port A I then used: Serial.println(GPIOA_PDIR,BIN); But I only get 0 as output...
  39. J

    Display_ili9341

    Hey, thanks for the reply. So u use the SPI Transactions that only one client at a time is used, right? The SPI library is compatible with the Nodemcu. So i will try the Transactions. My code: For the hardware, i will solder everything tomorrow instead of having it on a breadboard (I just...
  40. J

    Display_ili9341

    But if each of the spi slave works for itself, then i would asume the software is alright?
  41. J

    Display_ili9341

    both positiv. Tested every digital pin for both.
  42. J

    Display_ili9341

    well i already did. But the community isnt that big yet. Reading this threath, i assumend you guys have quite the experience with the ili9341, regardless of what microcontroller
  43. J

    Display_ili9341

    sd and screen not working together hey dudes, i know this post is quite old, but maybe somebody of you can still help. The Screen of the ili9341 works fine for it self. Same with the sd card. But both dont work together. As soon as connect the SPI wires to the SD pins the screens stops...
Back
Top