-
Notifications
You must be signed in to change notification settings - Fork 2
Stellaris launchpad 01
1. suinstaliuojam CCS-FREE (CCS5.5.0.00077_win32.zip)
! Einam į http://www.ti.com, tada į meniu “Tools & Software” ir spaudžiam ant “TI LaunchPad”. Einam į “Software” skiltį ir pasirenkam “Code Composer Studio” ir siunčiam nemokamą versiją.
2a. suinstaliuojam SW-EK-LM4F120XL (SW-EK-LM4F120XL-9453.exe) iš http://www.ti.com/tool/sw-ek-lm4f120xl
2b. arba pilna StellarisWare – SW-LM3S-LM4F
! Einam į http://www.ti.com, tada į meniu “Tools & Software” ir šone spaudžiam ant “See more Featured Libraries”. Naujame puslapyje po “Featured Libraries and Application Software” susirandam “StellarisWare”.
3. Darom Lab2 pagal StellarisLaunchPadWorkbook.pdf
!!! Gal uztektu tik EK-LM4F120XL-CCS (EK-LM4F120XL-CCS-733.zip) iš http://www.ti.com/tool/sw-ek-lm4f120xl
================
1. Paleidžiam “Code Composer Studio 5.5.0”
2. Einam į meniu File→New→CCS Project
3. Įvedame “Project name” (pvz.: nrf24l01+)
“Output type” parenkame Executable
Nuimame varnelę nuo “Use default location”
Location nurodom projekto direktoriją (pvz.: “C:\Users\blah\Desktop\stellaris nrf24l01+”)
Family parenkame ARM
Variant rašome 120h ir pasirenkame “Stellaris LM4F120H5QR” arba atitinkamą kokia plokštė yra naudojama
Connection parenkame “Stellaris In-Circuit Debug Interface”
4. “Project templates and examples” parenkame “Empty Project (with main.c)” ir spaudziam Finish
5. “Project Explorer” spaudžiam dešinį ant projekto ir pasirenkam Properties
-——-
6. Einam į Resource→“Linked Resources” ir “Path Variables” skiltyje spaudžiam New…. “New Variable” lange į Name įrašom STELLARISWARE, spaudžiam Folder… ir pasirenkam ten kur sudiegtas StellarisWare (pvz.: C:\StellarisWare) ir spaudžiam OK
7. Einam į Build→“ARM Compiler”→“Include Options” ir “Add dir to #include search path (—include_path, -I)” spaudžiam Add…
8. “Add directory path” lange į Directory įrašom ${STELLARISWARE} ir spaudžiam OK
-——-
9. “Properties for …..” lange einam į Build→“ARM Linker”→“File Search Path” ir “Include library file or command file as input (—library, -l)” spaudžiam Add…, kur įrašom “${STELLARISWARE}\driverlib\ccs-cm4f\Debug\driverlib-cm4f.lib”
10. Kad nemestu warrning’o dėl steko dydžio nenustatymo einam į Build→“ARM Linker”→“Basic Options” ir į “Set C system stack size (—stack-size, -stack)” pvz. 512
! warrningas rodo, kad default reikšmė yra 0×800, kas reikštų 2048
! atitinkamai reikia pakoreguoti ir lm4f120h5qr.cmd faile esančia eilutę “__STACK_TOP = __stack + 512;” į “__STACK_TOP = __stack + REIKSME;” – http://processors.wiki.ti.com/index.php/Stellaris_FAQ#How_to_increase_stack_size_for_Stellaris_projects.3F
================
| Pakeitus kodą ir paspaudus Debug veikia senas kodas? |
-—————————————————————————-
Reikia sustabdyti debug’inimą, atjungti ir prijungti USB laidą, kad išsivalytų registrai. (StellarisLaunchPadWorkbook.pdf 85psl.)
================
! Bibliotekai “driverlib/pin_map.h” gali reikti į Build→“ARM Compiler”→“Advanced Options”→“Predefined Symbols” nustatyti “Pre-define NAME” parametrą “PART_LM4F120H5QR”
Click Symbols under Cross GCC Compiler. Add the following symbols: PART_LM4F120H5QR, ARM_MATH_CM4, TARGET_IS_BLIZZARD_RA1:
================
| Interrupt example |
-————————
#include “driverlib/interrupt.h”
#include “inc/hw_ints.h”
int main(void)
{
// Clock Setup 200Mhz/2.5 = 80Mhz
SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_0);
GPIOIntTypeSet(GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_LOW_LEVEL); // Sets the interrupt type for the specified pin(s)
GPIOPinIntEnable(GPIO_PORTD_BASE, GPIO_PIN_0); // Enables interrupts for the specified pin(s)
IntEnable(INT_GPIOD); // Enables an interrupt
// sito panasu, kad nereikia → // IntMasterEnable(); // Enables the processor interrupt
while(1)
{
}
}
void GPIODIntHandler(void)
{
//if (GPIOPinIntStatus(GPIO_PORTD_BASE, GPIO_PIN_0) & GPIO_PIN_0) { } // Gets interrupt status for the specifuied GPIO port
GPIOPinIntClear(GPIO_PORTD_BASE, GPIO_PIN_0); // Clears the interrupt for the specified pin(s).
// code…
// code…
// code…
}
================