CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 15 matches
CCS Forum Index
Author Message
  Topic: i2C_Stream
robotam

Replies: 2
Views: 4288

PostForum: General CCS C Discussion   Posted: Wed Feb 13, 2008 3:36 pm   Subject: i2C_Stream
Hello

Someone could post a example code of i2c communication using "Stream".

thanks
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Thu Dec 27, 2007 2:39 am   Subject: I2C slave transmitting data
Hello,
I changed my dspic with a 18f as a slave and it works perfectly.i guess there is some modifications or configuration in the dspic.
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Mon Dec 17, 2007 10:36 am   Subject: I2C slave transmitting data
Thanks. I did add the NAK parameter to my master-receiver code and my demo program(s) came to life! My slave is running essentially the example slave program. Very simple master program.

I will ...
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Fri Dec 14, 2007 1:55 am   Subject: I2C slave transmitting data

Master 18F2550
Slave DSpic 30f4012

pcwhd 4.057

Try using an 18F-series PIC for the Slave, instead of the dsPIC.
(Keep the 18F2550 for the Master).

i need to control a motor with dspic
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Thu Dec 13, 2007 4:51 pm   Subject: I2C slave transmitting data
What PIC type are you using for the slave and the master ?

What is your compiler version ?

Master 18F2550
Slave DSpic 30f4012

pcwhd 4.057
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Thu Dec 13, 2007 4:02 pm   Subject: I2C slave transmitting data
1. Use the CCS example code for the Slave.
2. Use the hardware i2c pins (SDA and SCL) on the Slave PIC.
3. Run the Slave PIC at 20 MHz.
4. Make sure you have a ground connection between the Master ...
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Thu Dec 13, 2007 3:20 pm   Subject: I2C slave transmitting data

i2c_start();

i2c_write(0xA0);
i2c_write(0x00);
i2c_start();
i2c_write(0xA1);
data=i2c_read(0);
i2c_stop();

======================

I'm a quasi I2C newbie so put flamethrower on s ...
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Tue Nov 20, 2007 8:27 am   Subject: I2C slave transmitting data
yes i already did that and worked
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Tue Nov 20, 2007 6:38 am   Subject: I2C slave transmitting data
PLEASE HELP!!
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Tue Nov 20, 2007 2:57 am   Subject: I2C slave transmitting data
You are delaying for 100mSec in the 'write' routine, before writing the data. The master expects the data to be there immediately...

Best Wishes

thank you for your answer but, i did that to know ...
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Mon Nov 19, 2007 12:52 pm   Subject: I2C slave transmitting data
i already tryed it and same result
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Mon Nov 19, 2007 12:15 pm   Subject: I2C slave transmitting data
Thanks for your suggestion,

But the problem is that the master doesn't receive data from the slave.

the slave code is frome ex_slave.c from "ccs".
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Mon Nov 19, 2007 11:42 am   Subject: I2C slave transmitting data
Master code

#include <18F2550.h>

#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
//#fuses HS,NOWDT,NOPROTECT,NOLVP,NODEBUG,VREGEN,PUT
#fuses HS,NOWDT,NOPROTECT ...
  Topic: I2C slave transmitting data
robotam

Replies: 47
Views: 93285

PostForum: General CCS C Discussion   Posted: Mon Nov 19, 2007 10:10 am   Subject: I2C slave transmitting data
On I2C, the device 'address', is the top seven bits of the byte writen immediately after a 'start'. The bottom bit, sets the direction of the following transfer wanted.
So the 'read' code, sends the ...
  Topic: I2C Slave
robotam

Replies: 8
Views: 10312

PostForum: General CCS C Discussion   Posted: Mon Nov 19, 2007 9:53 am   Subject: I2C Slave
i2c_start();
i2c_write(0xa0);
i2c_write(0x00);
i2c_start();
i2c_write(0xa1);
data = i2c_read(0);
i2c_stop();

I dont understand why i2c_write(0xa1); what this value 0xa1 ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group