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

Thread: Advice on porting code from ++2.0 to 3.2

  1. #1
    Junior Member
    Join Date
    Aug 2015
    Posts
    15

    Advice on porting code from ++2.0 to 3.2

    My project has outgrown the Teensy++ 2.0, so I want to migrate to the 3.2. I think I can squeeze myself into the lower pin count, but I have a few thousand lines of C code written in the Arduino 1.6.5 / Teensyduino environment. So a few questions:
    1) How should I assign the pins on the 3.2 to the former ++2.0 pins to cause myself the least software grief?
    1a) Are 8-bit ports "emulated"? i.e. can I still use 8-bit PORTA, PORTB etc., which presumably would be translated to 8-bit fields in the 32 bit ports?
    2) Any other gotchas or good advice from pioneers who have already blazed this trail?

    And on another note, this project is getting a little big for the Arduino development environment. Admittedly, I'm spoiled by much time spent using fully integrated IDEs. Can anyone recommend a better IDE for large projects on the 3.2 (and beyond...)? It is really the simple things that I miss, like right clicking on a function/variable name and having the option to go to the declaration or definition, mousing over a #defined symbol and seeing its definition, and having a popup of the function's argument list while typing. And I REALLY need integration with come code versioning system (git, CVS). I'm doing the code development on Win7 x64, and I REALLY don't want to build a separate linux machine just for this project (dual boot is not an option).

    Thanks in advance for any words of wisdom!

  2. #2
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Re your question on IDEs....

    On Windows, I very much prefer VIsual Micro with Visual Studio Community 2015. Both are free. High quality. Teensy specific choice in board targets.
    Software debug low cost option.

    For $90 there's Visual GDB which is a step up from the Visual Micro. And has hardware debug but that's not supported on Teensy.

    There are some editors, but that's not an IDE.

    There is an Eclipse IDE for Windows and Linux, but it's difficult to get running. And it has a non-intuitive UI, in my opinion but Linux people like it.

    There's XCode for Macs with some way to do Teensy as the target.

    PlatformIO is free. Win/Mac/Linux. I just started evaluating it. It is a mash-up of the nice browser based editor called Atom, with an add-on called PlatformIO, and a prerequisite of having Python 2.7 installed. Not hard to install on windows. But I've found the UI to be non-intuitive, but the jury's still out.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,553
    Quote Originally Posted by Ishkabbible View Post
    1) How should I assign the pins on the 3.2 to the former ++2.0 pins to cause myself the least software grief?
    Go back in time and use the Arduino-style numerical pin numbers, rather than AVR-specific registers.

    But Teensyduino emulates some of that stuff, which can take away a little of the pain...

    1a) Are 8-bit ports "emulated"? i.e. can I still use 8-bit PORTA, PORTB etc.
    Yes, but only PORTB, PORTC, PORTD.

    , which presumably would be translated to 8-bit fields in the 32 bit ports?
    The AVR emulation code tries to emulate the port names as used by Arduino Uno.


    2) Any other gotchas or good advice from pioneers who have already blazed this trail?
    The answer is "it depends".

    What does it depend upon? Your specific code, which we can't see.

    You could start by simply selecting Teensy 3.2 in the Tools > Boards menu, and click Verify to see if it even compiles. Maybe you'll get lucky?

    If not, and if you need help, remember the Forum Rule. You don't have to post all of your project, but you can and should take the parts that don't compile and create small but complete stand-alone programs which reproduce the errors. Just remember, the way things work here is you must post a program which can be copied into Arduino and compiled, to reproduce your problem. That's how we work here, and it does mean some extra effort on your part... but if you look around this forum, it pretty clear that extra effort almost always leads to far better results than most other forums usually offer.

Posting Permissions

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