View previous topic :: View next topic |
Author |
Message |
reno777
Joined: 20 Feb 2012 Posts: 4
|
i2c on pic16f628 |
Posted: Mon Feb 20, 2012 1:02 pm |
|
|
As I can realize program I2C on pic16f628 as I understand hardware i2c at it wasn't present. I badly know English, excuse me!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 20, 2012 1:26 pm |
|
|
If your PIC doesn't have an MSSP module, the CCS compiler will
generate code for a software i2c Master on the pins that you specify
in the #use i2c() statement.
But, you can't do an i2c slave. The #use i2c() statement requires a
hardware SSP or MSSP module to do a i2c slave.
So for a 16F628 you can make:
1. Software i2c master
2. But no i2c slave. |
|
|
reno777
Joined: 20 Feb 2012 Posts: 4
|
|
Posted: Mon Feb 20, 2012 1:31 pm |
|
|
PCM programmer wrote: | If your PIC doesn't have an MSSP module, the CCS compiler will
generate code for a software i2c Master on the pins that you specify
in the #use i2c() statement.
But, you can't do an i2c slave. The #use i2c() statement requires a
hardware SSP or MSSP module to do a i2c slave.
So for a 16F628 you can make:
1. Software i2c master
2. But no i2c slave.
|
I want Software i2c master.
The block diagram of my device looks here so
I realized UART, but I can not realize I2C.
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 20, 2012 1:52 pm |
|
|
Have you tried to do it ? Have you tried to write the code and test it ?
What is the manufacturer and part number of the sensor ?
Here is an example of a software i2c master for an external A/D converter chip:
http://www.ccsinfo.com/forum/viewtopic.php?t=32570&start=13 |
|
|
reno777
Joined: 20 Feb 2012 Posts: 4
|
|
Posted: Mon Feb 20, 2012 2:10 pm |
|
|
There is no I didn't try to make it, to begin with I have studied the documentation on PIC16f628, and have seen that there isn't present hardware I2C, now I try to learn as to realize it software I2C, sensor LSM303DLH |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 20, 2012 2:24 pm |
|
|
Do you have an LSM303DLH board from some company (Sparkfun, or Polulu) etc. ? If so, tell us. |
|
|
reno777
Joined: 20 Feb 2012 Posts: 4
|
|
Posted: Mon Feb 20, 2012 2:37 pm |
|
|
PCM programmer wrote: | Do you have an LSM303DLH board from some company (Sparkfun, or Polulu) etc. ? If so, tell us. |
I have bought sensor Sparkfun LSM303 Breakout Board - Tilt Compensated Compass. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 20, 2012 3:48 pm |
|
|
I have one of those boards here, but we never used it. I don't have time
to work on it now. There is LSM303DLH code in the forum archives.
It may or may not work. You can look for it. |
|
|
|