Re: 請問 UART printf 使用問題!
|
||||
---|---|---|---|---|
新會員
|
浮點,有的喔,至於符不符合IEEE,我就不太清楚了,
因為 Keil 的 C 註解有底下這一行, f float Floating-point number formatted as « - »dddd.dddd.
發表於: 2008/10/27 17:10
|
|||
|
Re: 請問 UART printf 使用問題!
|
||||
---|---|---|---|---|
版主
|
Silicon lab 的 C compiler 是屬於 8051 base 的,其 printf( ) 有支援到浮點的格式嗎? C30 的 printf( ) 是有支援IEEE浮點數的格式的,所以編譯過後的函數碼不小,所以在30F2010 會不建議使用 print( ) 的函數。
發表於: 2008/10/27 9:07
|
|||
|
Re: 請問 UART printf 使用問題!
|
||||
---|---|---|---|---|
版主
|
使用 30F2010 因 Program 較小所以不很建議使用 printf( ) 來送出 UART 的資料,除非你有要做浮點數的列印,此外使用 printf( ) 時因為很使用到較多的 RAM Buffer 所以在 Linker 時要加設 Heap = 64 Bytes.
你可以比比看,多了 printf( ) 程式會大多少K?
發表於: 2008/10/24 14:39
|
|||
|
請問 UART printf 使用問題!
|
||||
---|---|---|---|---|
新會員
|
各位大大,
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
|
|||
|