Hello,
I am trying to communicate between PIC and AS5600 chip. I am not sure if the commands I send are correct. The only data I receive back from AS5600 is "6" for B0 and "6" for B1.

Here is part of my code:

define LOADER_USED 1
define OSC 24
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 38400
DEFINE HSER_CLROERR 1
Define LCD_DREG PORTD
Define LCD_DBIT 4
Define LCD_RSREG PORTD
Define LCD_RSBIT 1
Define LCD_EREG PORTD
Define LCD_EBIT 0
define LCD_BITS 4
define LCD_LINES 2
define CCP2_REG PORTC
define CCP2_BIT 1
ADCON1 = 15 'make all inputs and outputs digital


TRISA = %11111111 'set up port A as input
TRISC = %10000000 'set up port C as output/input (Rx-1,Tx-0)
TRISB = %11111111 'set up port B as input
TRISD = %00000000 'set up port D as output
TRISE = %00000000 'set up port E as output


PORTC = %01000100
DEFINE I2C_SCL PORTB,1
DEFINE I2C_SDA PORTB,0
DEFINE I2C_SLOW 1
DEFINE I2C_HOLD 1
DEFINE CHAR_PACING 102

start:
B0 = 0
B1 = 0
pause 100
i2cwrite PORTB.0,PORTB.1,$36,$0E,[0]
pause 10
i2cwrite PORTB.0,PORTB.1,$36,$0E,[1]
pause 10
I2CREAD PORTB.0,PORTB.1,$36,$0E,[B0]
pause 10
I2Cwrite PORTB.0,PORTB.1,$36,$0F,[0]
pause 10
I2Cwrite PORTB.0,PORTB.1,$36,$0F,[1]
pause 10
I2CREAD PORTB.0,PORTB.1,$36,$0F,[B1]
pause 10
LCDOut $FE, 1, dec B1
LCDOut $FE, $C0, dec B0
goto start

Any help you can provide in this matter will be appreciated.