I2C problem (16F877A with DS1844)
Hi!
I am working on a digital amplifier project with DS1844 digipot but the I2C communication don't work.
I use PIC16F877A, SCL is PORTC.3 and SDA PORTC.4 with 10k pull-up resistors. (also I tried with 4,7k)
The control byte is 01010000, A0, A1, A2=0; PS=1
The program:
TRISC = %11100111 'bemenetek beallitasa
TRISD = %00001111
TRISA = 0
TRISB = 0
SDA var PORTC.4
SCL var PORTC.3
DEFINE OSC 4
DEFINE I2C_HOLD 1
ADCON0=0
ADCON1=7 'ADC kikapcsolva
CMCON=7 'komparator ki
SSPCON=0
Define LCD_DREG PORTB 'LCD definialasa
.
.
Define LCD_LINES 2 '2 soros
pause 500
I2CWRITE SDA, SCL, %01010000, 0, [%00011111, %01011111, %10011111, %11011111]
pause 100
I was tried it in many ways, but not work.
excuse for my english
thanks
lissajous from Hungary