SH
Joined: 06 Jul 2011 Posts: 3
|
Hardware SPI [solved] |
Posted: Wed Jul 06, 2011 7:36 am |
|
|
I use a 18F26J50 with SPI interface to a 23K256 Serial SRAM
Compiler version 4.114
I want to use the hardware SPI and want to remap the output pins:
Code: |
#pin_select SDI2=PIN_B0
#pin_select SDO2=PIN_B3
#pin_select SCK2=PIN_B2
#USE SPI (MASTER, SPI2, MODE=0, BITS=8, STREAM=SPI_23K256, MSB_FIRST)
|
I can see that that the SFR RPINR21(SDI2) is set to 3 as expected.
The RPOR5 is not set to 10(SCK2) and RPOR6 is not set to 9(SDO2) as expected, and the SPI2 hardware do not work.
If I use software SPI:
Code: |
#use SPI( MASTER,DI=PIN_B0, DO=PIN_B3, CLK=PIN_B2, STREAM=SPI_23K256,SAMPLE_RISE, BITS=8).
|
The communication with the 23K256 works fine.
What can the problem be ? |
|