Search results

  1. N

    where to position an interrupt routine?

    My project is using the comparator within a T_3.2 or T_3.5 and CMP1 interrupts. The functions for comparator configuration and handling are located in COMP1.h and COMP1.cpp. COMP1.h is included in the sketch. The function CMP1_init() is void CMP1_Init(void) { NVIC_SET_PRIORITY(IRQ_CMP1, 130)...
  2. N

    enable CMP! interrupt on T_3.5

    Hi, in this forum I found code examples for using the comparator in a Teensy 3.5. For comparator 1 a code example used NVIC_ENABLE_IRQ(IRQ_CMP1); // handler is now cmp1_isr() The macro name says that it is an enable function. The comment says that with this macro cmp1_isr() is attached to the...
  3. N

    TyTools expects different hex file

    Hi, from recommendations in this forum I installed TyTools. But after some time using it the serial monitor didn't work any more. So I uninstalled TyTools. But then it was not possible to upload any sketch. There were a lot of errors, I don't remember. Now I installed TyTools again. Testing...
  4. N

    device not recognized, T3.5

    more info: During testing T_3.5 the connection between VUSB and Vin was cut and there was a 4.2V external power supply via Vin-pin. For such a configuration, is it necessary first to connect power to Vin and then plug USB or vice versa or does'nt the sequence matter?
  5. N

    device not recognized, T3.5

    no reactions at all. I guess I killed it. With the USB connected, all 3.3V outputs only show 0.5V. Except the USB cable there are no connections at all. A small black chip about 1cm from the controller chip in direction to the USB plug gets quite warm. Suppose it is the regulator from VUSB to...
  6. N

    device not recognized, T3.5

    Hi, after many tests with a Teensy 3.5 uploading various code versions, now it is not possible to upload any code any more. USB type is serial. But I canot set the port as usual. Only COM1 is shown which definitely is not the Teensy port, see attachment. The device is connected to and...
  7. N

    What is "Pass Through Mode" with CMP?

    Oh sorry, it is in the manual for a Teensy3.2 and also Teensy 3.5.
  8. N

    What is "Pass Through Mode" with CMP?

    In the Teensy manual for register CMPx_MUXCR there is a bit PSTM which means pass throug mode. What happens with pass throug mode?
  9. N

    RTC pins of T3.5

    Hi, I want to use the RTC with a Teensy 3.5 board but cannot find where the pins for crystal and VBAT are located. Are these pins available on the board at all?
  10. N

    watchdog on Teensy 3.5

    By try and error I found that delayMicroseconds(5) between wdt_config() and wdt_halt() is sufficient to immediately stop the WD-timer. The reason for the necessary delay is open.
  11. N

    watchdog on Teensy 3.5

    Hi, I'm observing a curious behaviour of the watchdog on a Teensy 3.5. To demonstrate this I connected pin 0 and pin 1 (RX1, TX1) and used the following sketch: #define RFrec Serial1 #define WDT0_8S 8000 uint32_t tw, to; void wdt_config(uint16_t timeout) { // timeout ist die Zeit, bis der...
  12. N

    Serial Monitor goes offline

    WDT_T4 is for Teensy4. I'm using Teensy3.5. I found a thread for Teensy3x which only suggests functions to set the timeout and to reset the WD-timer. I also need to stop the watchdog and to continue the timer. Therefore I wrote the following functions: /* watchdog library for Teensy 3.x...
  13. N

    Serial Monitor goes offline

    The problem is a different one. The code I posted was an extract from a large code. I missed to copy some lines with watchdog statements. Sorry for that. The reset caused by the watchdog clears the Serial Monitor screen. This rises two new questions: 1) Is it possible to avoid clearing the...
  14. N

    Serial Monitor goes offline

    I have the following test setup: 1) a board with a serial output 2) a Teensy 3.5, RX1 connected to the serial output Every 8 seconds the board is sending a string and after each fourth string it sends immediately a further string. The tests are performed on Arduino IDE with Teensyduino and the...
  15. N

    definition of data types uint8_t, uint16_t

    Hi, for a sketch with Teensy 3.5, developped on Arduino IDE/Teensyduino, I want to use data types uint8_t and uint16_t. What header file has to be included to know these data types?
  16. N

    how to use "dir(void (*callback)(char *))"?

    That's tricky. Without "const" it works. void somename(char* myString) { Serial.println(myString); } Thank you
  17. N

    how to use "dir(void (*callback)(char *))"?

    In a code example there is a function to print a directory. The function: /* Prints a directory. * Callback must point to a function that prints one string. void SdPlayClass::dir(void (*callback)(char *)) */ void SdPlayClass::dir(void (*callback)(char *)) { if(!_pBuf) { _lastError =...
  18. N

    compile/optimize error?

    I have no access to the compile line because I am compiling from the Arduino/Teensyduino IDE. But nevertheless, what does it mean: -Wextra?
  19. N

    what is the best method for access to interrupt variables?

    If a program needs access to variables which are used/changed by an interrupt routine they have to be declared volatile. That's clear so far, but what is the best method then to access such variables? There are examples of code which use ATOMIC_BLOCK to copy the variable, here value, and then...
  20. N

    compile/optimize error?

    Hi, both problems now have settled down. As already posted, problem 1 was a matter of char being unsigned for ARM but signed for Arduino. Now problem 2 is solved too. It was a char array overflow. Compilation without LTO now works fine. Thank you for your time and tipps. NikoTeen
  21. N

    Seria.print() an uint8_t variable

    Oh my goodness! quickly edit without thinking :confused: I transferred Arduino AVR code containing type char variables to Teensy code. In C++ for AVR char is signed but for ARM it is unsigned! So I edited with find/replace all char's to int8_t's. But a "char outstr[12]" also has been changed to...
  22. N

    Seria.print() an uint8_t variable

    When code shall be written for Arduino and Teensy it is recommended e.g. to use uint8_t instead of byte. But Serial.print() does not accept uint8_t type variables. Is there a simpler method than type casting?
  23. N

    compile/optimize error?

    hi, problem 1 is solved. The code was initially written for an Arduino controller. The decoder class has been transfered to Teensy code without any modification. In C++ for Arduino the type char is signed, but in C++ for ARM char is unsigned! The return type of function decode() in...
  24. N

    compile/optimize error?

    Well, in a former post I got this answer too. But in this case it is necessary to compile with LTO in order to get correct results. Without LTO every second data set is missed and switching between data buffers (there are four) does not happen.
  25. N

    compile/optimize error?

    For testing and to reconstruct the effects replaying the wav file generates a clean digital signal which will not need a comparator. But the real application gets the output of a 433 MHz receiver which not only sees the pure digital sensor signal. There is a lot of other signals on the air...
  26. N

    compile/optimize error?

    Sorry for the missing attachment. Now they are here. KurtE, the sketch is not working with wav files. The files are needed as external input to the comparator in the T3.2. The effects described happen within an interrupt routine which is triggered by the comparator. To run the sketch the wav...
  27. N

    compile/optimize error?

    hi, in my program for a Teensy 3.2 I see effects which I only can explain by errors in compiling/optimization. Mainly there are two problems, both happen in an interrupt routine: 1) a function call is not executed 2) part of code is not executed With problem 2 the program behaves differently...
  28. N

    limit of attachment size?

    I want to attach two wav files to a posting. Bot are compressed in a zip file and have a size of about 6 MBytes. After click on "Upload" I get an error: Upload of file failed The files are necessary to reproduce two curious effects in my program. How can I upload files of such a size?
  29. N

    meaning of "with LTO"

    Because my program is quite complex and uses external interrupts, I tried to reduce my program to a version which can be posted here and made several tests. But then the effects are away. This leads me to the conclusion that someting with my interrupt handling is wrong. Therefore I have some...
  30. N

    meaning of "with LTO"

    You say that LTO is buggy. But in my case only LTO generates correct code. Even optimization "debug", which in my understanding is no optimization at all, is printing the variable Scount as some hundred millions whereas with optimization "fast with LTO" the variable is printed as about 7 which...
  31. N

    meaning of "with LTO"

    hi, a search in this forum for "with LTO" brings a lot of threads but nothing concerning this type of compiler optimization. My project on a Teensy 3.2: A 433 MHz receiver outputs digital signals from a wind sensor and a temperature sensor. These outputs are decoded by an interrupt routine...
  32. N

    micros() within Interrupt possible?

    The background for my question was, that a code which successfully runs on an Arduino Nano makes problems when run on T3.2. The sketch is decoding a Manchester coded signal from a 433 MHz receiver. Both edges of the pulses from the receiver are triggering an interrupt. For decoding, the pulse...
  33. N

    micros() within Interrupt possible?

    Hi, I want to use interrupts to measure pulse lengths with a Teensy 3.2. The time between interrupts shall be measured by micros(). But anywhere I read that using micros() within interrupts might cause problems. I can't remember where I read this. Therefore my question ist: can I call micros()...
  34. N

    speed up SD card transfer

    hi, my initial post was rather complex. Now I have a more simple question. For setting the clock rate the SimpleSDAudio library contains two functions, SD_L0_init() and SD_L0_SpiSetHighSpeed(). void SD_L0_Init(void) { /* Power up card */ // not for arduino /* Setup ports */...
  35. N

    SD write speed in raw mode - how many audio channels?

    I am late with my reply. Did you solve your problem and if so, what library did you use? I am looking for a solution how to speed up SD data transfer with a Teensy 3.2 (96 MHz) which as slow as an Arduino Mega2560 (16 MHz).
  36. N

    SD read speed in raw 512 byte mode on Teensy 3.6 and 4.0

    If you are asking for code on block SD read then I recommend the library SimpleSDAudio. Yesterday I opened a post "speed up SD card transfer" asking how to speed up SD data transfer with that library. The library initially is written for Arduino controllers with 16 MHz. I modified it for Teensy...
  37. N

    speed up SD card transfer

    Hi, I started a project with Arduino Mega2560. This project contains a library for audio output, SimpleSDAudio, see attachment. This library allows to output audio (speech in my application) by reading blocks of data from an SD card and generating the audio by PWM. Parallel to audio output the...
  38. N

    testing Teensy comparator

    Hi, for a project I needed a comparator with some filtering features. Teensy 3.2 comparators are matching this requirement very well. To check the necessary settings I made a test setup with a simple circuit, see attachment, and the following sketch: void setup() { byte cnt=1; char...
  39. N

    SPI: important difference between Arduino Atmel and ARM

    That is exactly the code I also use with some minor changes. - The code within setupu() is contained in a function SD_L0_Init(void) - The last 2 lines of setup() are shifted to a further function SD_L0_SpiSetHighSpeed(void) - The content of SPCR is saved to a global Variable REGspcr, and...
  40. N

    what are relevant defines for Teensy

    analyzing code of libraries often shows define statements like #if defined(__MK20DX256__) #define KINETISK #define HAS_KINETISK_UART0 ... and so on Between a #if defined(...) ... #endif, pinning or ADC-settings are defined. But what is KINETISK? For my own code I need to know what type of #if...
  41. N

    SPI: important difference between Arduino Atmel and ARM

    hi, there is an important difference between Arduino Atmel controllers and ARM controllers: When porting a software using SPI interface for a SD card from Mega2560 to Teensy3.2 the transfer of data on Teensy with 96 MHz was much slowlier than on Mega2560 with 16 MHz. The reason is that the SPCR...
  42. N

    SD-card reading with Teensy3.2 much slowlier than with Arduino2560

    I stripped the code down to only those parts for SD card and made a new project SDcardTest. I am testing with IDE 1.8.4 and Teensy extension. The folder structure is: sketchfolder\examples\Teensy32\SDcardTest\ SDcardTest.ino audio.cpp audio.h...
  43. N

    how to reinstall USB driver?

    During some test loops - changing code, compiling, running with outputs on Serial Monitor - the USB driver seems to be lost. An information window appeared that a USB driver is being installed. But then it reported that the driver could not be found. Since then the USB link to the PC is dead...
  44. N

    manchester decoding teensy 3.2 with uart

    I doubt if hardware or software Serial is suitable for this task. A serial link is based on a fixed number of bits to be read. If the Teensy is fast enough then using digitalRead() combined with an interrupt should be more suitable. Of course, using serial interface is much easier to handle...
  45. N

    SD-card reading with Teensy3.2 much slowlier than with Arduino2560

    Hi, I am porting a project from Arduino Mega2560 to Teensy 3.2 in order to speed up the processing. Teensy 3.2 is clocked with 96 MHz, Arduino Mega2560 with 16 MHz. A part of the project is reading blocks of 512 bytes from an SD-card. For comparison I coded a test function reading 512...
  46. N

    curious errors porting a project from Arduino to Teensy

    Sorry for the inconvenience, meantime the problem is solved: In the Arduino version there was an assembler file .S included for the interrupt routine which is not necessary for the Teensy version. I didn't delete it because I believed that it will not be compiled when it is not used in the...
  47. N

    curious errors porting a project from Arduino to Teensy

    [solved] curious errors porting a project from Arduino to Teensy Hi, I want to port a project from Arduino 2560 to Teensy 3.2 with a 3rd party library SimpleSDAudio from Arduino Playground. I'm advancing step by step. Replacing fast PWM on Arduino with IntervalTimer and DAC works. Now I want to...
  48. N

    new problem with start/stop interrupts with IntervalTimer

    It does not work. I tried it also with pointer, but also no success. I don't understand that. But meantime I found a solution. I transferred the creation of the timer into a class definition with start() and stop() definitions. The implementation of the class then calls NVIC_ENABLE_IRQ(myTimer)...
  49. N

    new problem with start/stop interrupts with IntervalTimer

    [solved] new problem with start/stop interrupts with IntervalTimer Hi, I declared my old post on "start/stop interrupts with IntervalTimer" as solved. But now there is a new problem. The following code of a test sketch describes it. // Create an IntervalTimer object IntervalTimer myTimer...
Back
Top