![](/media/cache/profiles/8a76780c6f3cd22891a6e7926fb9ad1c.jpg.50x50_q85.jpg)
Code from liamg with few edits to init seria comml and output counter.
Fork of MKL05CLK by
main.cpp@2:1328c14aca66, 2014-04-11 (annotated)
- Committer:
- donoman
- Date:
- Fri Apr 11 02:34:27 2014 +0000
- Revision:
- 2:1328c14aca66
- Parent:
- 1:dc4a581c6c4a
- Child:
- 3:985a40825e8d
More registers added, still having problems reading MCG_C1;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
liamg | 0:0d020b1f3308 | 1 | #include "mbed.h" |
liamg | 0:0d020b1f3308 | 2 | #include "head.h" |
liamg | 0:0d020b1f3308 | 3 | |
liamg | 0:0d020b1f3308 | 4 | Serial pc(USBTX, USBRX); // tx, rx for debug terminal |
donoman | 2:1328c14aca66 | 5 | Serial testOut(PTC4,PTC3); |
liamg | 0:0d020b1f3308 | 6 | DigitalOut myled(LED1); |
liamg | 0:0d020b1f3308 | 7 | |
donoman | 1:dc4a581c6c4a | 8 | |
liamg | 0:0d020b1f3308 | 9 | int main() { |
donoman | 1:dc4a581c6c4a | 10 | |
donoman | 1:dc4a581c6c4a | 11 | int cycle = 0; |
donoman | 2:1328c14aca66 | 12 | PORTC_PCR3=0x501; |
donoman | 2:1328c14aca66 | 13 | SIM_SOPT2=0x4010080; |
donoman | 1:dc4a581c6c4a | 14 | |
donoman | 1:dc4a581c6c4a | 15 | while(true){ |
donoman | 1:dc4a581c6c4a | 16 | pc.baud(9600); |
donoman | 2:1328c14aca66 | 17 | |
liamg | 0:0d020b1f3308 | 18 | myled = 1; |
liamg | 0:0d020b1f3308 | 19 | wait(0.2); |
liamg | 0:0d020b1f3308 | 20 | myled = 0; |
liamg | 0:0d020b1f3308 | 21 | wait(0.2); |
liamg | 0:0d020b1f3308 | 22 | |
donoman | 1:dc4a581c6c4a | 23 | unsigned int ID=0; |
donoman | 2:1328c14aca66 | 24 | unsigned int FU=0; |
donoman | 2:1328c14aca66 | 25 | unsigned int FU2=0; |
donoman | 2:1328c14aca66 | 26 | unsigned int FU_TIM=0; |
donoman | 1:dc4a581c6c4a | 27 | cycle++; |
liamg | 0:0d020b1f3308 | 28 | |
liamg | 0:0d020b1f3308 | 29 | ID=SIM_SDID; |
donoman | 2:1328c14aca66 | 30 | FU=SIM_SOPT2; |
donoman | 2:1328c14aca66 | 31 | // PORTC_PCR3=0x501; |
donoman | 2:1328c14aca66 | 32 | FU2=PORTC_PCR3; |
donoman | 2:1328c14aca66 | 33 | FU_TIM=MCG_C1; |
donoman | 2:1328c14aca66 | 34 | |
donoman | 2:1328c14aca66 | 35 | |
liamg | 0:0d020b1f3308 | 36 | pc.printf("Kinetis ID = %x \n",ID); |
donoman | 2:1328c14aca66 | 37 | pc.printf("SIM_SOPT2 = %x \n",FU); |
donoman | 2:1328c14aca66 | 38 | pc.printf("PORTC_PCR3 = %x \n",FU2); |
donoman | 2:1328c14aca66 | 39 | pc.printf("MCG_C1 = %x \n",FU_TIM); |
donoman | 2:1328c14aca66 | 40 | |
donoman | 1:dc4a581c6c4a | 41 | pc.printf("CycleNo = %d \n", cycle); |
donoman | 2:1328c14aca66 | 42 | |
donoman | 2:1328c14aca66 | 43 | //testOut.printf("FUCKKK"); |
donoman | 1:dc4a581c6c4a | 44 | } |
liamg | 0:0d020b1f3308 | 45 | |
liamg | 0:0d020b1f3308 | 46 | |
liamg | 0:0d020b1f3308 | 47 | |
liamg | 0:0d020b1f3308 | 48 | } |
donoman | 2:1328c14aca66 | 49 |