This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

teensy 3.2 not detected as serial device using KEIL

I am using teensy 3.2 to program its K20 series microcontroller Mk20DX256 I have written a simple UART code to transmit a character 'U' from teensy to PC and see it on Docklight.I have disabled interrupt and DMA

I have searched through web and found out that Teensy acts as Serial port only when Serial type code is running Otherwise it acts as USB Port

Can anyone please tell me how to tell the KEIL  IDE that you want to link in a USB stack and how you want it configured?Please guide if anything is wrong in my code

#include "MK20D7.h"

void UARTPutChar(char);

int main()
{
    
    SIM->SCGC4=1UL<<10; //Clock Enable Uart0
    SIM->SCGC5 =1UL<<12;//Enable GPIO PORT A clock
    UART0->C2=0X00;         //Disable UART 
    PORTD->PCR[7]=  0x00000300;     //Port pin declare as UART0TX
    UART0->BDH=0x01;    //
    UART0->BDL=0xD4;
    UART0->C1=0X00;
    UART0->C3=0X00; 
    UART0->S2=0X20;
    UART0->S1=0X40;
    UART0->C2=0X08; //Enable UART0
     while(1)    
  {        
       UARTPutChar('U');
   
  }

}

void UARTPutChar(char ch)
{
    if(UART0->S1  == 0X40)
    {
        
        UART0->D=ch;
    }
}