30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

y calling the BusyXLCD()function.<br />

The data read from the controller is for the character generator RAM or<br />

the display data RAM depending on the previous Set??RamAddr()<br />

function that was called where ?? is either CG or DD.<br />

Return Value: This function returns the 8-bit data value pointed by the address.<br />

Source File: ReadDataXLCD.c<br />

Code Example: char data;<br />

while (BusyXLCD());<br />

data = ReadDataXLCD();<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

điều khiển.<br />

Bao gồm: xlcd.h<br />

Prototype: void WriteCmdXLCD (unsigned char cmd);<br />

Đối số: cmd này chứa các thông số điều khiển màn hình LCD được cấu hình<br />

như<br />

quy định dưới đây:<br />

Loại giao diện<br />

FOUR_BIT<br />

EIGHT_BIT<br />

Số dòng<br />

SINLE_LINE<br />

TWO_LINE<br />

Phân khúc hướng truyền dữ liệu<br />

DS51456B-page 78<br />

SetCGRamAddr<br />

2004 Microchip Technology Inc.<br />

SEG1_50_SEG51_100<br />

SEG1_50_SEG100_51<br />

Description: This function sets the character generator address.<br />

Include: xlcd.h<br />

Prototype: void SetCGRamAddr(unsigned char CGaddr);<br />

Arguments: CGaddr Character generator address.<br />

Return Value: None<br />

Remarks: This function sets the character generator address of the P-tec<br />

PCOG1602B LCD controller. The user must first check to see if the<br />

controller is busy by calling the BusyXLCD()function.<br />

Source File: SetCGRamAddr.c<br />

Code Example: char cgaddr = 0x1F;<br />

while (BusyXLCD());<br />

SetCGRamAddr(cgaddr);<br />

SetDDRamAddr<br />

Description: This function sets the display data address.<br />

Include: xlcd.h<br />

Prototype: void SetDDRamAddr(unsigned char DDaddr);<br />

Arguments: DDaddr Display data address.<br />

Return Value: None<br />

Remarks: This function sets the display dataaddress of the P-tec PCOG1602B<br />

LCD controller. The user must first check to see if the controller is busy<br />

by calling the BusyXLCD()function.<br />

Source File: SetDDRamAddr.c<br />

Code Example: char ddaddr = 0x10;<br />

while (BusyXLCD());<br />

SetDDRamAddr(ddaddr);<br />

SEG100_51_SEG50_1<br />

SEG100_51_SEG1_50<br />

COM truyền dữ liệu hướng<br />

COM1_COM16<br />

COM16_COM1<br />

Hiển thị On / Off kiểm soát<br />

DON<br />

Lột nón<br />

CURSOR_ON<br />

CURSOR_OFF<br />

BLINK_ON<br />

BLINK_OFF<br />

Con trỏ hoặc hiển thị định nghĩa phím Shift<br />

SHIFT_CUR_LEFT<br />

SHIFT_CUR_RIGHT<br />

SHIFT_DISP_LEFT<br />

SHIFT_DISP_RIGHT<br />

Trở lại giá trị: Không<br />

Ghi chú: Chức năng này viết các byte lệnh cho P-tec PCOG1602B LCD<br />

điều khiển. Người dùng đầu tiên phải kiểm tra xem nếu bộ điều khiển màn hình<br />

LCD đang bận<br />

bằng cách gọi BusyXLCD () chức năng.<br />

Source File: WriteCmdXLCD.c<br />

Mã số Ví dụ: trong khi (BusyXLCD ());<br />

WriteCmdXLCD (EIGHT_BIT & TWO_LINE);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!