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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/15/04 17:24
Read: times


 
#81211 - andy + gopalakrishn + program with <pre>
Responding to: ???'s previous message
Andy first sorry for saying KEIL C++, if is really ANSI 'C' compiler.

Also please explain your statement "You seem to be mixing int and char with gay abandon".


Gopalakrishnan…….. that's negative. It checked it and make sure its not working on the actual board. (there is no problem in board as I am working with another system on the same board).


Let me try to format the program.





#include <AT89x55.h> 
#include <intrins.h> 
void Simple_Delay_N_Fifty(int); 
void Simple_Delay_Fifty_Milliseconds(void); 
void initComm(void); 
void SendComChar(unsigned char); 

sbit zoneOnOff = P2^7; 
int temp, temp2; 
unsigned char chrRec; 


void main(void) 
{ 
unsigned char c; 
//--------------------------- 
// These two statements will initialize the time for Delay's 
TMOD |= 0x01; 
ET0 = 0; 
//--------------------------- 
Simple_Delay_N_Fifty(20); 
initComm(); 
c = 20; 
temp2 = 0; 

	while(1) 
	{ 
		zoneOnOff = 0; 
		Simple_Delay_N_Fifty(20); 
		zoneOnOff = 1; 
		Simple_Delay_N_Fifty(20); 

		//HERE NOW THE PROGRAM IS WORKING FIND 
		//BUT IF I UNCOMMENT THE FOLLOWING 
		//Statement the program stops working 


		//SendComChar(1); 
		c++; 
	} 
} 


void Simple_Delay_N_Fifty(int n) 
{ 
	for(temp=0;temp<n;temp++) 
	{ 
		Simple_Delay_Fifty_Milliseconds(); 
	} 
} 


void Simple_Delay_Fifty_Milliseconds() 
{ 

	TR0 = 0; 
	TH0 = 0x4B; 
	TL0 = 0xFD; 
	TF0 = 0; 
	TR0 = 1; 
	while(TF0 == 0); 
	TR0 = 0; 
} 


void initComm(void) 
{ 
	//----------- 	
	//TMOD = 0x21; 
	TMOD |= 0x21; 
	TH1 = 0xe6; 
	TCON = 0x00; 

	SCON = 0x50; 
	ET0 = 0; 
	TR1 = 1; 
	//---------- 
} 


void SendComChar(unsigned char c) 
{ 
	temp = c; 
}





List of 19 messages in thread
TopicAuthorDate
Strange problem with KEIL C++ and 8052            01/01/70 00:00      
   Wait a minute...            01/01/70 00:00      
   Your code            01/01/70 00:00      
   RE: Strange problem with KEIL C++ and 8052            01/01/70 00:00      
      RE: Strange problem with KEIL C++ and 8052            01/01/70 00:00      
         RE: Strange problem with KEIL C++ and 8052            01/01/70 00:00      
            poor practice            01/01/70 00:00      
   andy + gopalakrishn + program with <pre>            01/01/70 00:00      
      RE: andy + gopalakrishn + program with <pre>            01/01/70 00:00      
         RE: andy + gopalakrishn + program with <pre>            01/01/70 00:00      
   RE: Strange problem with KEIL C++ and 8052            01/01/70 00:00      
   KEIL Debugger            01/01/70 00:00      
      RE: KEIL Debugger            01/01/70 00:00      
      RE: KEIL Debugger            01/01/70 00:00      
   try this on your keil            01/01/70 00:00      
   Keil Debugger screen shoots            01/01/70 00:00      
      Shazad            01/01/70 00:00      
      RE: Keil Debugger screen shoots            01/01/70 00:00      
   I am facing Nearly Similar Problem            01/01/70 00:00      

Back to Subject List