Sunteți pe pagina 1din 8

LAUNCHXL-F28379D: sd_card example not working - C2000™ mic... https://e2e.ti.

com/support/microcontrollers/c2000/f/171/t/562253

1 #include "F28x_Project.h" ?
2
3 #include "driverlib/interrupt.h"
4 #include "driverlib/sysctl.h"

1 of 8 10-11-2018, 05:20 PM
LAUNCHXL-F28379D: sd_card example not working - C2000™ mic... https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/562253

5 #include "driverlib/systick.h"
6 #include "third_party/fatfs/src/ff.h"
7 #include "third_party/fatfs/src/diskio.h"
8
9 static FATFS FatFs;
10 static FIL Fil;
11
12 __interrupt void
13 SysTickHandler(void)
14 {
15 disk_timerproc();
16 PieCtrlRegs.PIEACK.all |= 1;
17 }
18
19 void
20 main(void)
21 {
22 FRESULT fresult;
23
24 // Set the clocking to run from the PLL at 50MHz
25 SysCtlClockSet(SYSCTL_OSCSRC_OSC2 | SYSCTL_PLL_ENABLE | SYSCTL_IMULT(10) |
26 SYSCTL_SYSDIV(2));
27 SysCtlAuxClockSet(SYSCTL_OSCSRC_OSC2 | SYSCTL_PLL_ENABLE |
28 SYSCTL_IMULT(12) | SYSCTL_SYSDIV(2)); //60 MHz
29
30 // Initialize interrupt controller and vector table
31 InitPieCtrl();
32 InitPieVectTable();
33
34 // Set the system tick to fire 100 times per second.
35 SysTickInit();
36 SysTickPeriodSet(SysCtlClockGet(SYSTEM_CLOCK_SPEED) / 100);
37 SysTickIntRegister(SysTickHandler);
38 SysTickIntEnable();
39 SysTickEnable();
40
41 IntMasterEnable();
42
43 // Mount the file system, using logical disk 0.
44 WORD bw;
45 fresult = f_mount(0, &FatFs);
46 fresult = f_open(&Fil, "data.txt", FA_WRITE | FA_CREATE_ALWAYS);
47 fresult = f_write(&Fil, "test", 4, &bw);
48
49 while(1){}
50 }

2 of 8 10-11-2018, 05:20 PM
LAUNCHXL-F28379D: sd_card example not working - C2000™ mic... https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/562253

3 of 8 10-11-2018, 05:20 PM
LAUNCHXL-F28379D: sd_card example not working - C2000™ mic... https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/562253

4 of 8 10-11-2018, 05:20 PM
LAUNCHXL-F28379D: sd_card example not working - C2000™ mic... https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/562253

5 of 8 10-11-2018, 05:20 PM
LAUNCHXL-F28379D: sd_card example not working - C2000™ mic... https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/562253

6 of 8 10-11-2018, 05:20 PM
LAUNCHXL-F28379D: sd_card example not working - C2000™ mic... https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/562253

7 of 8 10-11-2018, 05:20 PM
LAUNCHXL-F28379D: sd_card example not working - C2000™ mic... https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/562253

8 of 8 10-11-2018, 05:20 PM

S-ar putea să vă placă și