Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/13/05 07:27
Read: times


 
#94747 - why cpu hangs ?
Hi All,
I have a problem with this code:
This simple code sends 0-255 with 9600 baudrate to pc and P2 port
My problem is in loop runtime . program crashes when arrived to line :P2=i.
so we see '0' only on hyperterminal .
I changed type of 'i' to int , but the result remains .
All The Best
Aziz


#include <w78e65.H>
#include <stdio.h>
main()
{
unsigned char i;
TMOD=0x20;
SCON=0x52;
TH1=0xfa;
TR1=1;
for(i=0;i<=255;i++)
{
printf("%d",i);
P2=i;
}
}
/**************************************/


List of 9 messages in thread
TopicAuthorDate
why cpu hangs ?            01/01/70 00:00      
   I am not surprised            01/01/70 00:00      
      possibly incorrect            01/01/70 00:00      
         I did think that            01/01/70 00:00      
   also            01/01/70 00:00      
   Welcome            01/01/70 00:00      
   Aziz, what do you do?            01/01/70 00:00      
      SBUF or Printf & ...            01/01/70 00:00      
   printf - some homework for you...            01/01/70 00:00      

Back to Subject List