View Single Post
Old 16-04-2013, 12:21 AM   #1
the_duyet
Đệ tử 1 túi
 
Tham gia ngày: Mar 2008
Nơi Cư Ngụ: Hạ Long City
Bài gửi: 18
:
Send a message via Yahoo to the_duyet
Exclamation Hỏi về SPI cho PIC24FJ256GB106

Mình đang đang làm websever trên PIC PIC24FJ256GB106 theo TCPIP- DEMO APP MDD của microchip. Phần SPI mình chưa hiểu nó định nghĩa chân sdo, sdi, clk như thế nào.
Code:
// ENC28J60 I/O pins
	#define ENC_CS_TRIS			(TRISBbits.TRISB8)	// Comment this line out if you are using the ENC424J600/624J600, MRF24WB0M, or other network controller.
	#define ENC_CS_IO			(LATBbits.LATB8)
	//#define ENC_RST_TRIS		(TRISDbits.TRISD15)	// Not connected by default.  It is okay to leave this pin completely unconnected, in which case this macro should simply be left undefined.
	//#define ENC_RST_IO			(PORTDbits.RD15)
	// SPI SCK, SDI, SDO pins are automatically controlled by the 
	// PIC24/dsPIC/PIC32 SPI module 
	#if defined(__C30__)	// PIC24F, PIC24H, dsPIC30, dsPIC33
		#define ENC_SPI_IF			(IFS0bits.SPI1IF)
		#define ENC_SSPBUF			(SPI1BUF)
		#define ENC_SPISTAT			(SPI1STAT)
		#define ENC_SPISTATbits		(SPI1STATbits)
		#define ENC_SPICON1			(SPI1CON1)
		#define ENC_SPICON1bits		(SPI1CON1bits)
		#define ENC_SPICON2			(SPI1CON2)
	#endif
Như nó nói thì các chân SDO,SDI, CLK sẽ tự động được điều khiển bởi SPI module của PIC24. Nhưng mình không biết chính xác là chân nào sẽ làm nhiệm vụ này( giả sử mình muốn đổi chân chẳng hạn). vì nó có remappable.
Ai giải thích giùm mình được không, cảm ơn nhiều.
Mình gửi kèm file mình lượm được và muốn làm theo.
File Kèm Theo
File Type: zip PIC24 Web Server(Storage Demo)V1.0.zip (490.3 KB, 16 lần tải)
the_duyet vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn