Re: dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
資深會員
|
我都這樣做
const rom unsigned char LCMAddrY[]={0x80,0xc0,0x94,0xd4}; ty=LCMAddrY[CurY]; WriteCmdLCD( ty+ CurX);
發表於: 2009/5/4 18:48
|
|||
|
Re: dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
版主
|
因為每一行有不同的起始位址再加 0x80 :
第一行 : 0x00 ->0x80 第二行 : 0x40 ->0xc0 第三行 : 0x14 ->0x94 第四行 : 0x54 ->0xd4
發表於: 2009/4/29 16:21
|
|||
|
Re: dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
初級會員
|
順便問一下...
為甚麼1604上用不了?_? 第三和第四行不能顯示... 但都是用HD44780的....
發表於: 2009/4/28 21:51
|
|||
|
Re: dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
版主
|
程式不可只看上半部,有呼叫函數也要進去看一下。LCD 在 Initialiaztion 時有呼叫 LCD_CMD_W_Timing( ) ,函數內就有設定 LCD 的 RS & R/W 的動作。
//***********************************************
發表於: 2009/4/17 10:44
|
|||
|
Re: dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
新會員
|
大大, 我修改部份是LCD初始化的, 原來C30教程那個代碼裏有注明要在初始化的部分將RS, R/W設成"low", 但代碼裏沒有做到。
所以我有點疑惑, 你可以發過正確的LCD代碼讓我看看嗎?
發表於: 2009/4/16 17:07
|
|||
|
Re: dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
版主
|
RS & RW 的動作是在 Write 的函數中動作的,尤其是RS一定要驅動的,不然LCM 惠不知是DATA 還是 Command ?
發表於: 2009/4/16 15:50
|
|||
|
Re: dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
新會員
|
多謝大大, 我昨天查看了一下那個LCD代碼, 發現好像寫少了一些部份。
原來的代碼裏 (C30_EVM_LCD.c): void OpenLCD(void) { Temp_LCD_DATA = LCD_DATA ; // Save the Port Value of LCD_DATA LCD_E_MODE =1 ; // Initialize RB7 as digital I/O LCD_E = 0 ; // RS & R/W --> Low LCD_DATA &= 0xfff0; // LCD DB[4:7] & RS & R/W --> Low (PORTD[0:3] as LCD DB[4:7]) DIR_LCD_DATA &= 0xfff0; // LCD DB[4:7} & RS & R/W are output function (PORTD[0:3] as LCD DB[4:7]) DIR_LCD_E = 0; // Set E pin as output DIR_LCD_RS = 0 ; DIR_LCD_RW = 0 ; ... } 其中 LCD DB[4:7] & RS & R/W --> Low (PORTD[0:3] as LCD DB[4:7])的部份, RS跟R/W好像沒有處理, 只見E跟LCD DB[4:7] 有做過處理。 我在LCD_E=0之後加入了以下代碼: LCD_RS = 0; // Code missing LCD_RW = 0; // Code missing 這樣改對嗎? 還有, 我找了一個LCD, 它說是跟HD44780相容的, 可以給我看一下能用嗎? http://www.maplin.co.uk/Media/PDFs/N25AZ.pdf 它的接腳跟HD44780標準好像都一樣, 但有兩個PIN叫"A"跟"K"的, 要怎麼連呢?
發表於: 2009/4/16 15:02
|
|||
|
Re: dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
版主
|
相容於 HD44780 的標準 LCD Module. 需注意的是LCD Module 的接腳會因廠牌而異,接腳不同。
HD780 規格上網一查就有。
發表於: 2009/4/16 10:11
|
|||
|
dsPIC跟LCD問題?
|
||||
---|---|---|---|---|
新會員
|
我想問一下, C30 modules 教程中那個"dsPIC30F4011-30I/P"的"APP020 EVM Board"是用哪一蕊片的LCD?
我想重用一下它的代碼。
發表於: 2009/4/16 0:48
|
|||
|