30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

specific<br />

libraries.<br />

When compiling an application, header file must be referenced (using #include)<br />

by<br />

all source files which call a function in the library or use its symbols or<br />

typedefs.<br />

When linking an application, the library file must be provided as an input to the<br />

linker<br />

(using the --libraryor -llinker switch) such that the functions used by the<br />

application may be linked into the application.<br />

The batch file makeplib.batmay be used to remake the libraries. The default<br />

behavior is to build peripheral libraries for all supported target processors;<br />

however,<br />

you may select a particular processor to build by naming it on the command<br />

line. For<br />

example:<br />

makeplib.bat 30f6014<br />

or<br />

makeplib.bat 30F6014<br />

will rebuild the library for the dsPIC30F6014 device.<br />

3.3 EXTERNAL LCD FUNCTIONS<br />

This section contains a list of individual functions for interfacing with P-tec<br />

PCOG1602B<br />

LCD controller and an example of use of the functions in this section. Functions<br />

may<br />

be implemented as macros.<br />

The external LCD functions are only supported for the following devices:<br />

• dsPIC30F5011<br />

• dsPIC30F5013<br />

• dsPIC30F6010<br />

• dsPIC30F6011<br />

• dsPIC30F6012<br />

• dsPIC30F6013<br />

• dsPIC30F6014<br />

dsPIC Peripheral Libraries<br />

2004 Microchip Technology Inc. DS51456B-page 75<br />

3.3.1 Individual Functions<br />

BusyXLCD<br />

Description: This function checks for the busy flag of the P-tec PCOG1602B<br />

LCD<br />

controller.<br />

Include: xlcd.h<br />

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

SEG1_50_SEG51_100<br />

SEG1_50_SEG100_51<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 />

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

Ghi chú: Chức năng này cấu hình các chân I / O dùng để điều khiển P-tec<br />

PCOG1602B LCD điều khiển. Nó cũng khởi tạo controller.The LCD<br />

I / O pin định nghĩa đó phải được thực hiện để đảm bảo rằng màn hình LCD bê<br />

ngoài<br />

hoạt động chính xác là:<br />

dsPIC<br />

®<br />

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

DS51456B trang 76<br />

Điều khiển I / O pin định nghĩa<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 />

nơi XIS các PORT,? là số pin<br />

Pin định nghĩa dữ liệu<br />

DATA_PIN_? PORTxbits.RD?<br />

2004 Microchip Technology Inc<br />

TRIS_DATA_PIN_? TRISxbits.TRISD?<br />

nơi XIS các PORT,? là số pin<br />

Các chân dữ liệu có thể từ một trong hai cảng hoặc từ nhiều cổng.<br />

Các chân điều khiển có thể được trên bất kỳ cổng và không phải để được vào<br />

cùng một cổng. Giao diện dữ liệu phải được xác định là 4-bit hoặc 8-bit.<br />

Giao diện 8-bit được định nghĩa khi một<br />

# xác định EIGHT_BIT_INTERFACE được bao gồm trong các tập tin tiêu đề<br />

xlcd.h. Nếu không xác định được bao gồm, thenthe giao diện 4-bit được bao<br />

gồm.<br />

Sau khi các định nghĩa này đã được thực hiện, người dùng phải biên dịch<br />

mã ứng dụng vào một đối tượng được liên kết.<br />

Chức năng này cũng đòi hỏi phải có ba thói quen bên ngoài cho sự chậm trễ cụ<br />

thể:<br />

DelayFor18TCY () 18 Tcy chậm trễ

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

Saved successfully!

Ooh no, something went wrong!