SCENAR CVICENIE 2 Mikroprocesorove systemy Leto 2020
19 februára, 2020 | Posted by in Hlavná stránka- Prolog:
- — — Student si urobia Upgrade obsahu USB kluca.
- — — Este raz overime pocet potrebnych kitov TI LAUNCHAPD na objednanie.
- TEMA: Import projektov
- 0. Otvorit si manual ON-LINE k TI CSS : https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_glossary.html
- 00. Zakladny dokument podla ktoreho pojdeme vo vyucbe : c:\STUDENT\Mikroprocesorove_Systemy_LETO_2020\STUDY\200212 STUDY MSP430 from Texas Instruments\MSP_Design_Workshop.pdf
- 000. Manual k nami pouzivanym procesorom MSP430 : c:\STUDENT\Mikroprocesorove_Systemy_LETO_2020\STUDY\200212 STUDY MSP430 from Texas Instruments\MSP430x5xx and MSP430x6xx Family User’s Guide.pdf
- 1. Obnova rozlozenia okien v CCS (TI Code Composer Studio):
- — Windows –> Perpective –> Reset Perspective
- — Windows –> Perpective –> Open Perspective –> CCS edit (default)
- 2. Priprava CSS na pracu :
- — s podadresarom sa c:\STUDENT\Mikroprocesorove_Systemy_LETO_2020 sa „nehybe“ bude sluzit aj pri skuske ako zdroj informacii
- — kazdy student ma svoj podadresar C:\STUDNET – tam sa kopiruju vychodzie projekty
- — vymazanie (DELETE) vsetkych projektov v Project Explorer
- — vytvorenie si podadresara s PRIEZVISKOM vo workspace – tam si da student svoje projekty vytvorene v CSS
- — do workspace sa nic nekopiruje je to TOXICKE . mozu sa tam robit len poddresare s nazvom PRIEZVISKO studenta
- 3. Priprava suborov pre pracu :
- — kopirovanie z c:\STUDENT\Mikroprocesorove_Systemy_LETO_2020\WORK\msp_workshop\lab_02a_ccs_solution\ do c:\STUDENT\Youth_PANCIK\lab_02a_ccs_solution\
- — c:\STUDENT\Mikroprocesorove_Systemy_LETO_2020\WORK\msp_workshop\lab_02b_blink_solution\ do c:\STUDENT\Youth_PANCIK\lab_02b_blink_solution\
- — c:\STUDENT\Mikroprocesorove_Systemy_LETO_2020\WORK\Mikroprocesorove systemy – cvicenia\Cv1_1_GPIO\ do c:\STUDENT\Youth_PANCIK\Cv1_1_GPIO\
- — c:\STUDENT\Mikroprocesorove_Systemy_LETO_2020\WORK\Mikroprocesorove systemy – cvicenia\Cv2_1_GPIO\ do c:\STUDENT\Youth_PANCIK\Cv2_1_GPIO\
- 4. Import vsetkych styroch projektov do workspace CSS a nasledne CLEAN –> BUILD –> DEBUG
- 5. Podrobne vysvetlenie vsetkych programov, krokovanie a prezerane premennych
- 6. Vytvorenie otazok pre skusku tak, ze vsetky informacie su na pocitaci
- TEMA: vytvorenie noveho projektu so pripravenym zdrojovym suborom main.c
- — vytvorit novy projekt pre MSP430F5529 bez main().c
- — pridat subor main.c Vid.: c:\STUDENT\PANCIK\Cv2_1_GPIO\main.c – preblikavanie LED-iek (CERVENA LED P1.1 a ZELENA LED P4.7)
- — krokovat projekt
- — modifikovat subor o opakovanie preblikavania LED:
-
main.c #define WDGCTL (*((unsigned int *) 0x015C)) #define PORT1DIR (*((unsigned int *) 0x0204)) #define PORT4DIR (*((unsigned int *) 0x0225)) #define PORT1OUT (*((unsigned int *) 0x0202)) #define PORT4OUT (*((unsigned int *) 0x0223)) #define BIT0 0x01 #define BIT1 0x02 #define BIT2 0x04 #define BIT3 0x08 #define BIT4 0x10 #define BIT5 0x20 #define BIT6 0x40 #define BIT7 0x80 void dellay() { volatile unsigned int i; // volatile to prevent optimization i = 10000; // SW Delay do i--; while(i != 0); } /* * main.c */ int main(void) { volatile unsigned char ucPrem; volatile signed char scPrem; volatile unsigned int uiPrem; volatile int iPrem; WDGCTL = 0x5A00 | 0x80; // Stop watchdog timer ucPrem = 0b11111111; scPrem = 127; ucPrem++; scPrem++; uiPrem = 0xFFFF; iPrem = -32768; uiPrem++; iPrem--; //asm(" BIS.W #1,&0x0204"); PORT1DIR |= BIT0; PORT4DIR |= (unsigned int)(BIT7<<8); PORT1OUT |= BIT0; PORT4OUT |= (unsigned int)(BIT7<<8); PORT1OUT &= ~BIT0; PORT4OUT &= ~((unsigned int)(BIT7<<8)); PORT1OUT |= BIT0; PORT4OUT |= (unsigned int)(BIT7<<8); while(1) { volatile unsigned int i; // volatile to prevent optimization PORT1OUT |= BIT0; dellay(); PORT4OUT |= (unsigned int)(BIT7<<8); dellay(); PORT1OUT &= ~BIT0; dellay(); PORT4OUT &= ~((unsigned int)(BIT7<<8)); dellay(); } // return 0; }
You can follow any responses to this entry through the RSS 2.0 Both comments and pings are currently closed.