Re: 新手發問--- MPLAB SIM
|
||||
---|---|---|---|---|
版主
|
printf 應是一樣的,差異在 18F452 與 18F87J50 的 UART 的設計是不全然一樣,87J50 是 EUSART 的設計。所以初始的設定會有不同。
發表於: 2008/6/13 14:24
|
|||
|
Re: 新手發問--- MPLAB SIM
|
||||
---|---|---|---|---|
新會員
|
多謝版主回覆,回覆很快阿...
加入InitialUSART及使用putsUSART後測試OK 為何我使用18F87J50不能如18F452這樣直接使用printf()?
發表於: 2008/6/13 11:06
|
|||
|
Re: 新手發問--- MPLAB SIM
|
||||
---|---|---|---|---|
版主
|
printf 基本上是送到 UART1 , 所以你還要對 UART1 作初始設定。其設定範例可以參考 W401 C18 教材裡的第五章。
發表於: 2008/6/13 10:10
|
|||
|
新手發問--- MPLAB SIM
|
||||
---|---|---|---|---|
新會員
|
同樣一段source code
#include <stdio.h> #pragma config WDT = OFF // for PIC18F452 #pragma config WDTEN = OFF // for PIC18F87J50 void main (void) { printf ("Hello World\n"); while (1); } 使用MPLAB SIM 透過UART1去顯示此字串 在PIC18F452測試OK 在PIC18F87J50 compiler也都成功,但是UART1就是不會顯示 我有對應不同的device使用不同的*.lkr
發表於: 2008/6/13 9:44
|
|||
|