Hi Ruben, yes RP and tris are set. this is what I have // SPI =A0 =A0 =A0 =A0 TRISBbits.TRISB5 =3D 0; =A0// "SPI IN" =A0 =A0 =A0 =A0 TRISBbits.TRISB4 =3D 1; =A0// "SPI OUT" =A0 =A0 =A0 =A0 TRISGbits.TRISG9 =3D 0; =A0// "SPI Clock" =A0 =A0 =A0 =A0 TRISBbits.TRISB3 =3D 0; =A0// "SPI Hold" =A0 =A0 =A0 =A0 TRISAbits.TRISA0 =3D 0; =A0// "SPI chip select" =A0 =A0 =A0 =A0 TRISBbits.TRISB6 =3D 0; =A0// "SPI Hold" =A0 =A0 =A0 =A0 PORTBbits.RB6 =3D 1; =A0 =A0 // disable hold =A0 =A0 =A0 =A0 PORTBbits.RB3 =3D 1; =A0 =A0 // disable write protect =A0 =A0 =A0 =A0 PORTAbits.RA0 =3D 0; =A0 =A0 // enable chip select // Remap SPI2 EEPROM 25AA256 =A0 =A0 =A0 =A0 iPPSOutput(OUT_PIN_PPS_RP18,OUT_FN_PPS_SDO2); // SPI2 OUT = =A0RP18/RB5 "SPI2 IN" =A0 =A0 =A0 =A0 iPPSOutput(OUT_PIN_PPS_RP27,OUT_FN_PPS_SCK2OUT); // SPI2 SC= K out =A0RP27/RG9 "SPI2 SCK" =A0 =A0 =A0 =A0 iPPSInput(IN_FN_PPS_SDI2,IN_PIN_PPS_RP28); =A0 =A0 =A0 // S= PI2 IN to RP28/RB4 =A0"SPI OUT" AA On Wednesday, November 27, 2013 2:18 AM, Ruben J=F6nsson wrote: =20 Could be that you have PPS (Peripheral Pin Select) set up wrong for the SDI (SPI input to PIC) signal. Also check that you have set the pin to digital (if it has an analog functi= on). And that JTAG is switched off if it collides with your pins for the SPI. /Ruben > Hi all, >=20 > I am using microchip =A0pic24FJ256GB110 with =A0CE313 SPi example code to > communicate with EEPROM 25LC256. I only changed pins to match with my > hardware. the problem I am having is I do not get any data when I read "i= n > mplabx" but I see the data coming from the EEPROM using logic analyzer. I > looked at the datasheet and I am not clear how microchip used single buff= er > for SPI RX and SPI TX. I know that SPI needs one dummy read in order to g= et > the data shifted out but I am totally lost why I am seeing the data on > analyzer but not in mplabx ide receive register or buffer. the buffer nam= e is > SPI2BUF. my question is does anyone used CE313 example code for EEPROM > =A025LC256 or does anyone have any working code that like to share.=A0 > see attachment screen shut. it shows that EEPROM is sending 2 bytes this = is > read command. 03 means read 10 is the address and 00 is dummy read to shi= ft > the data out and you can see that byte 12 was the data saved location add= ress > 10. witch is correct and same thing on address 11 is saved byte 34. =A0th= e way I > see it sounds like software read issue. when I use debugger I do not see = any > data on SPI2BUF. >=20 > any idea? >=20 > thanks >=20 > Andre=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124 200 39 Malm=F6 Sweden www.liros.se Tel +46 40142078 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .