<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://yuriko.co.nz/w/index.php?action=history&amp;feed=atom&amp;title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8</id>
	<title>簡易AVR-DDS 1KHz発振器 - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://yuriko.co.nz/w/index.php?action=history&amp;feed=atom&amp;title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8"/>
	<link rel="alternate" type="text/html" href="https://yuriko.co.nz/w/index.php?title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8&amp;action=history"/>
	<updated>2026-04-12T15:08:51Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://yuriko.co.nz/w/index.php?title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8&amp;diff=226&amp;oldid=prev</id>
		<title>市川ゆり子: 節の修正</title>
		<link rel="alternate" type="text/html" href="https://yuriko.co.nz/w/index.php?title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8&amp;diff=226&amp;oldid=prev"/>
		<updated>2016-04-21T10:08:05Z</updated>

		<summary type="html">&lt;p&gt;節の修正&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2016年4月21日 (木) 10:08時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot; &gt;7行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;7行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ただし'''ATtiny13A'''は外部水晶振動子が使えず、内蔵CR発振器による動作になるので、あまり周波数精度を高くできない・・・&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ただし'''ATtiny13A'''は外部水晶振動子が使えず、内蔵CR発振器による動作になるので、あまり周波数精度を高くできない・・・&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;==C言語コード&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==C言語コード==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;main()関数内のfreq変数を変更すれば任意の周波数で発振可能。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;main()関数内のfreq変数を変更すれば任意の周波数で発振可能。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l14&quot; &gt;14行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;14行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;なお、define定義は'''_AVR_ATtiny2313A_H_'''となっているが、'''AT90S2313'''や'''ATtiny2313'''でも実行可能。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;なお、define定義は'''_AVR_ATtiny2313A_H_'''となっているが、'''AT90S2313'''や'''ATtiny2313'''でも実行可能。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==コード==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;==コード&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>市川ゆり子</name></author>
	</entry>
	<entry>
		<id>https://yuriko.co.nz/w/index.php?title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8&amp;diff=225&amp;oldid=prev</id>
		<title>市川ゆり子: +}}</title>
		<link rel="alternate" type="text/html" href="https://yuriko.co.nz/w/index.php?title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8&amp;diff=225&amp;oldid=prev"/>
		<updated>2016-04-21T09:58:42Z</updated>

		<summary type="html">&lt;p&gt;+}}&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2016年4月21日 (木) 09:58時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l96&quot; &gt;96行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;96行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DEFAULTSORT:かんいAVR-DDS1KHzはつしんき&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DEFAULTSORT:かんいAVR-DDS1KHzはつしんき&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:電子工作]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:電子工作]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>市川ゆり子</name></author>
	</entry>
	<entry>
		<id>https://yuriko.co.nz/w/index.php?title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8&amp;diff=224&amp;oldid=prev</id>
		<title>市川ゆり子: ページの作成:「手元に古いAVRマイコン'''AT90S2313'''が転がってて、しかもPLLの基準信号用に1KHzが欲しかったので、AVR-DDSを作ってみた♪  基準信...」</title>
		<link rel="alternate" type="text/html" href="https://yuriko.co.nz/w/index.php?title=%E7%B0%A1%E6%98%93AVR-DDS_1KHz%E7%99%BA%E6%8C%AF%E5%99%A8&amp;diff=224&amp;oldid=prev"/>
		<updated>2016-04-21T09:58:20Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「手元に古いAVRマイコン&amp;#039;&amp;#039;&amp;#039;AT90S2313&amp;#039;&amp;#039;&amp;#039;が転がってて、しかもPLLの基準信号用に1KHzが欲しかったので、AVR-DDSを作ってみた♪  基準信...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;手元に古いAVRマイコン'''AT90S2313'''が転がってて、しかもPLLの基準信号用に1KHzが欲しかったので、AVR-DDSを作ってみた♪&lt;br /&gt;
