15k hz ve 5 k hz i nasil uretelir.

Başlatan ertug, 12 Ağustos 2004, 18:03:18

ertug

merhaba pic in portlarından aynı anda 15k hz ve 5 k hz i nasil uretelir.
vaktinizi ayirirsaniz cok memnun olurum.

fsan

merhaba,
hardware PWM, interrupt, veya Picbasic pro da bu sekilde:
FREQOUT Pin,Onms,Frequency1{,Frequency2}
Alıntı YapProduce the Frequency(s) on Pin for Onms milliseconds. One or two different frequencies from 0 to 32767 Hertz may be produced at a time. FREQOUT generates tones using a form of pulse width modulation. The raw data coming out of the pin looks pretty scary. Some kind of filter is usually necessary to smooth the signal to a sine wave and get rid of some of the harmonics that are generated: FREQOUT works best with a 20MHz or 40MHz oscillator. It can also work with a 10MHz oscillator and even at 4MHz, although it will start to get very hard to filter and be of fairly low amplitude. Any other frequency will cause FREQOUT to generate a frequency that is a ratio of the actual oscillator used and 20MHz. FREQOUT is not supported on 12-bit core PICmicro MCUs due to RAM and stack constraints.
' Send 15 KHz / 5 KHz for 2 seconds on portb.1
FREQOUT PORTB.1, 2000, 15000, 5000