Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <c8051f330.h> //biblioteka opisujaca adresy portow procesora
- //Funkcja opozniajaca
- void delay(){
- unsigned int i;
- for(i=0; i<3000; i++)
- {
- }
- }
- /***Funkcja glowna***/
- /*
- void maska(int n){
- switch(n)
- case 1:
- }
- */
- void main()
- {
- //Blok inicjalizacji procesora
- PCA0MD &= ~0x40; //Wylaczenie watchdoga - faza 1
- PCA0MD = 0x00; //Wylaczenie watchdoga - faza 2
- XBR1 = 0x40; //Wlaczenie crossbara
- //Datasheet dostepny zawsze
- /*Odwrócenie zasilania Vcc--->[dioda]---->[port]
- powoduje, ze przez procesor nie plynie prad*/
- //Petla glowna programu
- while(1)
- {
- P0 = 0x81;
- delay();
- P0 = 0x42;
- delay();
- P0 = 0x24;
- delay();
- P0 = 0x18;
- delay();
- P0 = 0x24;
- delay();
- P0 = 0x42;
- delay();
- P0 = 0x81;
- delay();
- }
- } //koniec main()
- /***Koniec funkcji glownej***/
- /***
- zalozyc projekt na wybrany mikrokomputer
- zeby chodzilo na debbugerze
- biblioteki beda podane
- zapalanie diodek
- ***/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement