i suspect a asm math overflow, but can't reproduce it here... and... HSER_BAUD is not define so... i'm lost 
Even worst.. if does the same thing even by writing to the USART register ???
what happen if you use only the CONFIG fuse, DEFINE OSC AND HSER DEFINEs?
edit: OK only by writing to the REGISTER, you'll have this error once you add a HSEROUT line, but it fix the problem when you use the DEFINEs as generated by the PicMulticalc as bellow
Code:
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
DEFINE HSER_SPBRG 56 ' 38400 Baud @ 48MHz, -0.16%
SPBRGH = 1
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator
So the DEFINEs have to be there IF you're using HSEROUT/HSERIN... just because PBP try to load HSER_SPBRG and everything else
simple code
Code:
DEFINE OSC 48
RCSTA = $90 ' Enable serial port & continuous receive
TXSTA = $24 ' Enable transmit, BRGH = 1
SPBRG = 56 ' 38400 Baud @ 48MHz, -0.16%
SPBRGH = 1
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator
HSEROUT ["HELLO"]
and it's .LST around warning 202
Code:
Warning[202]: Argument out of range. Least significant bits used.
000018 0E38 07668 movlw HSER_SPBRG
00001A 6EAF 07669 movwf SPBRG ; Set baud rate generator reg
07670 ifdef HSER_SPBRGH
07671 ifdef SPBRGH
07672 movlw HSER_SPBRGH
07673 movwf SPBRGH ; Set baud rate generator reg high
07674 endif
07675 endif
00001C 0E20 07676 movlw HSER_TXSTA
00001E 6EAC 07677 movwf TXSTA ; Set transmit control reg
000020 0E90 07678 movlw HSER_RCSTA
000022 6EAB 07679 movwf RCSTA ; Set receive control reg
INTERESTING !!!! HSER_SPBRGH is not even listed in the new PBP manual!!!
Bookmarks