I love this site.
If you post useless, you will get punished.
Entire Forum
This board
This topic
Members
Entire Site
Home
Contact Us
Help
Search
GoogleTagged
Donations
Login
Register
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
April 26, 2024, 09:07:15 09:07
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Sonsivri
>
Electronics
>
General Electronics
(Moderators:
o2
,
pickit2
) >
i2c baud rate
Pages: [
1
]
« previous
next »
Print
Author
Topic: i2c baud rate (Read 4398 times)
0 Members and 1 Guest are viewing this topic.
planet69
Newbie
Offline
Posts: 26
Thank You
-Given: 5
-Receive: 8
i2c baud rate
«
on:
February 27, 2008, 07:26:13 07:26 »
i'm using PIC18F452 and i've got a question about i2c function.
1) is it true that i can set any fixed baud rate (clock) from 0 to 100KHz?
2) if i set SSPSTAT,SMP=1, what value should i put into SSPADD if i'm using crystal 4MHz?
3) if i set SSPSTAT,SMP=0, is the baud rate fixed to 400KHz or i'm free to set any baud rate from 0 to 400KHZ? what value should i put into SSPADD then using a 20MHZ crystal?
answers are appreciated.
Thank you.
Logged
tomzi
Guest
Re: i2c baud rate
«
Reply #1 on:
March 02, 2008, 01:53:22 13:53 »
hi,
1) i think you can set it
2) value in BRG should be 28h (SSPADD = b'x0101000'
3) i think you can set it, for baud rate 400kHz and xtal 20MHz value in SSPAD should be b'x0110010'
Logged
abbas1707
Junior Member
Offline
Posts: 76
Thank You
-Given: 15
-Receive: 25
Re: i2c baud rate
«
Reply #2 on:
March 02, 2008, 07:02:29 19:02 »
i wrote my own i2c code.but how can i find that at which rate communication is going on?? can anyone tell me some method to find it??
Logged
A Thousand Miles Journey Starts With a Single Step
planet69
Newbie
Offline
Posts: 26
Thank You
-Given: 5
-Receive: 8
Re: i2c baud rate
«
Reply #3 on:
March 03, 2008, 01:17:51 01:17 »
i think i understand it now.
we can set any value 0-400KHz based on the setting of SMP bit
using the formula, BRG = ((Fosc / Fclock X 4)) - 1, the value for SSPADD is found
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Electronics
-----------------------------
=> Projects
=> Pic Basic Languages
=> Pic C Languages
=> AVR, 8051 Family and ARM Area
=> RTOS
=> Artificial Intelligence (AI) & Robotics
=> Hardware and Tools
=> General Electronics
-----------------------------
Computers
-----------------------------
=> Internet Scripting Languages
=> Graphics and CAD
-----------------------------
Announcements and Rules
-----------------------------
=> Help & Rules
===> English
===> Arabic
===> French
===> Italian
===> Persian
===> Portuguese (Brazilian)
===> Spanish
===> Swedish
===> Turkish
=> Announcements
-----------------------------
Others
-----------------------------
=> General
=> Entertainment
=> Suggest Forum Content
=> Holiday and Greetings
=> Testing Forum
=> Invitation Request
Loading...