Page 1 of 1
SPI DEVICES
Posted: Thu Jan 28, 2010 2:40 pm
by Adrien DG
Hello All !
I'd like realize a communication between 2 PIC 16F877A
I want to know how can I set one of them as a Master and the other as Slave ?
It's very important for me to understand this...
I've tried to set the slave's clock in idle_high (polarity) but i always have a conflict between the master and the slave...
Help Please
Regards
Adrien DG
Re: SPI DEVICES
Posted: Thu Jan 28, 2010 4:25 pm
by Benj
Hello Adrien
At the moment we only have master versions of the SPI and I2C components.
You should be able to use the RS232 component to communicate between two devices. Alternativly you could customize the code for the SPI component by refering to the device datasheet and setting it up as a slave instead of a master.
Re: SPI DEVICES
Posted: Thu Jan 28, 2010 7:47 pm
by Adrien DG
Hello Ben, thank you for your response !!
So I've already customized my code to set a PIC in Master, and another in Slave, but i've still a conflict with the clock,
I'll try to do this tomorrow
Regards
Adrien DG
Re: SPI DEVICES
Posted: Fri Jan 29, 2010 7:25 am
by Adrien DG
I've just one other question ...
For the SPI I want to send an OPCOD and then to receive an information from the slave
Why when I place a SPI GET CHAR I have a sending information from the master to the slave
This message is 0x90 which means 'Z'
I don't understand !!
Re: SPI DEVICES
Posted: Fri Jan 29, 2010 9:46 am
by Benj
Hello
A decimal 90 or hexadecimal 0x5A represents 'Z'
This should help to explain things.
http://www.asciitable.com/
Re: SPI DEVICES
Posted: Fri Jan 29, 2010 12:00 pm
by Adrien DG
Hello !!
Yes I know that, but I don't understand why I always see this 'Z' when I put a GET CHAR in my slave program.