PDA

View Full Version : Amicus18 Baudrates



JKaiser
- 11th December 2014, 17:38
Could someone please help me get the baud-rates correct for 9600. I have been using the following defines for 115200 and works great.



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

Demon
- 11th December 2014, 20:17
http://www.picbasic.co.uk/forum/showthread.php?t=11751&p=78308#post78308

Download and try this utility.

Robert

JKaiser
- 11th December 2014, 21:34
Robert, Thanks Again



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%