新會員
Joined
: 2005/9/8 23:28 最後登入時間
: 2005/9/8 23:30
Group:
註冊會員
Level : 1 HP : 0 / 0 MP : 0 / 0 EXP : 0
|
各位好,先說聲抱歉,我對PIC這顆微處理器一點都不懂, 但是客戶問了一個問題必須馬上回覆,所以希望各位大哥能 能撥冗幫我解答一下,感謝你們!! 使用的IC是:PIC16F73,使用4 bit方式傳輸 LCM是16x2的Module,Controller是相容於HD44780的IC, 問題如下: 當想要顯示的字元後4bit都為0時,此字元的下一個字元都會 顯示錯誤,例如: input 0x20, 0x46 → output 0x20, 0xf4 input 0x20, 0x53 → output 0x20, 0xf5 input 0x20, 0x46, 0x53 → output 0x20, 0xf5, 0x53 input 0x40, 0x41, 0x31 → output 0x40, 0xf4, 0x31 input 0x50, 0x51, 0x21 → output 0x50, 0xf5, 0x21
程式如下: Main loop:
start call init_proc ; initialise the processor bcf status,RBSEL ; select Register Bank 0 call init_timer ; initialise the timer ; call init_eeprom ; initialise the eeprom interface call dsp_init ; initialise the display bsf intcon,gie ; enable global interrupts ; call sign_on ; display sign on message on both displays
; call dsp_team ; initial display on line 2
mainlp ; tstf rxcmnd ; if a command is not ready to process then don't do it
; call proc_buf ; process the recieve buffer call do_states ; process the main state machine ; call update_done ; call update_mins ; update the time display ; call update_secs ; tstf notdone ; test to see if all teams have succeeded
; bz timeuplp ; if they have then stop and freeze display
; movfw secs ; have we timed out? ; iorwf mins,W ; W != 0 if we haven't ; bnz mainlp ; so keep looping ; movlw 100 ; **** test line **** ; movwf dlyval ; **** test line **** ; call delay ; **** test line **** movlw ' ' ; send sign on message to both chips call dsp_chr movlw 'S' ; send sign on message to both chips call dsp_chr movlw 'F' ; send sign on message to both chips call dsp_chr movlw '@' ; send sign on message to both chips call dsp_chr movlw 'A' ; send sign on message to both chips call dsp_chr movlw '1' ; send sign on message to both chips call dsp_chr movlw 'P' ; send sign on message to both chips call dsp_chr movlw 'Q' ; send sign on message to both chips call dsp_chr movlw '!' ; send sign on message to both chips call dsp_chr ; goto mainlp ; so keep looping ; call update_mins ; update the time display ; call update_secs ; call dsp_boom ; else display time up message timeuplp goto timeuplp ; and finish
感謝各位大哥,因我從未接觸過PIC,不好意思佔用你們的時 間,謝謝!!
發表於: 2005/9/9 0:05
|