Jump to content

A Question Regarding Spbrghx And Spbrgx Register~

Recommended Posts

Hello everyone,


I am wondering what exactly is the difference between the two registers. I looked all over the net and in the spec data sheet trying to find out what each of the two register does (SPBRGHx and SPBRGx registers for PIC18F8722 Family). All I get is more of the phrases such as "EUSARTx Baud Rate Generator Register High Byte and Low Byte, respectively. This is really driving me nuts... Can some pr0 please explain to me what each register does, how to use each register, and when to use each register. My main goal is to Read data from my GPS module asynchronously at a rate of either 38400bps or 115200bps pending. Thanks for reading!~ A detailed explanation and perhaps even a clearly distinguished example will help a lot.





Link to post
Share on other sites

The two registers work together to form a 16 bit register. The 16 bit value is basically a divisor which divides down the oscillator frequency into a baud rate.


Table 20-1 gives the folmula for the various configurations and Figure 20-1 gives a perfect example.


To get an exact baud rate you must have an oscillator frequency that will divide down exactly (14.7456MHz for example) otherwise there will be a small in baud rate that you may be able to live with.





Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...