一、引言
ringoscillator是一種基於反饋的振蕩電路,常用於時鍾電路、數字電路等領域。本文將從多個方面對ringoscillator的原理、應用等方面作詳細闡述。
二、基本原理
ringoscillator由多個同構的環形反饋電路串聯構成。每個環形電路包含一個放大器和一個延遲線。當環形電路中的信號經過多次放大和延遲後,就會形成一個穩定的振蕩信號。
/**
非精密晶振庫中示例代碼,定頻輸出約為38.2Khz ~44.8Khz,主要受EEPROM參數影響,CPU速度對輸出頻率影響較小
*/
#include
unsigned int a[6],b[6],d,c;
unsigned char AD9850_CLK=3; //設置脈衝信號輸出引腳
unsigned char OutHigh=3;
unsigned char OutLow=10;
void SER(unsigned char Index) //並行方式出數,AD9850的Datasheet中給出了
{
char i=0;
for(i=0;i>=1;
}
}
void W_CLK() //產生單個脈衝信號
{
digitalWrite(AD9850_CLK,HIGH);
digitalWrite(AD9850_CLK,LOW);
}
void IO_Update() //按照數據手冊進行模擬通信方式編寫
{
digitalWrite(OutLow,LOW);
digitalWrite(OutHigh,LOW);
digitalWrite(AD9850_CLK,LOW);
delayMicroseconds(1);
digitalWrite(OutHigh,HIGH);
digitalWrite(OutLow,HIGH);
digitalWrite(AD9850_CLK,HIGH);
digitalWrite(OutHigh,LOW);
delayMicroseconds(1);
}
void WriteFreq(unsigned long frequency)
{
unsigned long tuning_word=(frequency*4294967296/125000000);
Serial.print("tuning word=");
Serial.println(tuning_word);
SER(tuning_word>>24);
SER(tuning_word>>16);
SER(tuning_word>>8);
SER(tuning_word>>0);
IO_Update();
}
void WritePhase(unsigned int phase)
{
unsigned short phase_word=phase;
phase_word*=45.51111111;
SER(phase_word>>8);
SER(phase_word);
IO_Update();
}
void setup()
{
Serial.begin(115200);
pinMode(AD9850_CLK,OUTPUT);
pinMode(OutHigh,OUTPUT);
pinMode(OutLow,OUTPUT);
WriteFreq(1000000);
}
void loop()
{
WritePhase(0);
delay(1000);
}
三、電路實現
ringoscillator的電路實現十分簡單,主要包含以下幾個部分:
小結
本文介紹了ringoscillator的原理、應用、電路實現等方面。在實際項目中,我們可以根據具體需求選擇適合的ringoscillator電路實現,在數字電路、時鐘電路等領域發揮重要作用。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/272317.html