<?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>ADuC814 ... printf usage disables DAC usage ??</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/23409/aduc814-printf-usage-disables-dac-usage</link><description> 
Im testing the uVision3 v8.16 IDE in connection with 
ADIs original ADuC814 eval board. When driving the 
DACs, everything works as long as I&amp;#194;&amp;#39;m NOT using 
printf. 

 
 Does printf reset the DAC settings or something 
like this ? 

 
I inserted a condition</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: ADuC814 ... printf usage disables DAC usage ??</title><link>https://community.arm.com/thread/114548?ContentTypeID=1</link><pubDate>Mon, 29 Dec 2008 07:57:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:587a1a4b-8603-454b-a5b5-7cfeca3027e1</guid><dc:creator>K. Paulsen</dc:creator><description>&lt;p&gt;&lt;p&gt;
Problem was solved by shifting baudrate generation&lt;br /&gt;
from T1 to T2.&lt;/p&gt;

&lt;p&gt;
New problem - fitting to the headline : when using&lt;br /&gt;
simple putchar in the main loop there is no problem&lt;br /&gt;
but when using fprint instead the mentioned I/O&lt;br /&gt;
interrupt is slowed down significantly.&lt;/p&gt;

&lt;p&gt;
I have an interrupt several hundert times a second&lt;br /&gt;
reading and writing external I/O and it works fine.&lt;br /&gt;
The main program is just supervising stuff and putting&lt;br /&gt;
it out on UART.&lt;/p&gt;

&lt;p&gt;
Is printf or sub-parts of it disabling interrupts&lt;br /&gt;
during runtime ? As far as I have read printf is also&lt;br /&gt;
just using putchar so there should be no such problem,&lt;br /&gt;
right ?&lt;/p&gt;

&lt;p&gt;
I basically dont care how long printf needs to put&lt;br /&gt;
stuff out since main things happen in the interrupt.&lt;br /&gt;
So there is no execution time problem for me using&lt;br /&gt;
printf, if it wouldnt slow down my I/O interrupt&lt;/p&gt;

&lt;p&gt;
My tests show that cycles inside printf definately&lt;br /&gt;
slow down the my I/O interrupts. When I shorten the&lt;br /&gt;
printf statement, the I/O interrupt gets called more&lt;br /&gt;
often than with a long printf statement.&lt;/p&gt;

&lt;p&gt;
Strange. Any ideas ? I guess the printf source is not&lt;br /&gt;
open, isnt it ??&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADuC814 ... printf usage disables DAC usage ??</title><link>https://community.arm.com/thread/101472?ContentTypeID=1</link><pubDate>Sun, 21 Dec 2008 09:34:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d7216b13-7a3a-48e9-9f35-f0b498c0a38a</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;a href="http://www.8052.com/forum/read/161094"&gt;www.8052.com/.../161094&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADuC814 ... printf usage disables DAC usage ??</title><link>https://community.arm.com/thread/77001?ContentTypeID=1</link><pubDate>Sat, 20 Dec 2008 13:15:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:730dcbfb-ec31-4c47-9d97-919eeee7d99f</guid><dc:creator>K. Paulsen</dc:creator><description>&lt;p&gt;&lt;p&gt;
The program fragment I posted is part of a bigger code&lt;br /&gt;
that does ADC and DAC interrupt driven. In the main&lt;br /&gt;
loop I do nothing but just some printf output. I&lt;br /&gt;
shrinked the code just to demonstrate the problem.&lt;/p&gt;

&lt;p&gt;
I have NO problem that printf basically takes quite a&lt;br /&gt;
long time to execute, I just have a problem with the&lt;br /&gt;
fact that after the first time printf is used my DAC&lt;br /&gt;
output is &amp;quot;dead&amp;quot;. Before the first printf the DAC&lt;br /&gt;
output worx, even with the bit code I posted. I also&lt;br /&gt;
tried to re-setup the DACCON again but it doesnt help.&lt;/p&gt;

&lt;p&gt;
I dont know if my serial output implementation polled or
interrupt-driven, I guess polled, I did no setup&lt;br /&gt;
for that since it worked fine just &amp;quot;out of the box&amp;quot;.&lt;br /&gt;
The printf output appears correctly. How is printf&lt;br /&gt;
done when one does just a main(){printf(&amp;quot;test&amp;quot;)} ??&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADuC814 ... printf usage disables DAC usage ??</title><link>https://community.arm.com/thread/53132?ContentTypeID=1</link><pubDate>Sat, 20 Dec 2008 12:04:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:47f9b882-9ace-4c09-bd1c-fe8a3e5c248e</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
So what, exactly, &lt;i&gt;does&lt;/i&gt; it do with that printf in there?&lt;/p&gt;

&lt;p&gt;
You don&amp;#39;t seem to have anything to control the timing of your
output other than the time it takes to execute the loop.&lt;/p&gt;

&lt;p&gt;
Obviously, printf - just like any other function - will take a
certain time to execute.&lt;br /&gt;
Obviously, therefore, adding printf - or any other function call - in
your loop will affect the output.&lt;/p&gt;

&lt;p&gt;
Is your serial output implementation polled, or
interrupt-driven?&lt;/p&gt;

&lt;p&gt;
Does the printf output appear correctly?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>