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


Browsing this Thread:   1 Anonymous Users






Re: usart傳字串問題??
#10
新會員
新會員


查看用戶資訊
感謝各位的幫忙! 用超級終端收的結果看起來是沒有00(字串結束)了,繼續努力...

發表於: 2007/6/21 14:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: usart傳字串問題??
#9
高級會員
高級會員


查看用戶資訊
感謝tonys的提供,我已經看過了。是有提到Null也一併會被送出,不過在ANSI C中的[PUTS]或其他有關string的函式,應該都不會將NUll傳送出來吧?

發表於: 2007/6/21 13:11
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: usart傳字串問題??
#8
資深會員
資深會員


查看用戶資訊
MPLAB C18 Libraries 手冊有說:putrsUSART 會將字串後的結尾 0(null字元)一併傳出。
如不想要它,那就用 putcUSART 或 WriteUSART 一個一個字元送吧。

裝了 C18 後,MPLAB C18 各手冊就已在電腦裡的 C:\MCC18\doc\ 下了

他山之石: http://cboard.cprogramming.com/archive/index.php/t-57794.html

發表於: 2007/6/21 11:53
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: usart傳字串問題??
#7
高級會員
高級會員


查看用戶資訊
請用Windows附屬應用程式中的[超級終端機],試試看。請記得傳送鮑率、資料位元數,停止位元。也要一併設好。

發表於: 2007/6/21 10:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: usart傳字串問題??
#6
新會員
新會員


查看用戶資訊
我用的接收軟體是comdebug.exe會又設定上的問題嗎?還是有其他的軟體可以使用呀,請大大提供一下,謝謝!

發表於: 2007/6/21 10:32
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: usart傳字串問題??
#5
高級會員
高級會員


查看用戶資訊
[putrsUSART(msg);]應該是不會將[00]也送到UART去,它是拿來當成一個字串的結束。所以建議;請檢查一下,在PC這一端接收軟體的設定。

發表於: 2007/6/21 10:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: usart傳字串問題??
#4
新會員
新會員


查看用戶資訊
所以00(字串結束)是一定會有的嚕,還是有辦法可以讓它不要出現呀...

發表於: 2007/6/20 22:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: usart傳字串問題??
#3
高級會員
高級會員


查看用戶資訊
00 是字串結束符號..
宣告字串時..會在最後加入00,表示字串結束..

發表於: 2007/6/20 18:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: usart傳字串問題??
#2
高級會員
高級會員


查看用戶資訊
後面位元組(0x00)是用來說明字串到此結束~


發表於: 2007/6/20 18:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


usart傳字串問題??
#1
新會員
新會員


查看用戶資訊
我是用putrsUSART();傳字串,可是接收端每次收到時總是多一byte的資料,而且都是收到00,
例如l:我的程式寫法
const rom char msg[] = "ABC";
putrsUSART(msg);
但是我的接收端收到的卻是41 42 43 00,多出"00"
請教各位大大這是哪出了問題?

發表於: 2007/6/20 17:03
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... ]

教育訓練中心

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