Jump to content
Xephyrind

A Question Regarding Spbrghx And Spbrgx Register~

Recommended Posts

Xephyrind    0

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.

 

Sincerely,

 

Xephy

Share this post


Link to post
Share on other sites
Reynard    0

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.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum 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.

Loading...

×