tidushuu
Joined: 29 Sep 2012 Posts: 8
|
Can't setup_spi2(mode) for Pic18f4431 ? |
Posted: Wed Oct 17, 2012 10:38 am |
|
|
Using PCWHD 4.104 , I saw datasheet of Pic18f4431 and it have 2 SPI port, but when i try to setup_spi2, the compiler show error.
My test code is here
Code: |
#include <18F4431.h>
#device adc=8
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20M)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
void main()
{
setup_spi2(SPI_MASTER | SPI_L_TO_H | SPI_CLK_DIV_16);
}
|
And pin_out of 18f4431
http://circuits.datasheetdir.com/19/PIC18F4431-pinout.jpg |
|