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

I²C flowcode ad5241

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ciss_c



Joined: 28 Nov 2010
Posts: 1
Location: Belgium

View user's profile Send private message

I²C flowcode ad5241
PostPosted: Sun Nov 28, 2010 6:51 am     Reply with quote

I am trying to program my digital potentiometer ad5241 with flowcodeV4 but I can't get it to work. my SDA and SCL are each connected to 10K resistor.
This is my program.

MI2C_init

MI2C_start

MI2C_Transmit_Byte 0b01011110 (this is my adress byte for the AD 5241 the first 5 MSB byte are the adress the 2 next are AD1 and AD0 they must be 1 caus they are connected to VDD and the last bit is READ or WRITE so i made it 0 to write)

MI2C_Transmit_Byte 0b00000000 (instruction_Byte wich i do not use , i sellect RDAC1 to use register 1 for a single potentiometer.)

MI2C_Transmit_Byte 0b11111111 (this is the data byte ,it sets the resister value to full scale)

MI2C_stop
____________________________________
MI2C_start

MI2C_Transmit_Byte ( ADRESS AD5241)

MI2C_Transmit_Byte (INSTRUCTION)

MI2C_start (repeated start)

MI2C_Transmit_Byte (ADRESS BYTE in READ so 0b01011111)

and then i read from RDAC1
MI2C_Receive
(RETOUR value is 0b1111111 and LAST(Byte) is 0)

MI2C_stop


This is my program and I don't know whats wrong. I hope you can help me, thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 28, 2010 11:56 am     Reply with quote

This forum is for CCS C. Your language has its own forum, here:
http://www.matrixmultimedia.com/support/viewforum.php?f=22
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group