pıc c lcd

elktro

Üye
Katılım
26 Eki 2008
Mesajlar
18
Puanları
1
Yaş
39
******************************************************************
* Function Name: WriteDataXLCD *
* Return Value: void *
* Parameters: data: data byte to be written to LCD *
* Description: This routine writes a data byte to the *
* Hitachi HD44780 LCD controller. The user *
* must check to see if the LCD controller is *
* busy before calling this routine. The data *
* is written to the character generator RAM or*
* the display data RAM depending on what the *
* previous SetxxRamAddr routine was called. *
********************************************************************/
void WriteDataXLCD(unsigned char bValue)
{

unsigned char bTemp;
bTemp = bValue;

// Wait 1milsec for not busy
Wait(BUSY_DELAY);

// clear RS for Instruction
RS_PIN = 1;

// write ms nibble to port
LATD = (LATD & 0xFFF0) | (bTemp >> 4 & 0x000F);

// make PORTD output
TRISD = TRISD & 0xFFF0;

// clear R/!W for write
RW_PIN = 0;

// toggle enable for > 1 usec
E_PIN = 1;
Wait(20);
E_PIN = 0;

Wait(20);

// write ls nibble to port
LATD = (LATD & 0xFFF0) | (bValue & 0x000F);

// clear R/!W for write
RW_PIN = 0;


// toggle enable for > 1 usec
E_PIN = 1;
Wait(20);
E_PIN = 0;

//make PORTD input;
TRISD = TRISD | 0x000F;

return;

}

void Wait(unsigned int count)
{
while(count--);
}

arkadslr ben burda lcdyebldc motorda hız kontoluü yapıyorum hangi hızda oldugunu lcd de nasıl görebilirim nasıl bir komut ekleyeblrlm
 

Forum istatistikleri

Konular
128,198
Mesajlar
915,773
Kullanıcılar
449,979
Son üye
schule48

Yeni konular

Çevrimiçi üyeler

Geri
Üst