Imported Upstream version 2.9.0
[debian/cc1111] / sim / ucsim / s51.src / test_idlepd.c
1 #include <reg51.h>
2
3 sfr at 0xa6 WDTRST;
4
5 void jaj_ex0() interrupt 0 { P2= P0; }
6
7 void jaj_t0() interrupt 1 { P2= P0; }
8
9 void main()
10 {
11   TH0= 0x80;
12   TL0= 0x80;
13   TMOD= 0x02;
14
15   IT0=0; /* low level triggered */
16   IT0=1; /* falling edge triggered */
17   EX0=1; /* enable ex #0 */
18   ET0=1; /* en t0 */
19   
20   TR0= 1;
21
22   EA=1;
23   P0=0;
24   while (1)
25     {
26       P0= 0;
27       PCON|= 1;/*idle*/
28       P0++;
29       P0++;
30       P0++;
31     }
32   WDTRST= 0x1e;
33   WDTRST= 0xe1;
34   PCON|= 2;/*pd*/
35 }