Do you intend to use the same crystal for both the PIC and the MCP2120? If not I can't see why you can't use 14.7456 for the MCP2120 and whatever for the PIC. With a 20Mhz crystal on the PIC you'll be off less than 1% at 115200 baud.
Do you intend to use the same crystal for both the PIC and the MCP2120? If not I can't see why you can't use 14.7456 for the MCP2120 and whatever for the PIC. With a 20Mhz crystal on the PIC you'll be off less than 1% at 115200 baud.
I made a mistake in indicating the device. I was referring to mcp2122 that does not have a clock. Fortunately I have both chips, so I think using the mcp2120 solve my problems.
But the problem remains if I decided to use the mcp2122 which requires only an external clock with oscillator ottenible of 14.7456MHz.
From what I understand you can not change oscillator and hope that everything keeps working?
You can change the PICs oscillator to whatever you want. Microchip gives formulas for calculating baud rates given any oscillator frequency. PBP will work as well. The only problem is that any routine that uses software timing routines will be off. If you use DEFINE OSC 10, and you are actually running at 14.7456 Mhz, then PAUSE 100 will actually be a PAUSE 68 (it will pause for 68 mSec). Likewise, the SERIN/SEROUT routines will be off by the 10/14.7456 ratio. If you use SERIN2/SEROUT2, you can simply use the formulas given in the PBP manual to choose the correct value. If you use HSERIN/HSEROUT, you simply set BRG and the associated registers according to Microchip's formulas. You won't be able to DEFINE HSER BAUD !
Everything will work - if you take into account the new frequency.
Charles Linquist
Bookmarks