<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Interrupts in C++ übersetzen]]></title><description><![CDATA[<p>Hallo - ich hoffe hier kann und mag mir jemand weiterhelfen...</p>
<p>Ich hab diverse lauffähige Programme fürn nen ATMEL Test-borad mittels AVR geschrieben - nun hab ich die dumme aufgabe die selben programme nchmal fürn GNU-C compilewr zu machen - nur hab ich keinen blassen schimmer wie ich das mit den interrupts händeln kann?????</p>
<p>hier mal die AVR Variante:</p>
<pre><code class="language-cpp">//intledad.c
#include&lt;90s8535.h&gt;
#include&lt;stdio.h&gt;
#define clock 4000000
#define baud 19200

unsigned int timecount=0;
unsigned int rohw;
unsigned int i;

interrupt [TIM0_OVF] void timer0_ovf_isr(void)
{
TCNT0=6;
if (++timecount==1000)
{
PORTD=PORTD^0x60;
timecount=0;
}
}
interrupt [EXT_INT0] void ext_int0_ist(void)
{
PORTD=0x80;
}
interrupt[ADC_INT] void adc_isr(void)
{
rohw=ADCW;
}

void main(void)
{
DDRD=0xf0;
UCR=0x18;
UBRR=0x0C;

printf(&quot;--Hallo--\r\n\n\n\n\n\n\n&quot;);  
for (i=0;i&lt;10000;i++)
{
}

TCCR0=0x02;
TCNT0=0x00;
TIMSK=0x01;
GIMSK=0x40;
MCUCR=0x02;
ADMUX=0x0;
ADCSR=0xE9;
#asm(&quot;sei&quot;)

while (1)
{
printf(&quot;Kan:%x Wert:%d \r\n&quot;, ADMUX,rohw);
if(ADMUX&lt;0x7)
{
ADMUX=ADMUX+0x1;
}else
{
ADMUX=0x0;
printf(&quot;\n&quot;);
 }
 }
 }
</code></pre>
<p>...dat sollt laufen....</p>
<p>gibt mir ne Wertabfrage an meinen channels aus...</p>
<p>und wie läuft das mit GNU-C ?????<br />
irgendwo an den interrupts hängts wohl - aber viel weiter weis ich beim besten willen net...</p>
<p>Wenn mir jemand helfen mag wär ich sehr Dankbar..</p>
<p>Andi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/156603/interrupts-in-c-übersetzen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 22:05:15 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/156603.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Aug 2006 07:45:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Interrupts in C++ übersetzen on Fri, 18 Aug 2006 07:45:01 GMT]]></title><description><![CDATA[<p>Hallo - ich hoffe hier kann und mag mir jemand weiterhelfen...</p>
<p>Ich hab diverse lauffähige Programme fürn nen ATMEL Test-borad mittels AVR geschrieben - nun hab ich die dumme aufgabe die selben programme nchmal fürn GNU-C compilewr zu machen - nur hab ich keinen blassen schimmer wie ich das mit den interrupts händeln kann?????</p>
<p>hier mal die AVR Variante:</p>
<pre><code class="language-cpp">//intledad.c
#include&lt;90s8535.h&gt;
#include&lt;stdio.h&gt;
#define clock 4000000
#define baud 19200

unsigned int timecount=0;
unsigned int rohw;
unsigned int i;

interrupt [TIM0_OVF] void timer0_ovf_isr(void)
{
TCNT0=6;
if (++timecount==1000)
{
PORTD=PORTD^0x60;
timecount=0;
}
}
interrupt [EXT_INT0] void ext_int0_ist(void)
{
PORTD=0x80;
}
interrupt[ADC_INT] void adc_isr(void)
{
rohw=ADCW;
}

void main(void)
{
DDRD=0xf0;
UCR=0x18;
UBRR=0x0C;

printf(&quot;--Hallo--\r\n\n\n\n\n\n\n&quot;);  
for (i=0;i&lt;10000;i++)
{
}

TCCR0=0x02;
TCNT0=0x00;
TIMSK=0x01;
GIMSK=0x40;
MCUCR=0x02;
ADMUX=0x0;
ADCSR=0xE9;
#asm(&quot;sei&quot;)

while (1)
{
printf(&quot;Kan:%x Wert:%d \r\n&quot;, ADMUX,rohw);
if(ADMUX&lt;0x7)
{
ADMUX=ADMUX+0x1;
}else
{
ADMUX=0x0;
printf(&quot;\n&quot;);
 }
 }
 }
</code></pre>
<p>...dat sollt laufen....</p>
<p>gibt mir ne Wertabfrage an meinen channels aus...</p>
<p>und wie läuft das mit GNU-C ?????<br />
irgendwo an den interrupts hängts wohl - aber viel weiter weis ich beim besten willen net...</p>
<p>Wenn mir jemand helfen mag wär ich sehr Dankbar..</p>
<p>Andi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1119589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1119589</guid><dc:creator><![CDATA[Anfänger-MT]]></dc:creator><pubDate>Fri, 18 Aug 2006 07:45:01 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupts in C++ übersetzen on Fri, 18 Aug 2006 08:19:23 GMT]]></title><description><![CDATA[<p>Seh ich das richtig dass du das Beispiel auf den avr-gcc portieren willst?</p>
<p>Wenn ja kann ich es dir in 22 min sagen *zurück-zum-TV-geh*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1119610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1119610</guid><dc:creator><![CDATA[Kenner der AVRs]]></dc:creator><pubDate>Fri, 18 Aug 2006 08:19:23 GMT</pubDate></item></channel></rss>