&lt;br /&gt;
基準信号作るのに'''74HC192'''とかを何石も使って分周すると、基板面積を食うので1石で1KHzの信号作れるのはイイ。&lt;br /&gt;
&lt;br /&gt;
なお、さらに実装面積をケチれるように、8pinの'''ATtiny13A'''でも1KHz発振できるようにした。条件コンパイルを使ってどちらのCPUでも、同じコードで動作するようにした♪&lt;br /&gt;
&lt;br /&gt;
ただし'''ATtiny13A'''は外部水晶振動子が使えず、内蔵CR発振器による動作になるので、あまり周波数精度を高くできない・・・&lt;br /&gt;
&lt;br /&gt;
===C言語コード===&lt;br /&gt;
main()関数内のfreq変数を変更すれば任意の周波数で発振可能。&lt;br /&gt;
&lt;br /&gt;
クロックは8MHz水晶 or 9.6MHz内蔵発振器としているが、異なる周波数を使用する場合は'''F_CPU'''を違う値に変えればおｋ。&lt;br /&gt;
&lt;br /&gt;
なお、define定義は'''_AVR_ATtiny2313A_H_'''となっているが、'''AT90S2313'''や'''ATtiny2313'''でも実行可能。&lt;br /&gt;
&lt;br /&gt;
==コード==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * ATtiny2313-DDS.c&lt;br /&gt;
 *&lt;br /&gt;
 * Created: 2016/04/08 12:50:12&lt;br /&gt;
 *  Author: 市川ゆり子&lt;br /&gt;
 */ &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;avr/interrupt.h&amp;gt;&lt;br /&gt;
#include &amp;lt;avr/io.h&amp;gt;&lt;br /&gt;
#include &amp;lt;avr/fuse.h&amp;gt;&lt;br /&gt;
#include &amp;lt;avr/signature.h&amp;gt;&lt;br /&gt;
//#include &amp;lt;io2313.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//Define clkCPU&lt;br /&gt;
#ifdef _AVR_ATtiny2313A_H_&lt;br /&gt;
#define F_CPU 8000000UL	//tiny2313 Ext.XTAL 8MHz&lt;br /&gt;
//#define F_CPU 8000000UL	//90S2313 Ext.XTAL 8MHz&lt;br /&gt;
#elif _AVR_ATTINY13A_H_&lt;br /&gt;
#define F_CPU 9600000UL	//tiny13 Internal OSC 9.6MHz&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#ifdef _AVR_ATTINY13A_H_&lt;br /&gt;
FUSES = {&lt;br /&gt;
	.low = (FUSE_SPIEN &amp;amp; FUSE_SUT0 &amp;amp; FUSE_CKSEL0),	//SPIEN, InterOSC 9.6MHz 14CK 64ms&lt;br /&gt;
	.high = FUSE_BODLEVEL0	//BODLEVEL 1.8V&lt;br /&gt;
};&lt;br /&gt;
#elif _AVR_ATtiny2313A_H_&lt;br /&gt;
//stub&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
volatile uint16_t freq;&lt;br /&gt;
&lt;br /&gt;
//Calling interval 31.25KHz (8MHz/256)&lt;br /&gt;
#ifdef _AVR_ATtiny2313A_H_&lt;br /&gt;
ISR(TIMER0_OVF_vect){&lt;br /&gt;
#elif _AVR_ATTINY13A_H_&lt;br /&gt;
ISR(TIM0_OVF_vect){&lt;br /&gt;
#endif&lt;br /&gt;
	static uint32_t p;&lt;br /&gt;
	&lt;br /&gt;
	if (p &amp;lt; F_CPU/512)&lt;br /&gt;
	{&lt;br /&gt;
		PORTB |= _BV(PINB0);&lt;br /&gt;
	} &lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		PORTB &amp;amp;= ~_BV(PINB0);&lt;br /&gt;
	}&lt;br /&gt;
	p+=freq;&lt;br /&gt;
	if (p &amp;gt; F_CPU/256)&lt;br /&gt;
	{&lt;br /&gt;
		p = 0;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
	//All Ports set OUTPUT&lt;br /&gt;
#ifdef _AVR_ATtiny2313A_H_&lt;br /&gt;
	DDRD = 0b01111111;&lt;br /&gt;
#endif&lt;br /&gt;
	DDRB = 0b11111111;&lt;br /&gt;
	&lt;br /&gt;
	TCCR0B = _BV(CS00);//Timer Clock Source: clkI/O&lt;br /&gt;
	//Enable Interrupt Timer0 Overflow&lt;br /&gt;
#ifdef _AVR_ATtiny2313A_H_&lt;br /&gt;
	TIMSK = _BV(TOIE0);&lt;br /&gt;
#elif _AVR_ATTINY13A_H_&lt;br /&gt;
	TIMSK0 = _BV(TOIE0);&lt;br /&gt;
#endif&lt;br /&gt;
	&lt;br /&gt;
	freq = 1000;&lt;br /&gt;
	sei();&lt;br /&gt;
	&lt;br /&gt;
    while(1)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:かんいAVR-DDS1KHzはつしんき&lt;br /&gt;
[[Category:電子工作]]&lt;/div&gt;</summary>
		<author><name>市川ゆり子</name></author>
	</entry>
</feed>