PicbasicPro daki shiftout ve serin komutları hakkında

Başlatan eee1984, 28 Ocak 2008, 12:37:34

eee1984

Merhaba arkadaslar

picbasicpro daki shiftout ve serin veya dtmfout komutlarına alternatif picc dilinde bi komut var mı eger yoksa shiftout un serin in yada dtmf out un yaptıklarını picc ile farklı komutlar kullanarak yapabilirmiyiz..

Birde örnek verebilirseniz çok memnun olurum..

İlginiz için teşekkürler.

:oops:

Logan

@eee1984, CCS'de var mı bilmiyorum fakat Hi-Tech'de bu durum söz konusu değil. Oturup o komuta ait programın hepsini kendin yazman gerekir. Baştan zor gibi görünse de öğreticilik açısından son derece faydalıdır.
İmza.

eee1984

Alıntı yapılan: "Logan"@eee1984, CCS'de var mı bilmiyorum fakat Hi-Tech'de bu durum söz konusu değil. Oturup o komuta ait programın hepsini kendin yazman gerekir. Baştan zor gibi görünse de öğreticilik açısından son derece faydalıdır.

Bende hi-tech i kullandım ama açıkcası nasıl yapılacagı aklıma gelmedi bi fikriniz var mı acaba  :oops:

Logan

@eee1984, dtmfout komutunu daha önce Hi-Tech ile kullanma gereği duymadım. Fakat serout komutuna örnek programı verebilirim.

Alıntı Yap
////////-- 8 BIT SPI PROTOCOL --\\\\\\\\
void send8(unsigned char lcd_reg) {
   for (a=0;a<=7;a++) {
      if (lcd_reg&0x80) { sda_595=1; }
      else { sda_595=0;}
       scl_595=1; DelayUs(3); scl_595=0;
            lcd_reg=lcd_reg << 1; }
 enable_595=1; DelayUs(3); enable_595=0;
} // End void...

Shiftin komutuna gelince, yukarıdaki mantığın tam tersini uygulayabilirsin. Denemedim ama çalışacağına eminim. :)
İmza.

eee1984

Alıntı yapılan: "Logan"@eee1984, dtmfout komutunu daha önce Hi-Tech ile kullanma gereği duymadım. Fakat serout komutuna örnek programı verebilirim.

Alıntı Yap
////////-- 8 BIT SPI PROTOCOL --\\\\\\\\
void send8(unsigned char lcd_reg) {
   for (a=0;a<=7;a++) {
      if (lcd_reg&0x80) { sda_595=1; }
      else { sda_595=0;}
       scl_595=1; DelayUs(3); scl_595=0;
            lcd_reg=lcd_reg << 1; }
 enable_595=1; DelayUs(3); enable_595=0;
} // End void...

Shiftin komutuna gelince, yukarıdaki mantığın tam tersini uygulayabilirsin. Denemedim ama çalışacağına eminim. :)

Eyw. dostum sağolasın  ;)

M_B

mrb arkadas
Shiftout komutuna denk aynı ıslemı yapan CCS C dekı kod
#IFNDEF EXP_OUT_ENABLE

#define EXP_OUT_ENABLE  PIN_B0
#define EXP_OUT_CLOCK   PIN_B1
#define EXP_OUT_DO      PIN_B2
#define NUMBER_OF_74595 1

#ENDIF


void write_expanded_outputs(byte* eo) {
  byte i;

  output_low(EXP_OUT_CLOCK);
  output_low(EXP_OUT_ENABLE);

  for(i=1;i<=NUMBER_OF_74595*8;++i) {  // Clock out bits from the eo array
    if((*(eo+(NUMBER_OF_74595-1))&0x80)==0)
      output_low(EXP_OUT_DO);
    else
      output_high(EXP_OUT_DO);
   shift_left(eo,NUMBER_OF_74595,0);
   output_high(EXP_OUT_CLOCK);
   output_low(EXP_OUT_CLOCK);
  }
  output_high(EXP_OUT_ENABLE);
}

Serin komutuna denk gelen CCS C deki kod 

#IFNDEF EXP_IN_ENABLE

#define EXP_IN_ENABLE   PIN_B3
#define EXP_IN_CLOCK    PIN_B4
#define EXP_IN_DI       PIN_B5
#define NUMBER_OF_74165 1

#ENDIF


void read_expanded_inputs(byte *ei) {
  byte i;

  output_high(EXP_IN_CLOCK);
  output_low(EXP_IN_ENABLE);      // Latch all inputs
  output_high(EXP_IN_ENABLE);

  for(i=1;i<=NUMBER_OF_74165*8;++i) {      // Clock in bits to the ei structure
    shift_left(ei,NUMBER_OF_74165,input(EXP_IN_DI));
    output_low(EXP_IN_CLOCK);
    output_high(EXP_IN_CLOCK);
  }
  output_low(EXP_IN_ENABLE);
}



DTMF icin kod elımde yok nette bır arastırma yap olması gerek dıye dusunuyorum.
İmkanın sınırlarını görmek için imkansızı denemek lazım.                                                             Fatih Sultan Mehmet

eee1984

Alıntı yapılan: "M_B"mrb arkadas
Shiftout komutuna denk aynı ıslemı yapan CCS C dekı kod

DTMF icin kod elımde yok nette bır arastırma yap olması gerek dıye dusunuyorum.

Tesekkurler hocam ;)