• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users




« 1 (2)


Re: 有沒有人也是用CC5X 的ㄚ
#11
初級會員
初級會員


查看用戶資訊
您好:謝謝回應
我的LCD副程式參考手冊使用4BITS控制,全部自己重新寫的,最早使用組合語言,可以讀取LCD游標位置、字元、翻頁、方向鍵與刪除鍵等功能
後來為了能夠快速轉到其他型號IC,因此才會使用CCS最先
使用16F877開發也成功可以運作,可是目前轉到使用16F873,程式一步步除錯以後才發現後面這段程式傳回值似乎有問題
還是我的程式盲點?畢竟控制資料埠不一樣

原先使用16F877 使用D0~D3控制線
因此要讀回忙碌旗標或游標位址時的作法
void lcd_nibble(){
output_low(LCD_RS);
output_high(LCD_RW);
output_high(LCD_E);
delay_us(1);
output_low(LCD_E);
}
.....主程式略
char lcd_cursor_read() {
char high_byte,low_byte;
lcd_nibble();
high_byte=input_d() & 0x0F; //讀取第一筆資料
delay_cycles(5);
lcd_nibble();
low_byte=input_d() & 0x0F; //讀取第二筆資料
return( (high_byte << 4) | low_byte);
}
改用16F873 使用C2~C5控制線
因此要讀回忙碌旗標或游標位址時的作法

.....副程式同以上

.....主程式略

char lcd_cursor_read() {
char high_byte,low_byte;
lcd_nibble();
high_byte=input_c() & 0b00111100; //讀取第一筆資料
delay_cycles(5);
lcd_nibble();
low_byte=input_d() & 0b00111100; //讀取第二筆資料
return( (high_byte << 2) | low_byte >>2);
}


發表於: 2004/7/2 14:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有沒有人也是用CC5X 的ㄚ
#12
初級會員
初級會員


查看用戶資訊
16F873 使用C1~C4控制線
應該是以下寫法

char lcd_cursor_read() {
char high_byte,low_byte;
lcd_nibble();
high_byte=input_c() & 0b00011110; //讀取第一筆資料
delay_cycles(5);
lcd_nibble();
low_byte=input_d() & 0b00011110; //讀取第二筆資料
return( (high_byte << 3) | low_byte >>1);
}


發表於: 2004/7/2 16:49
其實pic沒什麼
如何應用才是挑戰
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有沒有人也是用CC5X 的ㄚ
#13
初級會員
初級會員


查看用戶資訊
抱歉打錯了 應該是 使用C2~C5控制線
謝謝指正

問題已經解決,因為RC DELAY的關係 硬體關係跟軟體無關 ^^


發表於: 2004/7/2 19:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------