due problem for more input request, I transfer program from PIC CLICKER BOARD to PIC 32 mikromedia board (display broken)
I use in project click cards: GPS, GSM, 8x8 matrix 2 cards, and serial Ethernet board.
With PIC clicker for communication with 8x8 matrix I use SOFT_SPI, but here for future use I would like to have it on SPI2.
connections are matrix is on SPI2, GSM on UART2 ,GPS on UART1, serial Ethernet board on SPI1
Problem is that serial Ethernet card not working with PIC32 (program is just lightly changed to be used on PIC32). There is no SCK signal generated for neither any signal out of controller on SPI1, except there is CS which is connected on RG14, RST RG13 is HIGH.
Is there any example that ethernet card working on SPI1 with this PIC or there is a problem I use 2 SPI ports. HOW to force SPI_ETHERNET library to use SPI1?
Code: Select all
SPI1_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 16, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_IDLE_2_ACTIVE)
delay_ms(100)
SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 16, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_IDLE_2_ACTIVE)
SPI_Ethernet_Init(myMacAddr, myIpAddr, _SPI_Ethernet_FULLDUPLEX) ' init ethernet module
SPI_Ethernet_setUserHandlers(@SPI_Ethernet_UserTCP, @SPI_Ethernet_UserUDP) ' set user handlers
' dhcp will not be used here, so use preconfigured addresses
SPI_Ethernet_confNetwork(ipMask, gwIpAddr, dnsIpAddr)
Code: Select all
test:
SPI_Ethernet_CS =0
spi1_write(0xAA)
SPI_Ethernet_CS =1
delay_ms(5)
SPI_Ethernet_CS =1
delay_ms(5)
goto test
Any hint,
thanks Damir
ps. this is picture with cards together