Searching \ for 'CCS I2C problem' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/i2cs.htm?key=i2c
Search entire site for: 'CCS I2C problem'.

Truncated match.
PICList Thread
'CCS I2C problem'
1999\04\20@014305 by e Varga

flavicon
face
Hi, Folks,

I wanted to use the CCS I2C routin but I had a little problem.
I wanted to poll a LM75 temperature sensor IC and it doesn't work.
I tryed the circuit with PBP and asembler and it worked fine.
When I run this program I get 255 instead of the room temperature.
Did I make a mistake or the hardware does't fit to the CCS.



# include <16C84.h>
# use delay (clock=4000000)
# use rs232(baud=1200,xmit=pin_b4,invert)
#use i2c(master,sda=pin_a0,scl=pin_a1, slow)

main()
{
int h,l
   ide:
   i2c_start();
   i2c_write(0b10010000);
   h=i2c_read();
   l=i2c_read();
   printf("temp %u %u \n\r",h,l);
   i2c_stop();
   delay_ms(1000);
   goto ide;
}


Thanks George

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...