<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>About printf() function !</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/15983/about-printf-function</link><description> HI : 
 if I use these codes the &amp;quot;printf&amp;quot; don&amp;#39;t work: 
 { 
 SCON = 0x50; 
	TMOD |= 0x22; TCON = 0x40; TH1 = 0xFD; 
 //TI = 1; 
 printf(&amp;quot; thank you&amp;quot;); 
 } 
 BUT if I set TI to hight(TI = 1) ,the printf 
work fine ! 
 
why? </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: About printf() function !</title><link>https://community.arm.com/thread/40620?ContentTypeID=1</link><pubDate>Sun, 27 Jul 2003 22:09:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b80d1ea3-af1f-42b0-9252-1187bd518c94</guid><dc:creator>Philip Garman</dc:creator><description>&lt;p&gt;Hello HE&lt;br /&gt;
&lt;br /&gt;
Keil&amp;#39;s default implimentation of printf calls putchar.  putchar() as can be seen from putchar.c source waits for TI to go high prior to transmitting the first character.&lt;br /&gt;
&lt;br /&gt;
So as long as your using Keil&amp;#39;s putchar function, you are going to need to set TI during initilization or before calling printf.&lt;br /&gt;
&lt;br /&gt;
Phil&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
/*
 * putchar (mini version): outputs charcter only
 */
char putchar (char c)  {
  while (!TI);
  TI = 0;
  return (SBUF = c);
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>