Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 15 of 15

Thread: Teensy 4.0., DMA memory to peripheral (schematic)

  1. #1

    Teensy 4.0., DMA memory to peripheral (schematic)

    Hi.
    Is it possible to know which are the real ports of the RT1062 on the pins of Teensy 4.0?

    I think the board scheme is not yet available, I would also like to know when we can download.

    I need to program memory DMA to peripherals (8 GPIO ports), but for that I need the 8 addresses of the ports to be contiguous, so I need to know the real ports of the RT1062 that we have available in the Teensy 4.0 pinout.

    Does anyone know if there is an example source available for Teensy 4.0, where I can see the configuration and use of DMA with SPI, and output DMA to several GPIO ports? I was looking at the examples of the new Teensyduino Beta, and I didn't find any.

    I want to port the Teensy 3.6 Smartmatrix library to Teensy 4.0, and I essentially encounter the difficulty of using DMA and timers.

    regards

  2. #2
    It's a little annoying, but you can look up the pin ports and indices in the Teensy 4 library files.
    core_pins.h on GitHub

    A few people in the beta thread have been doing DMA stuff, but I haven't gotten it to work yet (for UART).

  3. #3

  4. #4
    ok, thanks ecurtz and manitou.

    There are two hardware versions, with RT1062 and RT1052?
    I installed the latest Beta2 Teensyduino for T4, and I ordered Teensy 4.0 from Antratek, this one seems with RT1062.

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,710
    Quote Originally Posted by LuisHS View Post
    ok, thanks ecurtz and manitou.

    There are two hardware versions, with RT1062 and RT1052?
    I installed the latest Beta2 Teensyduino for T4, and I ordered Teensy 4.0 from Antratek, this one seems with RT1062.
    The only MCU in Teensy 4.0 is the imXRT 1062 chip!

    The 1062 chip evolved to shipping state suitable for quantity deliveries in early 2019 - until then it was not a usable part - but it is now and the only Teensy 4.0 processor.

    { not to be confused with Beta 1 hardware from late 2018 that used the 1052 - none of those are supported or shipping in any fashion beyond those first few Beta1 boards. }

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,423
    As for using DMA with T4 and spi. Look at spi library code. Or look at st7735_t3 library. Or my ili9341_t3n library.

  7. #7
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,335
    AS for MCU pin names, table https://forum.pjrc.com/threads/54711...l=1#post193716 has them in second column , no need of decoding source or schematic

  8. #8
    Quote Originally Posted by KurtE View Post
    As for using DMA with T4 and spi. Look at spi library code. Or look at st7735_t3 library. Or my ili9341_t3n library.
    Thanks.
    All the DMA sources for Teensy 3.6, are compatible with Teensy 4.0, SPI input and memory to GPIO ?

    Do you know some example sources for Teensy 4.0, with interrupts and timers? I tried to compile a Teensy 3.6 source and I got an error with the configuration of the timers.

    Regards

  9. #9
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,335
    Quote Originally Posted by LuisHS View Post
    Thanks.
    All the DMA sources for Teensy 3.6, are compatible with Teensy 4.0, SPI input and memory to GPIO ?

    Do you know some example sources for Teensy 4.0, with interrupts and timers? I tried to compile a Teensy 3.6 source and I got an error with the configuration of the timers.

    Regards
    All T4 related (pre release) discussion, including code snippets etc, can be found in the monster thread. Best search in that thread.

  10. #10
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,196
    Quote Originally Posted by LuisHS View Post
    Do you know some example sources for Teensy 4.0, with interrupts and timers? I tried to compile a Teensy 3.6 source and I got an error with the configuration of the timers.

    Regards
    Teensy 4 core files/libs that use timers include Tone.cpp, IntervalTimer, pwm.c, FreqCount, IRremote, ...

    I have some proof-of-concept T4 timer sketches at https://github.com/manitou48/teensy4

  11. #11
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,423
    Quote Originally Posted by LuisHS View Post
    Thanks.
    All the DMA sources for Teensy 3.6, are compatible with Teensy 4.0, SPI input and memory to GPIO ?

    Do you know some example sources for Teensy 4.0, with interrupts and timers? I tried to compile a Teensy 3.6 source and I got an error with the configuration of the timers.

    Regards
    No the DMA is different between most of the different processors. Took a lot of work back then to get T3.6 and T3.5 to work for example in ILI9341_t3n library... There are similarities, but major differences as well.

    Things like: On T3.x you SPI to PUSHR register and from POPR registers. On T4, you probably go to TDR and from RDR register. The configuration code is different. Again the register set is completely different. Some good stuff is that the T4 can transfer up to 32 bits per item versus 16 for T3.x...

    Again the easiest thing is to look at some of the places that have setup both to get an idea. In some places you will find I am doing stuff a lot different for T4. Example in ILI9341_t3n library, on T3.6, I would setup a chain of 3 or 4 DMASettings to do the transfer. With T4, I do things different, and only setup a chain if two DMASettings each with their own smaller buffer, which I copy parts of the frame buffer into... Why? Because if the frame buffer is in high memory, the values that the DMA transfers send may not match what the memory cache has... There is system calls you can call to flush the cache back to physical memory, which works well for one shot stuff, but had issues when I turned on continuous updates and had the display changing...

  12. #12
    Quote Originally Posted by KurtE View Post
    Again the easiest thing is to look at some of the places that have setup both to get an idea. In some places you will find I am doing stuff a lot different for T4. Example in ILI9341_t3n library, on T3.6, I would setup a chain of 3 or 4 DMASettings to do the transfer. With T4, I do things different, and only setup a chain if two DMASettings each with their own smaller buffer, which I copy parts of the frame buffer into... Why? Because if the frame buffer is in high memory, the values that the DMA transfers send may not match what the memory cache has... There is system calls you can call to flush the cache back to physical memory, which works well for one shot stuff, but had issues when I turned on continuous updates and had the display changing...

    OK thanks.
    Where can I get those examples or ILI9341_t3n libraries for Teensy 4.0?

    I have opened the examples of the latest version of Teensyduino, and when compiling for Teensy 4.0, it gives me these errors:

    C:\Users\xxx\Documents\Arduino\libraries\SdFat\src \SpiDriver\SdSpiTeensy3.cpp:23:21: fatal error: kinetis.h: No such file or directory

    ILI9341_DMALIB_graphicstet:35: error: 'class ILI9341_t3DMA' has no member named 'dfillScreen'
    tft.dfillScreen(ILI9341_BLACK);

    ILI9341_DMALIB_graphicstet:178: error: 'class ILI9341_t3DMA' has no member named 'ddrawLine'
    for(x2=0; x2<w; x2+=6) tft.ddrawLine(x1, y1, x2, y2, color);

    ILI9341_DMALIB_graphicstet:224: error: 'class ILI9341_t3DMA' has no member named 'ddrawFastHLine'
    for(y=0; y<h; y+=5) tft.ddrawFastHLine(0, y, w, color1);

    ILI9341_DMALIB_graphicstet:225: error: 'class ILI9341_t3DMA' has no member named 'ddrawFastVLine'
    for(x=0; x<w; x+=5) tft.ddrawFastVLine(x, 0, h, color2);

    ILI9341_DMALIB_graphicstet:241: error: 'class ILI9341_t3DMA' has no member named 'ddrawRect'
    tft.ddrawRect(cx-i2, cy-i2, i, i, color);

    ILI9341_DMALIB_graphicstet:328: error: 'class ILI9341_t3DMA' has no member named 'dfillTriangle'
    tft.dfillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,



    There are no source code examples for Teensy 4.0, to test Timers, interrupts, SPI/DMA and DMA memory to GPIO ??

  13. #13
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,423
    Some of the libraries I have mentioned:
    ILI9341_t3n: https://github.com/KurtE/ILI9341_t3n
    needs: SPIN: https://github.com/KurtE/SPIN

    ST7735_t3: There is a version that shipped with the current teensyduino... Can also get from my github version, or paulstoffregen (master)

    ILI9488_t3: Can get from my github or mjs513 (master)

  14. #14
    Quote Originally Posted by KurtE View Post
    Some of the libraries I have mentioned:
    ILI9341_t3n: https://github.com/KurtE/ILI9341_t3n
    needs: SPIN: https://github.com/KurtE/SPIN
    Thanks, I have install both libraries, but also fail to compile for Teensy 4.0

    C:\Users\xxx\Documents\Arduino\libraries\SdFat\src \SpiDriver\SdSpiTeensy3.cpp:23:21: fatal error: kinetis.h: No such file or directory

    What sample source in this library can I see the configuration and use of DMA?

  15. #15
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,423
    The error you show here has to do with SDFat not with ILI9341_t3n or SPIN?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •