Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] What SPBRG setting to use for PIC(16F87xA with 8MHz Xtal in Async Mode(BRGH=1)

Status
Not open for further replies.

gl1

Junior Member level 1
Joined
Sep 21, 2010
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,421
Hi Guys,
What value should i use in SPBRG for PIC 16F87xA with 8MHz Xtal,
I want to communicate with serial port at 9600 Baud, should i try use setting for 10MHz Xtal i.e. 64.
Or is it possible to use 8MHZ Xtal and achieve serial comms at 9600?


Thanks
 

You should not only depend on SPBRG settings. You should set your clock settings to make sure it is 8MHz. Then, set the SPBRG. All these you can find in the PIC datasheet.
 
The datasheet has the formulas:

For BRGH=0:
SPBRG = (Fosc/(64 x Baud)) - 1

For BRGH=1:
SPBRG = (Fosc/(16 x Baud)) - 1

In your case, Fosc=8000000 and Baud=9600.
 
  • Like
Reactions: gl1

    gl1

    Points: 2
    Helpful Answer Positive Rating
excellent thanks "upand_at_them"

---------- Post added at 00:29 ---------- Previous post was at 00:27 ----------

excellent, thanks "upand_at_them"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top