-
Amicus18 Baudrates
Could someone please help me get the baud-rates correct for 9600. I have been using the following defines for 115200 and works great.
Code:
DEFINE OSC 64
DEFINE LOADER_USED 1
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_CLROERR 1
DEFINE HSER_SPBRG 138
SPBRGH = 0
BAUDCON.3 = 1
I tried changing DEFINE HSER_SPBRG 138 to 1666 per the data sheet but does not seem to matter. Also tried changing HSER_TXSTA 24h to 20h.
John
-
Re: Amicus18 Baudrates
-
Re: Amicus18 Baudrates
Robert, Thanks Again
Code:
DEFINE OSC 64 ' Default oscillator speed on the AMICUS18 is 16*4MHz
DEFINE LOADER_USED 1 ' We're using a bootloader.
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 103 ' 9600 Baud @ 64MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
RCSTA = $90 ' Enable serial port & continuous receive
TXSTA = $20 ' Enable transmit, BRGH = 0
SPBRG = 103 ' 9600 Baud @ 64MHz, 0.16%