Page 1 of 1

SPI communications nightmare!

Posted: Mon Mar 23, 2015 8:09 pm
by 407charles
I have being trying to understand the SPI communications. In one hand there is an example available written one way, and in the other hand I read in the Matrix blog an article from Benjamin showing something completely different, there is any other example available? I'm trying to write a simple program, using two PIC16F877A microcontrollers, that is able to send a simple variable from one microcontroller to another. So far I got confuse about what approach I need to follow. I did my first attempt to accomplished this task but not functional. First I don't know if a have to sent the variable value to a particular memory or just sent the variable needed. Also the Slave PIC it's going to need a small program to receive this value I think, but there is not example available. I read the complete article from Benjamin but I'm not to familiar with programmer's language so I just got an idea of how it works. This is the last part of my project but unfortunately there is not a clear example. By sending a simple variable to another PIC, a lot of sub-processes can be achieved expending the PINs availability; for example if you need an LCD and a 7 segment display for certain application the availability of pins will be very limited because just this two use more than 18 pins in total. Please if somebody already have success with the subject I will appreciate if he or she can help me with this nightmare! I've been reading and searching about the subject but not luck, everything I found is in C language. this is my first attempt..... About the second program (the slave) I don't even have an idea.

Re: SPI communications nightmare!

Posted: Mon Mar 23, 2015 11:00 pm
by kersing
Why don't you use serial (RS232 but at 5v) communications? A lot simpler to implement.

Re: SPI communications nightmare!

Posted: Fri Sep 16, 2016 2:40 am
by 407charles
Hi Kersing, you were right, the SendChar command in RS-232 communications is easy and it works perfectly but the Send_String command did not work for me, it just send the first three letters. Do you have and idea of why? I will appreciate your feedback. Thanks a lot.