PIC Vietnam

Go Back   PIC Vietnam > Microchip PIC > Các ngôn ngữ lập trình khác (CCS C, HT PIC,...)

Tài trợ cho PIC Vietnam
Trang chủ Đăng Kí Hỏi/Ðáp Thành Viên Lịch Bài Trong Ngày Vi điều khiển

 
 
Ðiều Chỉnh Xếp Bài
Prev Previous Post   Next Post Next
Old 20-07-2009, 12:36 PM   #1
dtdat1909
Đệ tử 1 túi
 
Tham gia ngày: Jun 2007
Bài gửi: 11
:
Question Hoi ve Driver LCD 4 bit trong CCS???

Khi tôi sử dụng các hàm trong file LCD.C như lcd_init();, lcd_putc.. thì tất cả các port khác của con pic6f877a không hoạt động.
mặc dù trong protues tôi mô phỏng vẫn ok.
Có ai biết về vấn đề này xin giúp dùm.thanks.
Mình đang dùng CCS C version 4.068

Đây là đoạn code:
Với chân D0 enable, D1 RS, D2 RW, D4-D7 LCD4-LCD7

Code:
#include "C:\Program Files\PICC\Projects\dandb.h"
#include <lcd.c>
//#define use_portb_lcd false
void main()
{
   
   
   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
  set_tris_b(0x00);
  lcd_init();
   
   // TODO: USER CODE!!
   while(true)
   {
   lcd_putc("welcome");
   output_b(0xff);
   delay_ms(500);
   output_b(0x00);
   delay_ms(500);
   }
}

thay đổi nội dung bởi: namqn, 20-07-2009 lúc 01:26 PM. Lý do: định dạng code
dtdat1909 vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
 


Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt

Chuyển đến


Múi giờ GMT. Hiện tại là 09:36 PM.


Được sáng lập bởi Đoàn Hiệp
Powered by vBulletin®
Page copy protected against web site content infringement by Copyscape
Copyright © PIC Vietnam