#include <8051.h>
void main(void)
{
int i=1;
P1=0; /* clear PORT1 of the MCS51 - P1.7 used as LED output */
for(;;)
{
//P1_7=!(P1_7); /* toggle P1.7*/
P1=
for(i=1;i<15000;i++);
/* idle loop - eat CPU time */
}
}
*get sdcc, install it and setpath.
*run with
sdcc porttest.c
* convert ihx into hex by
packihxoutput.hex
*simulate using EdSim51.
ref http://www.final-memory.org/?cat=36

No comments:
Post a Comment