Hi all,
I was reading the PicBasic manual and it states that the 400kHz I2C devices may be used up to 20MHz. I'm just curious how the compiler sets the PIC (PIC12F675) to match up to the 400KHz clock speed?
I'm a newbie.
Thanks!
Hi all,
I was reading the PicBasic manual and it states that the 400kHz I2C devices may be used up to 20MHz. I'm just curious how the compiler sets the PIC (PIC12F675) to match up to the 400KHz clock speed?
I'm a newbie.
Thanks!
Qacer, When it does the compile it uses the "OSC=" directive to calculate the data output rate. Make sure you are declaring the OSC=20 if you are using a 20Mhz. oscillator.
Dave Purola,
N8NTA
Thanks, Dave!
Coincidentally, I'm trying to figure out the oscillators used in the PIC12F675. I have not quite figured out that part, yet.
Do I need to define OSC every time I use the I2C routine?
Thanks again!
The internal oscillator of the 12F675 run at 4MHZ. if you want to run @29MHZ you must use an external Crystal or a ceramic resonator.
The DEFINE OSC must be place somewhere on the top of your code and you don't need to write it every time.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks!
Would serial communication with a 400KHz I2C device still work if my PIC oscillator setting is at 4MHz?
of course yes, if not we should all use 400KHZ or less as oscillator. PBP generate the right clock frequency for you. Look in the manual in the I2CREAD/I2CWRITE
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks