• slider image 442
  • slider image 492
  • slider image 493
  • slider image 494
  • slider image 495
  • slider image 496
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#10
中級會員
中級會員


查看用戶資訊
顯示中文有解決 感恩~~
只要
movlw H'BC'
CALL LCD_Put_Char
movlw H'42'
CALL LCD_Put_Char
即可
之前想太難了.....

發表於: 2009/8/20 1:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#9
中級會員
中級會員


查看用戶資訊
那請問 當使用中文字型時需要丟兩個byte到PORTB(輸出DB0~DB7)
我該怎麼寫?因為18f452 PORTB 才1個BYTE大小
假設我要寫一個big5的 劉=H'BC42'
EX:
movlw H'BC'
CALL LCD_Put_Char

它顯示的結果是BCBC的值 我的42該怎麼丟?

發表於: 2009/8/19 22:04
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#8
版主
版主


查看用戶資訊
參照:

Beee 寫道:
請教板主:
    
於上列程式中 config 設定 XINST ON or OFF  均會出現 ERROR
但於 P18F2520
.INC 有 如下列表 :

;   
Extended Instruction Set Enable bit:
;     
XINST OFF          Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
;     
XINST ON           Instruction set extension and Indexed Addressing mode enabled

請問 
:
  
1.  XINST  如何設定 ?
  
2.  WHAT IS  (Legacy mode) ?

 
敬請不吝指教 ,  謝謝 !


PIC18 有新舊兩種架構,像 PIC18F452 就是屬於舊架構,而有 4 尾碼(PIC18F4520)的及 J 系列 (PIC18F45J20) 是屬於改良版的架構主要是多了一些針對 C 效率所加的指令,Microchip 並沒有正式公佈這些新增的指令,他會被使用在正式版的C18 編譯器裡。
所以 C18 的評估版在過期以後也不在使用這些新的指令,所以就會看不懂這個宣告。

Legacy mode 就把他翻成繼承模式,就是支援以前的模式。

發表於: 2009/8/18 16:41
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#7
資深會員
資深會員


查看用戶資訊
對比亮度 皆是硬體問題 再 check 有無動到旋紐

  寫程式之前 
要先學會看別人程式分析程式.....

程式重點--- 如沒碰到 00 則會一直傳遞下去 那三行 db 會一次顯示是因為只有第三行末端有加 00

  如想分開顯示 
則需在每行末端加 00

  在 ascii 內  0x0a  
,  0x0d  是控制碼 換行 回車<回到開頭> ),   0x00 就是 字串結尾

  
[color=990000]16進位的 0  與 10進位的0 都一樣 
  SO    0X00    
==   0[/color]

發表於: 2009/8/18 7:14
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#6
中級會員
中級會員


查看用戶資訊
而w400的範例 也可成功顯示
可是為何亮度會變暗呢?以原本的方式是正常的亮度
對比調整已最亮!
String_1 db " Microchip Technology Taiwan ; Workshop 400",0x0a,0x0d,0x00
以及0x0a,0x0d,0x00方別為什麼意思?

發表於: 2009/8/18 1:10
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#5
中級會員
中級會員


查看用戶資訊
感謝你 成功顯示
不過 是否可選擇DB的哪一行
目前顯示畫面是DB三行皆顯示

發表於: 2009/8/18 1:05
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#4
資深會員
資深會員


查看用戶資訊
請教板主:
    
於上列程式中 config 設定 XINST ON or OFF  均會出現 ERROR
但於 P18F2520
.INC 有 如下列表 :

;   
Extended Instruction Set Enable bit:
;     
XINST OFF          Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
;     
XINST ON           Instruction set extension and Indexed Addressing mode enabled

請問 
:
  
1.  XINST  如何設定 ?
  
2.  WHAT IS  (Legacy mode) ?

 
敬請不吝指教 ,  謝謝 !

發表於: 2009/8/17 17:20
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#3
版主
版主


查看用戶資訊
pic18F 使用組語設定字串方法一般還是用 "db" 的需指令來設定,就如樓上的網友Beee 所講的方式。

建議你再看一下"102 ASP (W400) 講義暨實作教材 " 裡的最後一個章節及練習五的範例。
http://www.microchip.com.tw/modules/w ... nglefile.php?cid=4&lid=25

發表於: 2009/8/17 14:42
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於pic18 組語在lcd如何撰寫一字串 ??
#2
資深會員
資深會員


查看用戶資訊
LIST P=18F2520        ;directive to define processor
    
#include <P18F2520.INC>    ;processor specific variable definitions
  
CONFIG    OSC INTIO7 
    CONFIG    FCMEN 
OFF
    CONFIG    PWRT 
ON
    CONFIG    IESO 
OFF
    CONFIG    BOREN 
OFF
    CONFIG    BORV 
3
    CONFIG    WDT 
OFF
    CONFIG    MCLRE 
OFF
    CONFIG    PBADEN 
OFF
    CONFIG    STVREN 
OFF
    CONFIG    LVP 
OFF
;    CONFIG    XINST 0N
    CONFIG    DEBUG 
OFF
    CONFIG    CPB 
ON
    CONFIG    CPD 
OFF
    CONFIG    WRT0 
OFF WRT1 OFF WRT2 OFF WRT3 OFF
TEXT_TO_SHOW    EQU        0X20
    ORG    0
    NOP
    
GOTO     _INIT
_INIT
:
    
MOVLW     UPPER   READ_TEXT    Load TBLPTR with the base
    MOVWF     TBLPTRU         
address of the word
    MOVLW     HIGH   READ_TEXT
    MOVWF     TBLPTRH
    MOVLW     LOW   READ_TEXT
    MOVWF     TBLPTRL
    MOVLW    0X80
    MOVWF    EECON1
READ_WORD
    NOP
    TBLRD
*+                 ; read into TABLAT and increment
    MOVF     TABLAT
W         get data
    BTFSC        STATUS 
2    ;  IS  ZERO ?
    
BRA        DOWN            ;  Yes  Then  Goto  Down 
    MOVWF     TEXT_TO_SHOW
    BRA        READ_WORD
DOWN
:
    
BRA        $


    
ORG    0X100
READ_TEXT
:
    
DB    "ABCDEFGH"
    
DB    "This is a BOOK." 
    
DB    "This is a pen." 0

    END

 
;  我也是 18F  的 初學者 希望此例 可供你參考  .......      ︿( ̄︶ ̄)︿

Attach file:


Link only for registered users

發表於: 2009/8/17 0:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於pic18 組語在lcd如何撰寫一字串 ??
#1
中級會員
中級會員


查看用戶資訊
我翻了幾本書看不太懂
目前的使用方式是直接丟入lcd_cmd
EX:
MOVLW 'Y'
CALL LCD_Put_Char
MOVLW 'E'
CALL LCD_Put_Char
MOVLW 'S'
CALL LCD_Put_Char

我想請問我該如何不用一個字一個一個丟
而是一整串作執行?

麻煩各位大大了~

補充一個問題:
我需要的字串放入暫存器中 我可否在下字串指令後
直接讀取暫存器做讀取並丟入lcd作顯示?

發表於: 2009/8/15 21:30

Edited by small20310 on 2009年08月15日 22:44:25
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... ]

教育訓練中心

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