Forum Rule: Always post complete source code & details to reproduce any issue!
Page 28 of 38 FirstFirst ... 18 26 27 28 29 30 ... LastLast
Results 676 to 700 of 926

Thread: Teensy 4.0 First Beta Test

  1. #676
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,344
    Given manitou's RTC to test running Millis and wanting confirmation ... Went back to the SetArmClock sketch and after a short run set it back to 600 MHz before exiting. Added in two serialEvent's and printed RTC to print with millis to see the clock stay in sync.

    It seems more likely that dropout was from power cycling running power through the DMM to measure Current. Though as noted that affected the T4 it seemed until the 15 sec reset.

    I see the T_3.? [3.1 or 3.6] dropped from T_ports list - did that once and restarted IDE and TLoader and it returned, now after testing - and swapping in my new Hub T_3.6 is missing now.

    I put pins on a 3V battery holder in breadboard and it keeps time. Edited the code to not reset if it was bigger than the code value - not the linker value but the hardcoded one seeing that a new scheme is coming.

  2. #677
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,167
    TALKIE LIBRARY

    Just tested the Talkie library with the changes I made with a Propshield and confirms it works with a T3.5. Will submit a PR later today.

    EDIT:
    Talkie: PR Submitted. Only Toms Diner updated.

    ResponsiveAnalogRead

    PR#19 accepted and incorporated into library, dxinteractive/ResponsiveAnalogRead. Just got notified
    Last edited by mjs513; 01-10-2019 at 01:15 PM.

  3. #678
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,783
    ADC DMA
    I tried porting T3 adc-dma example to T4. It's not working. DMA isr is not firing ... what did I miss?
    https://github.com/manitou48/teensy4...ter/adcdma.ino
    ... thanks

    Anyone have an example of using timer+XBAR+DMA+ADC for clocking ADC at selectable frequency?

    EDIT: added a line ADC1_HC0 = 7; and get 2551 ticks/sec, but data value isn't changing. That's 744968 ADCs/second)

    Working with DMAMEM commented out.
    Last edited by manitou; 01-10-2019 at 06:19 PM.

  4. #679
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,167
    Tom,
    Is this what you were expecting:
    Code:
    7.11 us
    1
    ADC1_GC 0x42
    ADC1_HC0 0x7
    ADC1_CFG 0x6B7
    0
    9
    2539
    9
    2530
    9
    2562
    If it is the just change to DMAChannel dma(true); otherwise the sketch just hangs, ie., nothing prints

  5. #680
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,802
    Quote Originally Posted by defragster View Post
    did the String.cpp copy and the errors persist from :: Serial.println(String(counter) + " allocations made");

    Same code compiles for T_3.6.
    Hi @defragster, - Works for me...
    Note: you mentioned String.cpp... Maybe typo or wrong file? I copied the wstring.cpp that is in the cores directory. I simply copied it from the teensy3 directory to the teensy4 directory.

    Simple Example program:

    Code:
    void setup() {
      while (!Serial && millis() < 4000);
      Serial.begin(115200);
    }
    
    int counter;
    
    void loop() {
      // put your main code here, to run repeatedly:
      printTitle("Test line", 1);
      counter++;
      Serial.println(String(counter) + " allocations made");
      delay(500);
    }
    void printTitle(String title, int font)
    {
      Serial.println(title);
    }
    void pixelExample()
    {
      printTitle("Pixels", 1);
    }
    Code:
    Test line
    1 allocations made
    Test line
    2 allocations made
    Test line
    3 allocations made
    Test line

  6. #681
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,167
    Hi @defragster, - Works for me...
    Note: you mentioned String.cpp... Maybe typo or wrong file? I copied the wstring.cpp that is in the cores directory. I simply copied it from the teensy3 directory to the teensy4 directory.
    Just for fun I did the same thing just now and ran KurtE's sketch and worked exactly the same way.

    A question, I also noticed that stream.cpp wasn't in the T4 core. Shouldn't that be copied over as well?

  7. #682
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,802
    Quote Originally Posted by mjs513 View Post
    Just for fun I did the same thing just now and ran KurtE's sketch and worked exactly the same way.

    A question, I also noticed that stream.cpp wasn't in the T4 core. Shouldn't that be copied over as well?
    Yes - I believe you are right!
    When I updated the above sketch to:
    Code:
    void setup() {
      while (!Serial && millis() < 4000);
      Serial.begin(115200);
      Serial1.begin(115200);
    }
    
    int counter;
    char buffer[4];
    
    void loop() {
      // put your main code here, to run repeatedly:
      printTitle("Test line", 1);
      counter++;
      Serial.println(String(counter) + " allocations made");
      if (Serial1.available()) {
        Serial1.readBytes(buffer, sizeof(buffer));
      }
      delay(500);
    }
    void printTitle(String title, int font)
    {
      Serial.println(title);
    }
    void pixelExample()
    {
      printTitle("Pixels", 1);
    }
    The link fails:
    Code:
    C:\Users\kurte\Documents\Arduino\Teensy Tests\test_use_strings/test_use_strings.ino:16: undefined reference to `Stream::readBytes(char*, unsigned int)'
    
    collect2.exe: error: ld returned 1 exit status
    
    Error compiling for board Teensy 4-Beta1.
    But compiles fine if I copy stream.cpp from Teensy3 to Teensy4...

    Can create PR if desired. Not sure to continue it in my Core SPI fixes or it's own?

    Update - Created PR #324
    Last edited by KurtE; 01-10-2019 at 02:33 PM.

  8. #683
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,783
    Quote Originally Posted by mjs513 View Post
    Tom,
    Is this what you were expecting:
    Code:
    7.11 us
    1
    ADC1_GC 0x42
    ADC1_HC0 0x7
    ADC1_CFG 0x6B7
    0
    9
    2539
    9
    2530
    9
    2562
    If it is the just change to DMAChannel dma(true); otherwise the sketch just hangs, ie., nothing prints
    I have dma.begin(true); so sketch doesn't hang for me. I can't get the "9" number to change if I jumper A0 to GND or 3v3 ???
    Last edited by manitou; 01-10-2019 at 05:49 PM.

  9. #684
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,167
    I have dma.begin(true); so sketch doesn't hang for me. I can't get the "2539" number to change if I jumper A0 to GND or 3v3 ???
    You are right that the sketch doesn't change - just checked it. Ok - just reloaded with DMAchannel(false) and it ran - not sure that happened the first time. Have to go back and read the ADC chapter. It almost looks like the adc isn't connected to the dma channel. Just talking out loud - my thought process.

    @kurtE - I see you already created the PR.

  10. #685
    Junior Member
    Join Date
    Nov 2017
    Posts
    13
    Offtopic:

    Quote Originally Posted by Frank B View Post
    One day, I hope I can see this great demo (Audio-part here: https://forum.pjrc.com/threads/54772...l=1#post194512) on a Teensy4 - with graphics.
    It's a pity that the demo-scene is gone and nobody from the remaining rest has found microcontrollers as valuable demo-hw. Good night.
    Here's the mod player hacked / ported to the audio library and some lame TFT action / starfield I made with a T3.6. It's running at ~140 frames on my custom audio / video board, but there's not many cycles left to do anything pretty. Bring on the T4!
    Incidentally, the board is for a handheld version of your C64 emulator and a 8080 arcade emulator I made. I'm getting around to transferring the T3.6 directly to the board so it's nice and thin.

    https://www.youtube.com/watch?v=zxLHw6GvBzg (Long live the DemoScene!)

  11. #686
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,167
    @manitou
    Was looking through the sketch and couldn't see anything. But I noticed it looks like it reads once on startup - not continuously. For instance, if I jumper pin 14 to 3.3v it will read 1023 when I plug the t4 but if I move the jumper to ground it doesn't update. Strange. Have to look a little more

    EDIT: Tried to put into continuous mode instead of 1 shot but that didn't work. Only time it changed was on startup when I pin 14 jumpered to 3.3v, then it read 1023, but if I moved the jumper to ground it didn't work.
    Last edited by mjs513; 01-10-2019 at 03:36 PM.

  12. #687
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,020
    Paul, I received the board. A neighbor received it for me when I wasn't home. I can only say "wow" it's great. Do you make the plexiglas plates yourself?
    What are the solderpads for?
    I'll test the serial ports tonight, and I think I can start playing a bit with audio Saturday.

    @Itec, I guess you can do a lot with the T4. Almost too good for demos I'm still looking for "the" idea that will push the T4 to its limits... The C64 on the 3.6 is very close to its limit (there is a bit more room now as the 3.6 can do 256MHz since a few weeks, but...) Also have some plans for the T4... Unfortunately my day has only 24h, and unfortunately I have to work in between.
    I'll try your code when the T4-Beta-test is done! (Long live the DemoScene!)
    Last edited by Frank B; 01-10-2019 at 04:33 PM.

  13. #688
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,965
    Quote Originally Posted by Frank B View Post
    Do you make the plexiglas plates yourself?
    Yes. Used a laser to cut them and tap tool on my drill press for those threaded standoffs.

    Erin soldered all the beta boards, but I hand soldered these 5 breakout boards.

    What are the solderpads for?
    Just behind the USB host connector is a place to solder a I2C EEPROM chip, and 2 pullup resistors for SDA & SCL. I tested it with a 24LC02A EEPROM and MB85RC256V FRAM chip.

    Underneath where the beta board plugs in is a place to solder a SPI flash memory. It's connected to SPI1 (pins 1, 26, 27) and its CS signal connects to pin 22. On the bottom side, right underneath that 8 pin chip, are places to solder 3 pullup resistors. One connects to CS (pin 22) and the other 2 are pullup for the unused SPI flash pins (WP & HOLD).

    I have not done any testing with the SPI flash on SPI1, and you probably shouldn't bother either. We're almost certainly going to give up SPI1 to get CAN FD on the final pinout.

  14. #689
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,002
    @Paul,
    any suggestion for connecting to uSD pins? Solder wire or do you know a 1mm pin-spacing connector system?

  15. #690
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    490
    SPI class problem.
    SPI class missing override:
    void usingInterrupt(int interruptName);
    Fixed on github?

  16. #691
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,783
    Briefly WEIRD

    As noted, my T4 requires pressing program button after every upload. In testing my ADC-DMA sketch at one point I recompiled with A0 still jumpered to GND, and the upload worked several times without requiring a button press! I unhooked GND-A0 jumper, and it again required button press. Jumper A0-GND and upload worked properly ... ALAS, my luck ran out, and now, even with A0-GND jumper, it still requires button press after upload

  17. #692
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,020
    Quote Originally Posted by PaulStoffregen View Post
    I have not done any testing with the SPI flash on SPI1, and you probably shouldn't bother either. We're almost certainly going to give up SPI1 to get CAN FD on the final pinout.
    That means no SPI-display on SPI1, too - so either display on SPI4 (or other SPI devices) or MQS ? oops..
    You might want to consider carefully what's more important, CAN-FD or SPI.. personally, I can live with both, but no audio-output without extra chip if SPI is needed doesn't sound that tempting. I've never used CAN FD - What can it be used for?

  18. #693
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,783
    Quote Originally Posted by manitou View Post
    ADC DMA
    I tried porting T3 adc-dma example to T4. It's not working. DMA isr is not firing ... what did I miss?
    https://github.com/manitou48/teensy4...ter/adcdma.ino
    ... thanks

    Anyone have an example of using timer+XBAR+DMA+ADC for clocking ADC at selectable frequency?

    EDIT: added a line ADC1_HC0 = 7; and get 2551 ticks/sec, but data value isn't changing. That's 744968 ADCs/second)
    OK I commented out DMAMEM on the buffer and the sketch worked. github updated
    2526 ticks A0 = 11
    that's 646656 ADCs/second (res 10, average 1)

  19. #694
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,020
    @manitou: try to switch off the cache for DMAMEM, or use Pauls cache functions.
    Easiest way to try it, is here:
    https://github.com/PaulStoffregen/co...startup.c#L167
    remove MEM_CACHE_WBWA, add MEM_NOCACHE instead. If that works, it's a cache problem and you might want to try the cache-functions. Not sure if that's faster than disabling the cache... worth a benchmark?

  20. #695
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,802
    Quote Originally Posted by PaulStoffregen View Post
    I have not done any testing with the SPI flash on SPI1, and you probably shouldn't bother either. We're almost certainly going to give up SPI1 to get CAN FD on the final pinout.
    So you are saying that I should not create an SPI1 object, as it is likely to not be in final product...
    It looked like it was probably using pins: 0, 1, 26, 27

  21. #696
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,020
    Quote Originally Posted by Frank B View Post
    That means no SPI-display on SPI1, too - so either display on SPI4 (or other SPI devices) or MQS ? oops..
    You might want to consider carefully what's more important, CAN-FD or SPI.. personally, I can live with both, but no audio-output without extra chip if SPI is needed doesn't sound that tempting. I've never used CAN FD - What can it be used for?
    Hm, i've looked at the pinout-table (post #3) now.. I think i've confused SPI3 and SPI1 - on which pins is SPI1 at the moment?

  22. #697
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,167
    @KurtE

    Just picked up a SSD1306 128X64 (blue and yellow) from amazon. Downloaded you PR changes and it worked like a charm with Adafruit_SSD1306/GFX libraries. At least now I have an excuse to get a whole bunch of new toys

  23. #698
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,167
    remove MEM_CACHE_WBWA, add MEM_NOCACHE instead. If that works, it's a cache problem and you might want to try the cache-functions. Not sure if that's faster than disabling the cache... worth a benchmark?
    Since I was on line, gave the change a try, it worked.

    2526 ticks A0 = 11
    that's 646656 ADCs/second (res 10, average 1)
    same set up, his test sketch except with the change to startup, getting between 2545 and 2575 ticks.

  24. #699
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,020
    Kurt, great work !
    My first test:
    Code:
    //connect  Serial1 TX -> Serial2 RX, Serial2 TX -> Serial3 RX, Serial3 TX -> Serial4 RX....
    
    
    #define SPD 5333333
    
    void setup() {
     delay(800);
     Serial.println("Hello world");
     Serial1.begin(SPD);
     Serial2.begin(SPD);
     Serial3.begin(SPD);
     Serial4.begin(SPD);
     Serial5.begin(SPD);
     Serial6.begin(SPD);
     Serial7.begin(SPD);
     Serial8.begin(SPD);
     Serial1.print("012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
    }
    
    void loop() {
     
     if (Serial1.available()) Serial2.write(Serial1.read());
     if (Serial2.available()) Serial3.write(Serial2.read());
     if (Serial3.available()) Serial4.write(Serial3.read());
     if (Serial4.available()) Serial5.write(Serial4.read());
     if (Serial5.available()) Serial6.write(Serial5.read());
     if (Serial6.available()) Serial.write(Serial6.read());
     
    }
    Works flawlessly. So, max speed is 5333333 BIT/s. That's good.

  25. #700
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,020
    Quote Originally Posted by mjs513 View Post
    Since I was on line, gave the change a try, it worked.

    same set up, his test sketch except with the change to startup, getting between 2545 and 2575 ticks.
    So almost the same speed?

Posting Permissions

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