| Datenblatt-Suchmaschine für elektronische Bauteile |
|
STC89LE53RC Datenblatt(PDF) 87 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC89LE53RC Datenblatt(HTML) 87 Page - STCmicro Technology Co,.Ltd |
|
87 / 165 page ![]() C Language Solution #include <REG51.H> /* SFR declarations */ sbit outbit = P1^7; /* use variable outbit to refer to P1.7 */ unsigned char R7; /* use 8-bit variable to represent R7 */ main( ) { IT0 = 1; /* negative edge activated */ TMOD = 0x11; /* 16-bit timer mode */ IE = 0x81; /* enable EXT 0 only */ while(1); } void INT0INT(void) interrupt 0 { R7 = 20; /* 20 x 5000us = 1 second */ TF0 = 1; /* force timer 0 interrupt */ TF1 = 1; /* force timer 1 interrupt */ ET0 = 1; /* begin tone for 1 second */ ET1 = 1; /* enable timer 1 interrupts */ /* timer interrupts will do the work */ } void T0INT(void) interrupt 1 { TR0 = 0; /* stop timer */ R7 = R7-1; /* decrement R7 */ if (R7 == 0) /* if 20 th time, */ { ET0 = 0; /* disable itself */ ET1 = 0; } else { TH0 = 0x3C; /* 0.05 sec. delay */ TL0 = 0xB0; } } void T1INT (void) interrupt 3 { TR0 = 0; TH1 = 0xFB; /* count for 400Hz */ TL1 = 0x1E; outbit = !outbit; /* music maestro! */ TR1 = 1; } 87 |
|
Link URL |
| War ALLDATASHEET hilfreich? [ DONATE ] |
Über Alldatasheet | Werbung | Kontakt | Privatsphäre und Datenschutz | Link zum Datenblatt | Linktausch | Hersteller All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |