Search results

  1. W

    Many (14) COM ports with Teensy 4.1

    Thank you very much, PaulStoffregen, for interesting example. AFAIK, receiving on many software serial is the key problem, and I cannot sync my slave esp32 so that they send data at the same time. In the example you mention, it is only sending on 7 non-hardware serial ports... Theoretically, I...
  2. W

    Many (14) COM ports with Teensy 4.1

    Hello, I am planning to build a system where I have many (14 pcs) esp32 boards connected to one Teensy 4.1. I need a possibility to reprogram each esp32 from Teensy 4.1 on fly (each has the same firmware). So, I am expecting to use 8 hardware serial and 6 software serial. During programming...
  3. W

    Can I read GPIO6_PSR faster then 9 cycles?

    Hello, I'm wondering if I am writing to GPIO6_DR - it takes one cycle, but if I am reading from GPIO6_PSR - it takes 9 cycles. Can you please tell me if there is a faster way to read from GPIO6? It will also be ok for me if I start reading with one tick and get results with one extra tick...
  4. W

    Is it possible to collect data from external ADC by parallel 16-bits at teensy 4.1?

    Thank you very much, Rezo and PaulStoffregen, for your kind comments! Yes, seems that FlexIO3 is still doable. I will probably mix my numerics with FlexIO, probably I can save interrupts here, to save some takts. I also have experienced to run several Teensy 4.1 boards 24/7 at 816MHz for weeks...
  5. W

    Is it possible to collect data from external ADC by parallel 16-bits at teensy 4.1?

    Thank you very much for the replays. Ok, it seems that it will be easy for me to use alternative external ADC with shorter parallel bus to fit into FlexIO2 with DMA, as, for example, afe5401 (12 bits) or LM98714 (8 bits). Hope that I can achieve fast clocks, like 40-50MHz, otherwise it is not...
  6. W

    Is it possible to collect data from external ADC by parallel 16-bits at teensy 4.1?

    Hello, I have an ADC like https://www.microchip.com/en-us/product/MCP37D31-80 with parallel CMOS and want to collect data from this ADC into Teensy 4.1 and perform computations on fly. I have tested computations and it seems that they are duable with teensy 4.1, but I need data to be...
  7. W

    Can I accelerate GPIO updates in a simple loop?

    mainly Altera, Cyclone, Stratix of different size. For example, on small cyclones it is doable to make similar with some additional delays on latches at 0.3ns, so, 10 times better than directly on teensy 4.1, but it is not very straightforward to rote it, implement design in FPGA and feed...
  8. W

    Can I accelerate GPIO updates in a simple loop?

    Thank you very much for pointing out. Yes, sure. I know that it is not possible to play with GPIO very fast, but, I have such a sequence of data that generate ca. 30MHz on/off sequence on each port, but all ports have some slight differences in phases. I would like to achieve as maximum as...
  9. W

    Can I accelerate GPIO updates in a simple loop?

    I really cannot understand the reason why my previous version with "unsigned short" does not compile. When I used uint16_t as you suggested - everything compile, but it is still slow. Below I compared mine version with 32-bits write and yours with 16-bits write, and mine take 2 tacts per write...
  10. W

    Can I accelerate GPIO updates in a simple loop?

    yes, I see it before, but it is 7 times slower than 32-bits write, if we discussing about: a = (GPIO6_DR) & 0x0000ffff; GPIO6_DR = a | (((unsigned int) A0)<<16); and direct operation like you proposed: should be modified to but cannot be compiled - the compiler give an error regarding to use...
  11. W

    Can I accelerate GPIO updates in a simple loop?

    Thank you very much, manicksan, for the replay! Yes, I am using teensy 4.1, and want to update only 16-31 bits. Please, advice my how to make it by one tact, I tried to unsigned short, but it seems be slower.
  12. W

    Can I accelerate GPIO updates in a simple loop?

    I understand that I need to place A0...A13 into registers, in this case the main loop will take one tact to one data transaction. Actually, I was unable to do this using "register" before "unsigned int". I also tried to rearrange the code and use only 4, or 7 variables of A0,...A13...
  13. W

    Can I accelerate GPIO updates in a simple loop?

    Hello, I am pushing consequently several (14) integer words into GPIO6 in a loop. Right now one GPIO6 update takes two clocks, and I would like to do it in one clock. Data in these integer words organized such a way that each port bit updates only twice during 14 storage's, so, each GPIO port...
  14. W

    Very large source code, need advice how to recompile

    Thank you very much, manicksan! It is exactly what I am searching for, I will try it right now!
  15. W

    Very large source code, need advice how to recompile

    Hello, I am trying to use CLAPACK inside teensy 4.1, and need an advice how to compile it. I created a new directory src in ~/arduino-1.8.19/hardware/teensy/avr/cores/teensy4 and saved all 1700 *.c files (690k lines of code) of clapack here with some additional modifications removing printf...
  16. W

    What does my program need in order to use PSRAM on the Teensy 4.1?

    Please, find below the simple test program that fail on boundary access. #pragma GCC push_options #pragma GCC optimize ("Ofast") #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <Arduino.h> unsigned char DMAMEM DmaMem[480*1024]; unsigned char EXTMEM...
  17. W

    What does my program need in order to use PSRAM on the Teensy 4.1?

    Either statically allocate variables in EXTMEM, or statically allocate a buffer in EXTMEM and port any malloc realization that works with buffer, so that you will allocate memory practically with standard C/C++, but in this EXTMEM. Be careful, EXTMEM is slow. Especially if you access randomly...
  18. W

    Teensy 4.0 ADC sampling rate

    about 1.3MS/s at 12bits, 1.5MS/s at 10bits, 1.8MS/s at 8 bits. It seems that it may be also tuned for 20-30% more but I do not know how. But even at 1.3MS/s at 12bits if, running both ADC it leads to unsynchronization, that can be removed by slowing down the sample rate. At 1MS/s for 12/10 bits...
  19. W

    Teensy 4.1 SDR capability

    I am achieving ca. 15 CPU clocks per 16 bit read on overcklocked up to 816MHz Teensy 4.1, that gives me almost 1GBit/s traffic. In case if you send data over GPIO, it is doable on 2 CPU clocks per 16 bits transfer, that gives ca. 6GBit/s traffic. You can check GPIO6 on this CPU and Teensy 4.1...
  20. W

    FLASHMEM for all functions in a file

    It is not so simple: I wrapped my code with due to performance. To test FASTRUN I tried the following options: The first version produce the smallest result, because if it inlines some function and remove functions per se from the code - I do not see them in *.sym. The second (only...
  21. W

    FLASHMEM for all functions in a file

    Thank you very much FrankB for your kind answer! Happy viewing and good night!
  22. W

    FLASHMEM for all functions in a file

    Thank you very much, FrankB, for your answer! I am using TD1.56, and I found 2 entries of FASTRUN at: where, at the first file (WProgram.h) it is defined as #define FASTRUN __attribute__ ((section(".fastrun"), noinline, noclone )) and at the second file (pgmspace.h), as #define FASTRUN...
  23. W

    FLASHMEM for all functions in a file

    Thank you very much, FrankB! Yes, however, if I mark every function in my files as FASTMEM, all of then are present in the elf (executive file). Otherwise, with standard method, many small functions are in-lined and compiler take then away. So, I just place FASTRAM at every my function I got...
  24. W

    FLASHMEM for all functions in a file

    Thank you very much, FrankB!!! Yes, it works as it is on my t4.1. It moved almost all functions to flash memory having some 192 bytes still in ITCM. Actually, it is not exactly what I searched for - my algorithm have its critical part still large enough that does not fit into the cache, so...
  25. W

    2xT4.1 USB Host<->Usb Devie with DMA

    Hello, I have 2 Teensys 4.1 and want to connect #1 by its USB Host directly to #2 at its USB Device. The critical is to transfer large 16K-64K datablocks from device to host by DMA, so that both teensys can do their numerics in parallel with this transfer. Transfer speed is also important for...
  26. W

    FLASHMEM for all functions in a file

    Thank you very much, Frank! Please, suggest me what I am doing wrong, I cannot go to your link, github reports me that it is 404. I also searched in your project, but probably, did not carefully, so I did not found right one. Thank you
  27. W

    FLASHMEM for all functions in a file

    Hello, my project becomes more complicated, and require more program memory. I already optimized everything that I can in my code: wrapped my code and SPI, DMA and interrupts files with pragma -Ofast, and let other be optimized by size, but it is not enough for me. I know that SDcard that I am...
  28. W

    How to recompile after making modifications in ~/arduino-1.8.19/hardware/teensy/avr/

    Thank you very much for your comments! Since you helped me to understand that it is not normal situation, I start to search in the configuration. Finally, the problem was in the ~/.arduino15 - it had some old configuration from previous arduino/teensy. Just removed it, restarted arduino, load...
  29. W

    Cannot download code to Teensy 4.1 (Win 10 PC)

    I had similar behavior if previous sketch run some complicated math and take a lot of power resources that my laptop's USB cannot feed. I see it already when T4.1 consume 0.2A and more from USB. I fixed it by external 5V power supply to my teensy and never meet the same problem after.
  30. W

    How to recompile after making modifications in ~/arduino-1.8.19/hardware/teensy/avr/

    Hello, I would like to place some debugging information into several functions in ~/arduino-1.8.19/hardware/teensy/avr/cores and ~/arduino-1.8.19/hardware/teensy/avr/libraries If I rebuild Teensyduino (1.56) I have no modification. I tried to make "make" inside these dirrectories, make do...
  31. W

    Collision between interrupts on Teensy 4.1

    Hello, I played with interrupts and print them from all possible corners. I made a small print utility, may be somebody can also use it. class PrintInterruptsClass { public: void *func; char Name[14]; unsigned char Priority; unsigned char FirstFound; }...
  32. W

    Collision between interrupts on Teensy 4.1

    Thank you, defragster, for your comment. I forget to mention that SPI DMA (#1) running at normal (not DMAMEM) FASMEM. If I am using DMAMEM for 125000 isr/sec with 19 bytes, it already produce some missing entries. I played with SPI speed, 20M-32M-40M, it works the same, so, I am doing it at...
  33. W

    Collision between interrupts on Teensy 4.1

    Thank you very much, Frank B, I found _VectorsRam and it seems that it contain corresponding function pointers, so, probably with your suggestion regarding to add2line it will be the simplest solution! Please, suggest me, how to disable some interrupts? Can I write 0 into appropriate position...
  34. W

    Collision between interrupts on Teensy 4.1

    Thank you very much, PaulStoffregen and Frank B for your kind information and assistance! I printed interrupt priorities just after inicialization and during my main loop and figured out that at the setup all interrupts beside 64-th, had 128 priority and, during the main loop - 24-th (Serial4)...
  35. W

    Collision between interrupts on Teensy 4.1

    Hello, I have a project where I am using: SPI DMA read by external interrupt, (each interrupt occurs ca. each 8us, and I am starting to read 19 bytes, this transfer is finishing over EventResponder), DMA read from both ADC channels at maximum speed with 12 bits (each buffer is 8Kwords, each...
  36. W

    Debugging Teensy 4.1, by unxpected reboots

    Thank you very much, defragster, for the info. I tried to uncomment USB version since my Serial4 is busy by GPIO. Hope to get more info now, but it will be not very easy - the program does not crash anymore :( - so it seems that this bug is really dependent on some data allocation, interrupts...
  37. W

    Debugging Teensy 4.1, by unxpected reboots

    Thank you very much, KurtE for your kind suggestion. I edited appropriate files, did make in ~/arduino-1.8.19/hardware/teensy/avr/cores/teensy4 and recompiled my sketch, but seems that nothing occurs. It seems that I should recompile startup.c with printf.h, please, suggest me how to do this...
  38. W

    Debugging Teensy 4.1, by unxpected reboots

    Thank you very much, Frank B, yep, I searched for addr2line, but it was arm-none-eabi-addr2line. Got it, and found the line where it is occurs, hope to find the reason. Thank you very much for very helpful tools!!!
  39. W

    Debugging Teensy 4.1, by unxpected reboots

    Finally got the problem: CrashReport: A problem occurred at (system time) 22:59:22 Code was executing from address 0x2E52 CFSR: 82 (DACCVIOL) Data Access Violation (MMARVALID) Accessed Address: 0x71000000 Temperature inside the chip was 47.07 °C Startup CPU clock speed is 600MHz...
  40. W

    Debugging Teensy 4.1, by unxpected reboots

    Thank you very much, PaulStoffregen, for your kind advise! I have placed it into my sketch and waiting now for the failure.
  41. W

    Debugging Teensy 4.1, by unxpected reboots

    Hello, I have strange behavior in my Teensy 4.1 program that I have not been able to fix for a week. I suppose there is a bug, out of memory, or something illegal somewhere in my program. In my program, I am using multiple interrupts at about 100 kHz, 4 DMA channels and external interrupts...
  42. W

    How to get interrupt by the end of DMA ADC?

    Thank you very much, FrankB! Just found that I can change void AnalogBufferDMA::processADC_DMAISR() and place what I need into this function.
  43. W

    How to get interrupt by the end of DMA ADC?

    Hello, I have small test that is based on adc_dma, where I am collecting data from 2 ADC simultaneously. I would like to call a call_back function after each successfull measuring of each my 16K samples. I tried to use attachInterruptVector(IRQ_ADC_ETC0, ic1)...
  44. W

    Maximum DMA ADC speed on Teensy 4.1 with 2 channels

    The first my question is fixed, I played with many possible variants for readPin_adc_0 and readPin_adc_1 and figured out that I did not set ADC_SAMPLING_SPEED::HIGH_VERY_HIGH_SPEED for the second channel. However, my second question is still open. I found that for 12 bit resolution, I have...
  45. W

    Maximum DMA ADC speed on Teensy 4.1 with 2 channels

    Hi, my best season greeting to all forum participants and PJRC Team! Let me please, ask you regarding to the maximum possible ADC speed on Teensy 4.1 by using DMA and two channels. To get it myself I slightly modified the example adc_dma from Teensydoino (1.56) and attachint it here...
  46. W

    How to communicat and program firmware between several T4.1?

    Oh, super! Thank you very much, PaulStoffregen, for detailed info regarding USB communications! Finally, let me shortly asking the difference in the speed and latency between USB-USB and SDCARD-SDCARD communications between 2 teensy4.1 and possibility to do this at least for one board in DMA...
  47. W

    How to communicat and program firmware between several T4.1?

    Thank you very much, joepasquariello, for your kind answer! exactly what I have searched for, thank you very much! Yes, they are free. I am trying to search web, but did not clearly understand what kind of module should I use for Teensy4.1-Teensy4.1 connection over USB? Should I use USB hub...
  48. W

    How to communicat and program firmware between several T4.1?

    Hello, I am planning to develop a device with two Teensy 4.1 boards and need your kind suggestions how to proceed. The first board (#1) will be connected to the external world over the Ethernet. The second board (#2) should be connected with the first one. I would like to have no other...
  49. W

    Function and its stack size on Teensy 4

    Thank you very much, luni! Your kind advice finally solved my issue! By using your suggestion, the total code size dropped from 101K to 63K that saved me two 32K blocks in ITCM, and, in addition the nanolib requires less internal variables, that saved additional 4K in DTCM. Super! Thank you...
Back
Top