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.

Control I/O pin definitions<br />

RW_PIN PORTxbits.Rx?<br />

TRIS_RW TRISxbits.Rx?<br />

RS_PIN PORTxbits.Rx?<br />

TRIS_RS TRISxbits.Rx?<br />

E_PIN PORTxbits.Rx?<br />

TRIS_E TRISxbits.Rx?<br />

where xis the PORT, ?is the pin number<br />

Data pin definitions<br />

DATA_PIN_? PORTxbits.RD?<br />

TRIS_DATA_PIN_? TRISxbits.TRISD?<br />

where xis the PORT, ?is the pin number<br />

The Data pins can be from either one port or from multiple ports.<br />

The control pins can be on any port and are not required to be on the<br />

same port. The data interface must be defined as either 4-bit or 8-bit.<br />

The 8-bit interface is defined when a<br />

#define EIGHT_BIT_INTERFACE is included in the header file<br />

xlcd.h. If no define is included, thenthe 4-bit interface is included.<br />

After these definitions have been made, the user must compile the<br />

application code into an object to be linked.<br />

This function also requires three external routines for specific delays:<br />

DelayFor18TCY() 18 Tcy delay<br />

DelayPORXLCD() 15ms delay<br />

DelayXLCD() 5ms delay<br />

Delay100XLCD() 100Tcy delay<br />

Source File: openXLCD.c<br />

Code Example: OpenXLCD(EIGHT_BIT &TWO_LINE<br />

& SEG1_50_SEG51_100 &COM1_COM16);<br />

putsXLCD<br />

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

Địa chỉ đọc từ bộ điều khiển cho máy phát điện nhân vật<br />

RAM hoặc bộ nhớ RAM hiển thị dữ liệu tùy thuộc vào trước<br />

Đặt ?? RamAddr () chức năng được gọi là nơi ?? có thể quản trị hoặc<br />

DD.<br />

Source File: ReadAddrXLCD.c<br />

Mã số Ví dụ: địa chỉ char;<br />

trong khi (BusyXLCD ());<br />

địa chỉ = ReadAddrXLCD ();<br />

ReadDataXLCD<br />

Mô tả: Chức năng này đọc một dữ liệu bytefrom P-tec PCOG1602B LCD<br />

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

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

Prototype: char ReadDataXLCD (void);<br />

Lập luận: Không<br />

Ghi chú: Chức năng này đọc một dữ liệu bytefrom 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 />

Đọc dữ liệu từ bộ điều khiển là cho RAM máy phát điện nhân vật hoặc<br />

RAM hiển thị dữ liệu tùy thuộc vào trước Set ?? RamAddr ()<br />

chức năng được gọi là nơi ?? hoặc là CG hay DD.<br />

Trở lại giá trị: Chức năng này trả về giá trị dữ liệu 8-bit chỉ bởi địa chỉ.<br />

Source File: ReadDataXLCD.c<br />

Mã số Ví dụ: char dữ liệu;<br />

trong khi (BusyXLCD ());<br />

dữ liệu = ReadDataXLCD ();<br />

dsPIC<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

putrsXLCD<br />

Description: This function writes a string of characters to the P-tec PCOG1602B<br />

DS51456B trang 78<br />

SetCGRamAddr<br />

2004 Microchip Technology Inc<br />

LCD controller.<br />

Include: xlcd.h<br />

Prototype: void putsXLCD (char *buffer);<br />

void putrsXLCD (const rom char *buffer);<br />

Arguments: buffer Pointer to the characters to bewritten to the LCD controller.<br />

Return Value: None<br />

Remarks: These functions write a string of characters located in bufferto the<br />

P-tec PCOG1602B LCD controller till a NULL character is encountered<br />

Mô tả: Chức năng này đặt địa chỉ máy phát điện nhân vật.<br />

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

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

Đối số: CGaddr địa chỉ máy phát điện nhân vật.<br />

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

Ghi chú: Chức năng này đặt địa chỉ máy phát điện nhân vật của P-tec<br />

PCOG1602B LCD điều khiển. Người dùng đầu tiên phải kiểm tra xem nếu<br />

điều khiển là bận rộn bằng cách gọi BusyXLCD () chức năng.

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

Saved successfully!

Ooh no, something went wrong!