View previous topic :: View next topic |
Author |
Message |
ntype
Joined: 01 Nov 2007 Posts: 9
|
Hardware UART at non standard baud rates |
Posted: Thu Nov 01, 2007 2:35 pm |
|
|
Hi,
Im using a PIC18F2520 on a MIDI based project, and i can successfully transmit midi characters at the desired rate of 31.5Kbps. However, i know this is an unusual baud setting. Will the hardware UART deal with this setting, or is it effectively running as a software UART, doing the bit bashing via the processor? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 01, 2007 2:53 pm |
|
|
Do a Google search for this:
Quote: | PIC baud rate calculator |
Then download the program from the first hit:
http://www.micromagicsystems.com/picbaud/4523812801
(Note: This website plays a sound when you go to it).
Unzip it, drag it onto your desktop, plug in the parameters for your
board, click the "Calculate" button and look at the error percentage.
If it's less than a couple percent, it should work. |
|
|
ntype
Joined: 01 Nov 2007 Posts: 9
|
|
Posted: Thu Nov 01, 2007 3:03 pm |
|
|
Cool Utility. I ran the numbers in and with a 20MHZ clock the error is -0.79% . So it looks like i might be in luck. As an experiment I set my PIC to transmit at the nearest 'correct' frequency (31250bps) and my MIDI recieving hardware picks up the messages fine, so either way it looks like in onto a winner! Hurrry for Hardware UARTS, i really couldn't have afforded the processor time to transmit using a soft uart.
Thanks PCM |
|
|
|