• 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: 請問 UART printf 使用問題!
#5
新會員
新會員


查看用戶資訊
浮點,有的喔,至於符不符合IEEE,我就不太清楚了,
因為 Keil 的 C 註解有底下這一行,
f float Floating-point number formatted as
« - »dddd.dddd.

發表於: 2008/10/27 17:10
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問 UART printf 使用問題!
#4
版主
版主


查看用戶資訊
Silicon lab 的 C compiler 是屬於 8051 base 的,其 printf( ) 有支援到浮點的格式嗎? C30 的 printf( ) 是有支援IEEE浮點數的格式的,所以編譯過後的函數碼不小,所以在30F2010 會不建議使用 print( ) 的函數。

發表於: 2008/10/27 9:07
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問 UART printf 使用問題!
#3
新會員
新會員


查看用戶資訊
Ryang大大,
project -> Build Options -> Project -> MPLAB LINK30
裡面,我設定了 64 Bytes ,也是一樣的錯誤訊息,
試著加大或減小,仍無法消除錯誤, =_=

使用 printf ,我在 silicon lab 的 mcu 上,約莫增加 1KB 多,
好處是輸出格式很容易設定,
如果真的還是沒辦法使用,看起來,
就只能多花費點心思在uart 提供的 func.上面了.
感謝大大的協助. ^_^

發表於: 2008/10/24 17:24
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問 UART printf 使用問題!
#2
版主
版主


查看用戶資訊
使用 30F2010 因 Program 較小所以不很建議使用 printf( ) 來送出 UART 的資料,除非你有要做浮點數的列印,此外使用 printf( ) 時因為很使用到較多的 RAM Buffer 所以在 Linker 時要加設 Heap = 64 Bytes.

你可以比比看,多了 printf( ) 程式會大多少K?

發表於: 2008/10/24 14:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問 UART printf 使用問題!
#1
新會員
新會員


查看用戶資訊
各位大大,
UART使用 printf 傳送資料至電腦,編譯時卻發生以下錯誤訊息,

Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F2010 -c -x c "port_IO.c" -o"port_IO.o" -g
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -Wl,"C:\desktop\ICD2test\port_IO.o",-L"C:\Program Files\Microchip\MPLAB C30\lib",--script="C:\desktop\ICD2test\p30f2010.gld",-o"Port_IO.cof",-Map="Port_IO.map"
c:\program files\microchip\mplab c30\bin\bin\pic30-coff-ld.exe: Link Error: region program is full (Port_IO.cof section .text)
C:\desktop\ICD2test\port_IO.o: Link Error: Could not allocate section .const, size = 18 PC units, attributes = psv
data_init: Link Error: Could not allocate section .dinit, size = 314 PC units, attributes = code
C:\desktop\ICD2test\port_IO.o: Link Error: Could not allocate section .text, size = 220 PC units, attributes = code
default_isr: Link Error: Could not allocate section .isr, size = 2 PC units, attributes = code
Link Error: Could not allocate program memory
BUILD FAILED

於是編譯失敗,改用 putsUART1 ,可以正常編譯,而且執行,
dsPIC30F2010
MPLAB IDE V7.50
C30 使用 microchip 下載的版本,
程式裡有include以下標頭,
#include <p30F2010.h>
#include <uart.h
#include <stdio.h>
stdio.h 是從 C30裡 copy 過來,
現在頭很大,因為寫 printf貫了,不大會使用 putsUART1,
還請各位大大協助幫忙! 謝謝.

發表於: 2008/10/24 13:55
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... ]

教育訓練中心

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