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
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.
By the way, I wanted to use the internal 4MHz oscillator. From what I heard, that the frequency of oscillation might not be as stable. Would I2C communications still work if I go this route?
Unstable yes and no. At least, i would never trust too much a serial communication RS232 or else running with any internal or ceramic resonator. Worst if the final product maybe use in various ambient temperature.
For I2C... i never got issue even by running internal OSC... well as now![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks