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

Thread: Teensy 4.0 - slow baud rate 600bps

  1. #1
    Senior Member
    Join Date
    Dec 2013
    Posts
    219

    Teensy 4.0 - slow baud rate 600bps

    I don't want to bother anyone, but my teensy 4.0 isn't here yet .
    I'm aware there was a thread like this before for teensy 3.x here: Teensy-3-2-odd-results-with-Slow-Baud-rates-and-High-CPU-Speeds

    I'm just curious if anyone with oscilloscope or logic analyzer could help me out here.
    example code:
    Send 0x55, BIN 01010101‬‬.
    Code:
    //  Teensy 4.0 - slow baud rate (need 600bps)
    
    // HW serial# oscilloscope baud rate test
    // Send 0x55, BIN 01010101‬‬.
    // Pin 13 has an LED connected on most Arduino boards.
    
    uint8_t led = LED_BUILTIN; 
    #define HWserial Serial1 // HW serial #
    
    void setup() {
      pinMode(led, OUTPUT);
      // TEST 1
      // HWserial.begin(550); // HWserial.begin(550) -- TEENSY 3.2 @ 72Mhz, Oscilloscope FREG = 275Hz, 275*2 = 550 baud rate.      This is correct !!
      //                         HWserial.begin(550) -- TEENSY 3.2 @ 96Mhz, Oscilloscope FREG = 1.10kHz, 1.10*2 = 2200 baud rate.  This is incorrect !!
      // TEST 2
      HWserial.begin(600);    // HWserial.begin(600) -- TEENSY 3.2 @ 72Mhz, Oscilloscope FREG = 300Hz, 300*2 = 600 baud rate.      This is correct !!
      //                         HWserial.begin(600) -- TEENSY 3.2 @ 96Mhz, Oscilloscope FREG = 1.65kHz, 1.65*2 = 3300 baud rate.  This is incorrect !!
    }
    
    void loop() {
      delay(500);                                 // wait
      digitalWriteFast(led, HIGH);                // turn the LED on, See if It's Alive
      HWserial.write(0x55);                       // send it out
      delay(500);                                 // wait
      digitalWriteFast(led, LOW);                 // turn the LED off, See if It's Alive
    }

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,301
    Good news, here it is running on a Teensy 4.0.

    Click image for larger version. 

Name:	file.png 
Views:	12 
Size:	25.1 KB 
ID:	17171

    Click image for larger version. 

Name:	DSC_0567_web.jpg 
Views:	5 
Size:	148.7 KB 
ID:	17172

  3. #3
    Senior Member
    Join Date
    Dec 2013
    Posts
    219
    Thanks Paul I didn't expect you to reply, I am pretty sure that your hands are full.
    I'm hoping you were taking a break from all the office management shipping going on.
    Anyways this is excellent news to me, this will make my vintage Atar-8bit cassette tape WAV File FSK (Frequency shift keying) decoding with sound support a lot easier .
    Click image for larger version. 

Name:	ATARI TAPE.jpg 
Views:	4 
Size:	60.5 KB 
ID:	17199

Posting Permissions

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