I haven't go really deep in your code, but usually when you deal with HSERIN(2)/HSEROUT(2), you must use the DEFINEs instead of writing to the PIC registers, unless PBP will assume the default 2400 bauds.