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

論壇索引


Board index » All Posts (Ryang)




Re: 关于HT1621驱动LCD
版主
版主


這是將HD44780 initial to 4-bit mode的程式,不知是否與Holtek's HT1621是否有差別??

; LCD Module commands
DISP_ON EQU 0x00C ; Display on
DISP_ON_C EQU 0x00E ; Display on, Cursor on
DISP_ON_B EQU 0x00F ; Display on, Cursor on, Blink cursor
DISP_OFF EQU 0x008 ; Display off
CLR_DISP EQU 0x001 ; Clear the Display
ENTRY_INC EQU 0x006 ;
ENTRY_INC_S EQU 0x007 ;
ENTRY_DEC EQU 0x004 ;
ENTRY_DEC_S EQU 0x005 ;
DD_RAM_ADDR EQU 0x080 ; Least Significant 7-bit are for address
DD_RAM_UL EQU 0x080 ; Upper Left coner of the Display
;
;*******************************************************************
;* The LCD Module Subroutines *
;* Command sequence for 2 lines of 5x16 characters *
;*******************************************************************
InitLCD
BANKSEL TRISB
movlw 0xc0 ; Initialize inputs/outputs for LCD
movwf TRISB
BANKSEL LCD_DATA
clrf LCD_DATA ; Clear LCD data & control bits
;
movlw .50 ; Power=On delay 50mS
Call Delay_MS
;
movlw 0x02 ; Init for 4-bit interface
call Send_4bit
movlw .10 ; Delay 10 mS
Call Delay_MS
;
movlw b'00000011' ; Fully Initial LCD module
call Send_4bit ; Sent '0011' data 4 time
movlw .5 ; Delay 5mS
Call Delay_MS
movlw b'00000011'
call Send_4bit
call Delay_1MS ; Delay 1mS
movlw b'00000011'
call Send_4bit
movlw b'00000010'
call Send_4bit
;
movlw b'00101000' ; Set 2 lines & 5 x 7 dots
call SendCmd
movlw DISP_ON ; Turn display on (0x0C)
call SendCmd
movlw ENTRY_INC ; Configure cursor movement
call SendCmd
movlw DD_RAM_ADDR ; Set writes for display memory
call SendCmd
return
;
;*******************************************************************
;* SendCmd - Sends command to LCD *
;* This routine splits the command into the upper and lower *
;* nibbles and sends them to the LCD, upper nibble first. *
;*******************************************************************
SendCmd
banksel Byte
movwf Byte ; Save WREG in Byte variable
call Delay_1MS
swapf Byte,W ; Send upper nibble first
andlw 0x0f
movwf LCD_DATA
bcf LCD_CNTL,RS ; Clear for command
bsf LCD_CNTL,E ; Clock nibble into LCD
bcf LCD_CNTL,E
movf Byte,W ; Write lower nibble last
Send_4bit andlw 0x0f
movwf LCD_DATA
bcf LCD_CNTL,RS ; Clear for command
bsf LCD_CNTL,E ; Clock nibble into LCD
bcf LCD_CNTL,E
return
;

發表於: 2004/10/26 10:23
頂部


Re: 請問I/O port 的設定?
版主
版主


這種方式常見於將 I/O Port 使用於I2C的 Open Collector 的型態,記住不要忘了裝一個提升電阻因為轉輸入後Bus有可能會是Floating的。

還有事先先將"0"寫到PORT上,這樣在TRISx=0 時,PORT 才會輸出"0", TRISX=1時,提升電阻就會將輸出拉到Hi

發表於: 2004/10/26 10:13
頂部


Re: ICE2000動作怪怪的
版主
版主


請問一下你有沒有安裝ICE2000的驅動軟體,找找你的MPLAB IDE 安裝的目錄 "C:\Program Files\MPLAB IDE\DriversXP\Parallel" 將 DdinstXP.htm 打開看看如何安裝ICE2000的Driver。

Win2000 是放在Drivers2000的目錄
Win98 是放在Drivers98的目錄

發表於: 2004/10/26 10:05
頂部


Re: can bus
版主
版主


基本上如果使用Microchip's solution 需要的元件有:

1. 硬體 : PIC18F452 + MCP2551 (CAN transceiver)
2. 軟體 : MPLAB C18 + AN738 CAN Library 以上軟體都可以自網站www.microchip.com下載

更多訊息打電話到Microchip找何仁杰先生,它有整套的solution

發表於: 2004/10/26 9:55
頂部


Re: can bus
版主
版主


10/26 & 10/28 在Microchip 台北有CAN的workshop , 歡迎來聽。 Tel:02-2500-6610 找曾小姐

發表於: 2004/10/26 9:46
頂部


Re: 有關Linker....(PIC18FXX2)
版主
版主


組合語言有兩種寫法,一為不可以重新定位址的語法,二為需要使用LINKER排定位址的可重新定位址的語法。
如果是第一種就不需用 Linker Scripts file,如為第二種就要。

你的程式如果是用 ORG 定位址就屬第一種,如用 Code Section & Udata 定位址的就屬於第二種。

詳細請參考Workshop講義(MPASM one day workshop)

發表於: 2004/10/26 9:41
頂部


Re: 請問各位使用PIC的前輩,有遇過這樣的問題嗎?
版主
版主


羅技的Mouse我是不懂,但如果是用示波器量PC與Mouse的波形就應該可以看到雙方的通訊格式,你有比較過你所送出去的格式是否與PC送出的格式不一樣,不然羅技的Mouse怎會不理你呢?

發表於: 2004/10/25 11:29
頂部


Re: AD產生不同頻率輸出問題
版主
版主


duty on跟著變動, 但duty off 週期不變(與duty on比較 極窄) ??

這時候可不可以暫停一下(halt),看看 Duty & Period 的值分別是多少?



發表於: 2004/10/25 11:17
頂部


Re: 关于HT1621驱动LCD
版主
版主


PIC與HT1621是用8-bit還是4-bit interface ?
看起來有點像 Initial 4-bit mode時出現initial不完全的問題導致LCD有點錯亂。

發表於: 2004/10/24 12:02
頂部


Re: PIC16F818 如何連接到 ICD2
版主
版主


種供要街五支腳
Vcc, Gnd, MCLR/Vpp , PGC (Clock) , PGD (Data) 查一下Data Book的接腳,如不知 ICD2 接腳為何可參考 AP001 的線路圖再用電表找出GND pin就知道順序了。

AP001線路圖在"教育訓練"下載即可

發表於: 2004/10/24 11:54
頂部



« 1 ... 1584 1585 1586 (1587) 1588 1589 1590 ... 1610 »



:::

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... ]

教育訓練中心

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