CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Can't setup_spi2(mode) for Pic18f4431 ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
tidushuu



Joined: 29 Sep 2012
Posts: 8

View user's profile Send private message

Can't setup_spi2(mode) for Pic18f4431 ?
PostPosted: Wed Oct 17, 2012 10:38 am     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 17, 2012 12:08 pm     Reply with quote

It doesn't have two SPI channels. It has alternate pins. Look at the
SSPMX configuration bit in the 18F4431 data sheet. It selects between
the normal pins and the alternate pins for SPI.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group