• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: APP001 REV.2 的 LCD 顯示問題
#3
管理員
管理員


查看用戶資訊
因為用來控制 LCD E 腳的 RA2 在 Power-On 時的預設模式是 AD Input . 所以要將 ADCON1 做適當的設定 , 讓 RA2 變成
Digital I/O. 當然, 要將 RA2 設成 Output 喔 !

我想只是因為 RA2 的關係吧 !

祝您順利成功 

發表於: 2005/4/5 22:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: APP001 REV.2 的 LCD 顯示問題
#2
高級會員
高級會員


查看用戶資訊
建議你先用範例程式裡的驅動試試看~~~

發表於: 2005/4/5 20:22
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


APP001 REV.2 的 LCD 顯示問題
#1
新會員
新會員


查看用戶資訊
大家好, 由於 APP001 REV.2 的 LCD module 為:
LCD E => PORTAbits.RA2
LCD R/W => PORTDbits.RD5
LCD RS => PORTDbits.RD4
LCD DATA => RD4 .. RD7 as LCD Data
可是我在 dubug OK 之後, 卻不會顯示想要之結果!
可否告訴我, 是哪裡的問題阿? 謝謝~~

*************************************

#include <p18f452.h>
#include <delays.h>
#include "p18LCD.h"
#define LCD_DATA PORTD
#define LCD_CMD PORTD

void InitializePORT(void);
void OpenLCD (void) ;

unsigned char TAB2[]="yang";

void main (void)
{
InitializePORT();
OpenLCD();
LCD_Set_Cursor(0,0);
putcLCD(TAB2);
}

void InitializePORT(void)
{
TRISD=0;
PORTD=0x00;
}

*************************************
void OpenLCD(void)

{
LCD_CTRL = LCD_CTRL & 0b11001111 ;
// Set LCD E,R/W,RS to Low
LCD_DATA = LCD_DATA & 0b11110000 ;
// LCD DB[4:7] to Low
DIR_LCD_CTRL &= 0b11001111 ;
// E,R/,RS are Output pin
DIR_LCD_DATA &= 0b11110000 ;
// LCD DB[4:7} are output

LCD_DATA = 0b00000011 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;

LCD_DATA = 0b00000011 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;

LCD_DATA = 0b00000011 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;

LCD_DATA = 0b00000010 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;

WriteCmdLCD(DISP_2Line_4Bit) ;
LCD_S_Delay() ;

WriteCmdLCD(DISP_ON) ;
LCD_S_Delay() ;

WriteCmdLCD(ENTRY_INC) ;
LCD_S_Delay() ;

WriteCmdLCD(CLR_DISP) ;
LCD_L_Delay() ;
}

void LCD_Set_Cursor(unsigned char CurY, unsigned char CurX)
{
WriteCmdLCD( 0x80 + CurY * 0x40 + CurX) ;
LCD_S_Delay() ;
}

void WriteCmdLCD( unsigned char LCD_CMD)
{
Temp_CMD = (LCD_CMD & 0xF0)>>4 ;
// Send high nibble to LCD bus
LCD_DATA= (LCD_DATA & 0xF0)|Temp_CMD ;
LCD_CMD_W_Timing () ;

Temp_CMD = LCD_CMD & 0x0F ;
// Send low nibble to LCD bus
LCD_DATA= (LCD_DATA & 0xF0)|Temp_CMD ;
LCD_CMD_W_Timing () ;
LCD_S_Delay() ;
// Delay 100uS for execution
}

void WriteDataLCD( unsigned char LCD_CMD)
{

Temp_CMD = (LCD_CMD & 0xF0)>>4 ;
// Send high nibble to LCD bus
LCD_DATA= (LCD_DATA & 0xF0)|Temp_CMD ;
LCD_DAT_W_Timing () ;

Temp_CMD = LCD_CMD & 0x0F ;
// Send low nibble to LCD bus
LCD_DATA= (LCD_DATA & 0xF0)|Temp_CMD ;
LCD_DAT_W_Timing () ;

LCD_S_Delay() ;
// Delay 100uS for execution
}

void putcLCD(unsigned char LCD_Char)
{
WriteDataLCD(LCD_Char) ;

}

void LCD_L_Delay(void)
{
Delay10KTCYx(CPU_SPEED / 2) ;
}


發表於: 2005/4/5 16:51
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... ]

教育訓練中心

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