Code from liamg with few edits to init seria comml and output counter.

Dependencies:   mbed

Fork of MKL05CLK by Liam G

main.cpp

Committer:
donoman
Date:
2014-05-29
Revision:
4:322eeda5453b
Parent:
3:985a40825e8d

File content as of revision 4:322eeda5453b:

//#include "mbed.h"
#include "head.h"

//Serial pc(USBTX, USBRX); // tx, rx for debug terminal
//Serial testOut(PTC4,PTC3);
//DigitalOut myled(LED1);


int main() {
    
    int cycle = 0;
    
    SIM_SOPT2=0x4010080;
    MCG_C2=0x25; //fast clock slow clock
    MCG_SC=0x04; //divider
    
    SIM_SCGC5=0xF81;
    PORTC_PCR3=0x501;
    
    while(true){
       // pc.baud(9600);
   
       // myled = 1;
       // wait(0.2);
       // myled = 0;
       // wait(0.2);

        unsigned int ID=0;
        unsigned int FU=0;
        unsigned int FU2=0;
        unsigned char FU_TIM=0;
        unsigned int FU_MAN=0;
        cycle++;
    
    ID=SIM_SDID;
     FU=SIM_SOPT2;
  
    //FU2=PORTC_PCR3;
    //MCG_C1=0x3c;
    
    FU_TIM=MCG_C2;
    FU_MAN=SIM_SCGC5;
    
    
    //pc.printf("Kinetis ID = %x \n",ID);
    //pc.printf("SIM_SOPT2 = %x \n",FU);
    //pc.printf("PORTC_PCR3 = %x \n",FU2);
    //pc.printf("MCG_C2 = %x \n",FU_TIM);
    //pc.printf("SIM_SCGC5 = %x \n",FU_MAN);

    //pc.printf("CycleNo = %d \n", cycle);
    
    //testOut.printf("FUCKKK");
    }
    
    
    
}