i remember correctly in my program that i set the baud rate anywhere. I am using CDCDESC.ASM for virtual com port.
I am using the orgional bootloader from Microchip.
i remember correctly in my program that i set the baud rate anywhere. I am using CDCDESC.ASM for virtual com port.
I am using the orgional bootloader from Microchip.
________________
KV
i am learning how to use Mister E piccal.
thanks Darrel.
________________
KV
That's the easy part.
Start the program
Click on EUSART calc
Enter 48 in the OSC field
Enter the baudrate in the appropriate place.
Click the "Copy PBP DEFINE's to clipboard" button
and paste them in your program.
If you don't set the HSER DEFINE's in your program. PBP defaults to 2400 baud.i remember correctly in my program that i set the baud rate anywhere.
If there is an HSEROUT or HSERIN anywhere in your program (even if it never gets executed), PBP will automatically initialize the USART at the default settings, which are too low for 48Mhz.
<br>
DT
Thanks Darrel.
I searched through my program, there is a "Hserout" command, I commented it out and there is no further warning.
I did copy
when compiled, i got warning message "error[113] \pbp\pbpic18.lib 580 : symbol not previously define(baudctl)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 46 ' 256000 Baud @ 48MHz, -0.27% SPBRGH = 0 BAUDCTL.3 = 1 ' Enable 16 bit baudrate generator
But anyway I don't need the those DEFINE lines above so I just commented out, and there is no warning. The program when loaded to the pic work fine.
________________
KV
I use USB on board of the pic for transmitting/receiving data.
________________
KV
There are 2 possible places for the BRG16 bit.
BAUDCON.3
- or -
BAUDCTL.3
It depends on the chip. And for a 4550 it's BAUDCON.3
mister_e's calculator has a drop-down box for that.
But you have to know which one to use.
But like you said, it's fixed.
<br>
DT
indeed, substitue BAUDCTL.3 = 1 with BAUDCON.3 = 1, when compile produced no error.
________________
KV
Bookmarks