Pıc programlama hatası

Katılım
19 May 2012
Mesajlar
85
Puanları
1
Selamun Aleykum;
CCS C ile pic programlamaya çalışıyorum fakat delay_ms(500) yazıyorum mesela fakat uygulamaya doktugum zaman sanki 2 saniye gibi oluyor yani bekleme süresi çok uzuyor(yanma süreside) ex_tones ile nota çalıyım dedi aynı şekilde notalar çok uzuyor ve piezzodan buzzer gibi ses geliyor :)
------------------------------------------------------------------------------------------------------------------------------------------
OS: Windows 8.1
Derleyicim: PCW
PIC : 18f2550 (Dahili Saat Kullanıyorum)
Brenner 8 , US-Burn
-----------------------------------------------------------------------------------------
---------------------------------------------------
FUSES AYARLARIM:

#include <18F2550.h>
#FUSES HS
#FUSES NOWDT
#FUSES INTRC
#FUSES NOPROTECT
#FUSES NOMCLR
#FUSES NOLVP
#use delay(clock=4000000)
---------------------------------------------------------------------------------------------------------------------------------------------
KODLARIM:


#include <deneme.h>
#include <tones.c>
setup_oscillator (OSC_4MHZ)
#define SIZE 25

const struct note
{
long tone;
long length;
} happy_bday[SIZE] = {
C_note[0],350, C_note[0],100, D_note[0],500, C_note[0],500, F_note[0],500, E_note[0],900,
C_note[0],350, C_note[0],100, D_note[0],500, C_note[0],500, G_note[0],500, F_note[0],900,
C_note[0],350, C_note[0],100, C_note[1],500, A_note[0],500, F_note[0],500, E_note[0],500, D_note[0],900,
Bb_note[0],350, Bb_note[0],100, A_note[0],500, F_note[0],500, G_note[0],500, F_note[0],1200};


void main(void) {

int i;

while(TRUE)
{
for(i=0; i<SIZE; ++i)
{
generate_tone(happy_bday.tone,happy_bday.length);
delay_ms(75);
}
}
}
---------------------------------------------------------------------------------------------------------------------------------------
Devrede PIC'e sadece -,+ ve A0 pinine piezzoyu(dirençle) bağlayıp çalıştırıyorum.
Devre Bağlamamda hata yok. Sorunun donanımsal olmadığından eminim.
 
Noktalı virgüllerin eksikbirkaç satırda var onları koy
 
#Fuses HS
#use delay(clock=4000000)
setup_oscillator (OSC_4MHZ)
Satırlarını silip yerine ;
#use delay(internal=4000000) yazıp deneyiniz.
 
HS yerine XT yazmalısın
 

Forum istatistikleri

Konular
127,952
Mesajlar
913,885
Kullanıcılar
449,600
Son üye
psychedelic

Yeni konular

Geri
Üst