|
UARTのキャラクタ化けに関し、解決しました。
CCS Support からのメールのポイントは・・
The PIC18F26J50 is a USB chip and it's oscillator configuration is different than the PIC18F2620.
The frequencies that can be used are 4, 8, 12, 16, 20, 24, 40 and 48 MHz.
For USB chips the input frequency to the PLL needs to be 4MHz,
When using the PLL , there is only 4 frequencies that can be used for the system clock,
they are 8, 16, 24 and 48MHz.
the PIC18F26J50 it requires that the PLL be enabled with the setup_oscillator(); function
For USB chips the input frequency to the PLL needs to be 4MHz,
so if your external clock frequency is 4MHz the fuse is PLL1,
if it is 8MHz the fuse is PLL2,
if it is 12MHz the fuses is PLL3, etc.
The NOCPUDIV fuse sets the system clock to use.
The fuse NOCPUDIV is used for a system clock of 48MHz,
CPUDIV2 is used for a system clock of 24MHz,
CPUDIV3 is used for a system clock of 16,
and CPUDIV6 is used for a system clock of 8MHz.
・・でした。
PICのUSBチップは、4MHzを基準に動作しているので、XTAL周波数は、決まっている。
(Microchipのマニュアルを読むと、詳しく書いている・・・)
PIC18F2620の様に、PLLは、単に4倍するとして動作させてしまった。・・お粗末・・
尚、PIC18F26J50チップは、UARTが ハードで2ポート持っているので、UART1,UART2としStreamを使うと、
各々の受信割り込みが使え、高速・快適・・・・まあ 良いチップかな・・
以上、USB chip(PIC18F26J50・・)のマニュアルを充分読まなかった原因。
CCS Supportには、 申し訳なかったかな 〜。
|