I routinely run 115,200 on a PIC18F4620 at 20 MHz.
Works a treat. I always set char_pacing to 20 or more to give some more time for the receiving side to process the character.
HTH
BrianT
I routinely run 115,200 on a PIC18F4620 at 20 MHz.
Works a treat. I always set char_pacing to 20 or more to give some more time for the receiving side to process the character.
HTH
BrianT
As Al pointed out (but didn't really spell out) the 1000000 comes from Fosc/4 and since you're running at 20MHz the formula becomes (5000000/115200) - 20 = 23. I don't know if 115200 "should" work at 20MHz but if you can't get it going try DEBUG instead.The forumula they have in the maual is (1000000/baud)-20, which results in -11.
/Henrik.
Thanks for all the help. I understand fosc/4, but i am not sure Serout2 or serin2 uses that. I define the osc speed up top. I have to use 10000000 to get 19200 or 38400 to work with no issue. the debug may work for outgoing, but eventually i will need incoming... I am currently laying out another board with a 2 UART chip since hserin and hserout work fine at 115k and a 20mhz osc, but i would really prefer to use my existing chip.
-Charlie
OK, you're probably correct then, sounds a bit strange though.... Anyway, if DEBUG does indeed work for the output then DEBUGIN will most likely work for the input - as long as you don't need to change pin or baudrate at runtime.
/Henrik.
Debug is much more "light weight", since the parameters are calculated at compile time, not every time the routine is called.
It works fast in both directions.
Charles Linquist
Bookmarks