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

Thread: Teensy Blink on Teensy 1.0

  1. #1
    Senior Member
    Join Date
    Apr 2013
    Posts
    163

    Teensy Blink on Teensy 1.0

    Hello,

    on my own I'm a huge fan of the Blink example. So I did my part on it and make it more comfortable for me, code below.

    Code:
    /* LED Blink, Teensyduino Tutorial #1
       http://www.pjrc.com/teensy/tutorial.html
     
       This example code is in the public domain.
    */
    
    // Teensy 2.0 has the LED on pin 11
    // Teensy++ 2.0 has the LED on pin 6
    // Teensy 3.0 has the LED on pin 13
    #if defined(__MK20DX128__) || defined(__MK20DX256__)
             //  Teensy 3.0                Teensy 3.1
      #define ledPin 13
    #elif defined (__AVR_ATmega32U4__)
             //     Teensy 2.0
      #define ledPin 11
    #elif defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
             //    Teensy 1.0                     Teensy 1.0++                   Teensy 2.0++                    
      #define ledPin  6
    #else
      #define ledPin 13
    #endif
    
    //const int ledPin = Pin;
    
    int timing = 125;
    
    // the setup() method runs once, when the sketch starts
    
    void setup() {
      // initialize the digital pin as an output.
      pinMode(ledPin, OUTPUT);
    }
    
    // the loop() methor runs over and over again,
    // as long as the board has power
    
    void loop() {
      digitalWrite(ledPin, HIGH);   // set the LED on
      delay(timing);                  // wait for a second
      digitalWrite(ledPin, LOW);    // set the LED off
      delay(timing);                  // wait for a second
    }
    So I tested it on Arduino IDE 1.0.5 with Teensyduino 1.18RC all works fine except for Teensy 1.0 there I get this:

    This report would have more information with
    "Show verbose output during compilation"
    enabled in File > Preferences.
    Arduino: 1.0.5 (Windows 7), Board: "Teensy 1.0"
    C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s: Assembler messages:
    C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:198: Error: illegal opcode mul for mcu at90usb162
    C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:203: Error: illegal opcode mul for mcu at90usb162
    C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:207: Error: illegal opcode mul for mcu at90usb162
    C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:211: Error: illegal opcode mul for mcu at90usb162
    C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:237: Error: illegal opcode mul for mcu at90usb162
    On Arduino IDE 1.0.4 with Teensy 1.14RC2 it compiled fine. So what did I do wrong?
    Attached Files Attached Files
    Last edited by Markus_L811; 12-31-2013 at 09:09 PM.

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,569
    I don't know where the error messages came from but you can remove all the ifdef stuff and replace it with:
    Code:
    #define ledPin LED_BUILTIN
    Pete

  3. #3
    Senior Member
    Join Date
    Apr 2013
    Posts
    163
    Quote Originally Posted by el_supremo View Post
    I don't know where the error messages came from but you can remove all the ifdef stuff and replace it with:
    Code:
    #define ledPin LED_BUILTIN
    Pete
    Jepp less code, nice to know but same error...

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,969
    The Teensy 1.0 code is no longer maintained. I'll probably drop Teensy 1.0 support completely in 1.18 or 1.19.

  5. #5
    Senior Member
    Join Date
    Apr 2013
    Posts
    163
    Quote Originally Posted by PaulStoffregen View Post
    The Teensy 1.0 code is no longer maintained. I'll probably drop Teensy 1.0 support completely in 1.18 or 1.19.
    Ah ok, since Version 1.18 or befor, I don't have an Teensy 1.0 but maybe for other it's interesting.

    Happy new Year, Paul.

Posting Permissions

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