can anyone explain in idiot language how you go about calculating what baud rate to use with the usart on a pic. its something i just dont seem able to get my head around thanks guys
ive been looking at the datasheet but nothing is sinking in tonight so i am going to leave it untill tommorow! is frustrating when i get dense days like this
Common baud rates are usually listed in the tables in the device datasheets. For example, in the PIC16F877A datasheet, 9.6Kbaud SPBRG is listed as having a value of 25 with 0.16% error at 4Mhz in Asynchronous mode (SYNC=0).
RB has explained how to quickly and easily calculate the SPBRG value for any Asynchronous baud rate.
Obviously for Synchronous mode you simply divide the xtal freq by 4 then your desired baud rate and subtract 1 from the result (SPBRG = xtal freq / 4 / desired baud - 1).
In either case, you obviously want to calculate for the lowest error to guarantee framing stays put.