PDA

View Full Version : Maximum DEBUG baud rate



BrianT
- 8th November 2010, 06:46
I can get reliable DEBUG communications at 19,200 bps with a 4 MHz crystal. To me that implies 57,600 bps should be possible with a 20 MHz crystal. Has anyone got experience of running DEBUG at 57600 bps?

DEFINE DEBUG_BAUD 57600 will compile but will it work reliably?

Any comments welcome.

Thanks
BrianT

ScaleRobotics
- 8th November 2010, 06:52
I have had reliable debug communication with 38,400 at 8 mhz internal osc, so it seems to me that 20 mhz and 57,600 should be even better.

circuitpro
- 8th November 2010, 16:11
Yep. I've got 18F2420's running 57600 @ 20MHz. I'm sure you can get 115200 also, but I didn't have the need.

flipper_md
- 9th November 2010, 01:25
with a 20Mhz xtal, I had a PIC with DEBUG @ 115K to send data from memory to PC serial com port, and it would have 1 or 2% error rate.
that wasn't that bad, since it was after a few minutes of transfert.

BrianT
- 9th November 2010, 03:17
Thanks guys for the replies.
I have set up an experiment and found the following results. All testing done with a PIC18LF4620 running INTOSC2 at 4 and 8 MHz. I am observing the character waveform with a digital scope and the characters look to be perfectly formed.

The baudrate is NOT limited to the 'standard' RS-232 speeds of 9600, 19200, 38400 etc. Almost any speed can be entered and the bit times are correctly set.

OSCCON = %01101111 (4 MHz). Here DEBUG_BAUD rate can be any speed up to 30,000 bits per second. DEFINE DEBUG_BAUD 30000 gives correct 33.3 uSec per bit and 395 uS per character. The stop bit is stretched which is no bad thing as it gives the receiving device more time to process the character.

OSCCON = %01111111 (8 MHz). Supports any bit rate up to 60000 bps.
Bit time is 16.7 uSec and character time 195 uSecs.

I am sending from one PIC to another so irrational baud rates don't bother me. I just want fastest reliable speed.

HTH
BrianT