Simple testing code for teensy 3.2 doesn't work

Status
Not open for further replies.

23ars

New member
Hi guys,

I have a question related to teensy 3.2. I wrote a simple C code

Code:
#include "MK20D7.h"



int main(void)
{

	PTC->PDDR=1<<5;//set direction

	PTC->PSOR=1<<5;
	int i;
	while(1){


	}
    return 0;
}

for setting high the pin 13 on Teensy. After I uploaded the hex with Teensy Loader, nothing happened. I verified the controller's datasheet, I verified the memory map, everything seems OK, but the led is not lighting.

To be sure that my Teensy board is working, I wrote the next code in Arduino IDE and uploaded and the led was blinking.
Code:
int led = 13;


void setup() {                

  pinMode(led, OUTPUT);     
}


void loop() {
  digitalWrite(led, HIGH);   
  delay(1000);               
  digitalWrite(led, LOW);    
  delay(1000);               
}

Maybe I'm missing something. I would appreciate every answer!

PS: I used Kinetis Design Studio and code is compiled with arm-none-eabi-gcc.
 
PS: I used Kinetis Design Studio and code is compiled with arm-none-eabi-gcc.

as the problem is with KDS maybe the overall initialization is not the same (enabling the ports etc). Did you check with the KDS community if this program is complete? the KDS example I have looks somewhat different. did you try the PE?
 
Status
Not open for further replies.
Back
Top