Haberler:

Foruma Resim Yükleme ve Boyut Sınırlaması ( ! )  https://bit.ly/2GMFb8H

Ana Menü

output_d() Fonksiyonu Hakkında

Başlatan Eren Eraslan, 18 Ocak 2016, 09:09:44

Eren Eraslan

Merhaba, bir glcd kütüphanesinde , byte ları yollamak üzere paralel den
output_d(data);

fonksiyonunu kullanıyorum. Fakat PCB tasarımı yaparken ekranın paralel pinleri yanyana olmadığından D0-D7
bu bacakları değiştirmek istiyorum.
atıyorum PIN_D7 paralel yolladığımda 7. bit olarak gönderilirken ben bunu 3. bit olarak göndermek istiyorum.
İnternette doğru kelimeleri bulamadığımdan istediğim şeyler çıkmadı.
Teşekkürler
insanın içine işleyen şarkılar ;  https://soundcloud.com/reeraslan

aliveli

#include <16F877.H> 
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP 
#use delay(clock = 4000000) 
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS) 

// We want to be able to write a byte value to the following spare pins. 
// RA0,RA1,RA4,RB2,RB5,RB7,RC0,RC5 

// Define the bit addresses of the spare pins. 
// The addresses shown below are for the 16F877. 
#bit RA0 = 5.0 
#bit RA1 = 5.1 
#bit RA4 = 5.4 
#bit RB2 = 6.2 
#bit RB5 = 6.5 
#bit RB7 = 6.7 
#bit RC0 = 7.0 
#bit RC5 = 7.5 

// The following macro defines the "set_spare_bits()" function. 
// This will be implemented by the compiler as eight sequential 
// BSF or BCF instructions. 
#define set_spare_bits(x)  \ 
RA0 = x & 1;         \            
RA1 = (x >> 1) & 1;  \ 
RA4 = (x >> 2) & 1;  \ 
RB2 = (x >> 3) & 1;  \ 
RB5 = (x >> 4) & 1;  \ 
RB7 = (x >> 5) & 1;  \ 
RC0 = (x >> 6) & 1;  \ 
RC5 = (x >> 7) & 1  

//================================== 
void main() 
{ 

// The TRIS must be set for the spare pins before the function is 
//  called.   The spare pins must be set as outputs. 
set_tris_a(0b11101100); 
set_tris_b(0b01011011); 
set_tris_c(0b11011110); 

set_spare_bits(0x55); 

while(1); 
}


kullandığın pic için d portunun pin adreslerini yukarıdaki gibi ayarlaman lazım