Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 33 of 33

Thread: Please Post Code & Details In Your Question!

  1. #26
    Junior Member
    Join Date
    Nov 2019
    Location
    Malaysia
    Posts
    3
    Hi, I connect 2 teensy 3.5 to make an spectrum analyzer. An audio board is connected to a master Teensy. I sent 4 bands of FFT to the slave Teensy using Serial TX pin 1. Since the data is in float, i converted it to int and parse it into a string and ended it with \n so that at the slave side I can detect an newline and split the data. However I noticed Teensy will stuck after sometimes. The slave data will be used to control the led array, somehow if i remove the led function, slave teensy will not stuck.

    Code:
    //serial from master
      if (Serial1.available()) {
        //        Serial.println(".");
        if (Serial1.read() == '\n') {
          int_1 = Serial1.parseInt();
          int_2 = Serial1.parseInt();
          int_3 = Serial1.parseInt();
          int_4 = Serial1.parseInt();
        }
      }


    Master to Slave
    Code:
        //convert float to int for slave
        //    Serial.println();
        int1 = 1000 * myFFT.read(47, 93); //2k to 4k
        int2 = 1000 * myFFT.read(94, 186); //4k to 8k
        int3 = 1000 * myFFT.read(187, 255); //8k to 11k
        int4 = 1000 * myFFT.read(256, 511); //11k to 22k
    
        //send to slave
        if (currentMillis - previousMillis_2 > 10) {
          // save the last time you blinked the LED
          previousMillis_2 = currentMillis;
          //      Serial.print(int1);
          Serial1.print(int1); Serial1.print(",");
          Serial1.print(int2); Serial1.print(",");
          Serial1.print(int3); Serial1.print(",");
          Serial1.print(int4); Serial1.print('\n');
        }

  2. #27
    Junior Member
    Join Date
    Sep 2020
    Location
    Central Texas, US
    Posts
    4

    New Teensy4.0 dev confusion

    I am a new user at Teensy platform. Have done a number other platforms. I get one shot at programming Teensy 4.0. Using VSCode under Win10(64) with Teensy Loader 1.52. Code compiles, downloads, and reboots Teensy on first try. Any combination of pressing button, power reset, hard-reload to default blink doesn't seem to allow another download. Pressing the button gives dim red LED. Log shows timeout. Code is blink with changed timing. Nothing complex. Am I missing a configuration item? Attached are the first-time log and the second time log.log.txtsecondlog.txt

  3. #28
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,647
    Quote Originally Posted by TxBillbr View Post
    I am a new user at Teensy platform. Have done a number other platforms. I get one shot at programming Teensy 4.0. Using VSCode under Win10(64) with Teensy Loader 1.52. Code compiles, downloads, and reboots Teensy on first try. Any combination of pressing button, power reset, hard-reload to default blink doesn't seem to allow another download. Pressing the button gives dim red LED. Log shows timeout. Code is blink with changed timing. Nothing complex. Am I missing a configuration item? Attached are the first-time log and the second time log.log.txtsecondlog.txt
    Not sure if it helps - but TeensyDuino latest release is ver. 1.53

    Also there are existing threads that might have focus on this issue - not recalling the context - but there was a recent post on one time programming as you describe it that may help if you discovered it with Forum search - or Bing or gooGle.

  4. #29
    Junior Member
    Join Date
    Sep 2020
    Location
    Central Texas, US
    Posts
    4
    Apparently Teensy Loader doesn't handle going through an external USB3 hub. Running a short usb cable directly to the system (a huge hassle) makes the Auto function work as advertised.

  5. #30
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,976
    Not all USB hubs are created equal.

    I use Teensy regularly through a USB3 hub which is permanently mounted to the side of my desk. I've also used a few others at times. All worked.

    Can you give up the name and model number of this USB3 hub? Or a photo if you don't have any other info?

  6. #31
    Junior Member
    Join Date
    Sep 2020
    Location
    Central Texas, US
    Posts
    4
    Powered "Juiced Systems" 8-port. (Also permanently mounted behind my 30" monitor). This is connected to Gigabyte Aorus B540 MB
    Click image for larger version. 

Name:	Screenshot 2020-09-26 093915.png 
Views:	7 
Size:	381.0 KB 
ID:	21866

  7. #32
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,647
    Quote Originally Posted by PaulStoffregen View Post
    Not all USB hubs are created equal.
    ...
    @Paul - I sent you a USB3 Hub that failed after a T_4.? bootloader update - no idea if it is related as that thread long past - seemed like it was an edge case (Restore or Power On/Off???). If you look to repro that might provide ready reference hardware.

    The Replacement USB3 HUB 'Atolla' from AMZN [ same/similar as used by @KurtE ] has worked without issues for all Teensy one or more at a time - as have all other connect methods hubs used here on Win 10 - using IDE and IDE w/TyCommander - not VSCode.

  8. #33
    Junior Member
    Join Date
    Sep 2020
    Location
    Central Texas, US
    Posts
    4
    @Paul and @defragster, thanks for the info. I have a temporary workaround that works great and will do some hub investigation. I'm just happy to be getting to work on my project instead of wrestling the workflow.

Posting Permissions

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