0
\$\begingroup\$

I need to program my Teensy3.2 (hasn't arrived yet) in C. Looking at the Teensy pinouts page, the last board for which pinouts for C language are given is the Teensy++ 2.0. Is it still possible to program the Teensy3.2 in C? If so, what are it's pins called in C?

Thanks!

evamvid

\$\endgroup\$
3
1
\$\begingroup\$

Basically the teensy board is a Cortex M4 from Freescale (MK20 family). So you can download the Freescale toolchain and create a project totally in C for the MCU inside the Teensy.

But you need to create a JTAG connection between a debugger and the MCU if you want to debug/program it.

\$\endgroup\$
4
  • \$\begingroup\$ If I program directly to the MCU, to access the Teensy's outputs, will I just have to figure out which Teensy GPIOs are connected to which pins on the MCU in order to use the Teensy GPIOs? \$\endgroup\$
    – evamvid
    Dec 14 '15 at 13:12
  • \$\begingroup\$ Untrue about the jtag, and those pins may be difficult to access anyway. \$\endgroup\$ Dec 14 '15 at 14:01
  • \$\begingroup\$ Yes, you should understand the MCU and the GPIO/pins configuration from the Reference Manual of the manufacturer. @ChrisStratton Why do you say it's untrue? The teensy has a bootloader that communicates with the Arduino SW in the PC. If you want to program and debug the MCU with Kinetis Design Studio or any other IDE, you will need the JTAG pins (SWD to be precise) \$\endgroup\$ Dec 15 '15 at 11:36
  • 1
    \$\begingroup\$ No, you can use the teensy bootloader and a provided utility to program it from any source. IDE is irrelevant. Further, I think you will find that connecting to the SWD pins is quite complicated as the board was not intended to support that. \$\endgroup\$ Dec 15 '15 at 15:43
0
\$\begingroup\$

Yes, they are programmed in C++, but C is a subset of this, so you can just us C.

There default environment is a Java-based Arduino editor and there are some automatically added wrappers that prevent you from having to get involved with the C startup routines for the processor. However, application programs can all be written in C. Here's 'Hello world':

    void setup()   {                
  Serial.begin(38400);
}

void loop()                     
{
  Serial.println("Hello World");
  delay(1000);
}
\$\endgroup\$
6
  • \$\begingroup\$ well, this is the arduino language, correct? I'm trying to load an already-written software on (TMK Keyboard), which is written in C and compiled into a .hex. Can I do this? \$\endgroup\$
    – evamvid
    Dec 14 '15 at 4:35
  • \$\begingroup\$ You certainly cannot load .hex files (which were compiled for a different processor) onto a Teensy. You may find that much of the C code is reusable on a Teensy, but some of the core functions will likely need to be modified to work with the different hardware on Teensy. \$\endgroup\$
    – jp314
    Dec 14 '15 at 4:50
  • \$\begingroup\$ It would be compiled into a .hex for teensy. It's written for teensy. The processor is specified in the makefile. \$\endgroup\$
    – evamvid
    Dec 14 '15 at 5:01
  • \$\begingroup\$ I guess what I'm actually asking is, what is the C pinout for Teensy 3.2 (it doesn't seem to be provided on the pjrc website) \$\endgroup\$
    – evamvid
    Dec 14 '15 at 5:01
  • \$\begingroup\$ I have no idea about what you mean by a 'C pinout'. The Teensy pinouts are shown at pjrc.com/teensy/pinout.html \$\endgroup\$
    – jp314
    Dec 14 '15 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.