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

Help SPI protocol !!!

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



Joined: 23 May 2013
Posts: 1

View user's profile Send private message

Help SPI protocol !!!
PostPosted: Thu May 23, 2013 9:39 pm     Reply with quote

A project about communication with SPI protocol, Receive and transfer between 3 Pics.
I don't understand that I must double click, system can operation, one click system can't operation!!
Thanks for attention!!
The program:
http://www.mediafire.com/?1dknjcx8k77woiv
temtronic



Joined: 01 Jul 2010
Posts: 9240
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri May 24, 2013 5:16 am     Reply with quote

I had a quick look at your 'master.c' program.
First it amazes me the worldwide use of PICs. It must be hard to program when English is not your first language.

Whenever you're using portB for interrupts, you must read the whole port to clear it.
There is an example in the FAQ section of the HELP files ( press F11 with project open) that shows a nice way to read portB and take action.

Also you should use #define to 'name' I/O pins for their use.
something like
...
#define secondPICslaveselect PIN_A1 //SPI slave select for PIC #2
...

will greatly help you and others in deciding what pins are for.
even short names like PIC2_SS. Less typing, easy to understand!

And, there isn't any 'debounce' for the switches. You must delay a bit either in hardware or software (say 10ms delay).

A schematic would help too.

hth
jay
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