Jump to content


A Question Regarding Spbrghx And Spbrgx Register~

1 reply to this topic

#1 Xephyrind



  • Members
  • 1 posts

Posted 07 March 2008 - 10:11 PM

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.



#2 Reynard



  • EstablishedMember
  • PipPipPipPip
  • 662 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Archery - target and field

Posted 09 March 2008 - 06:18 PM

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.



Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users