martes, 14 de junio de 2011

Communication between PIC's 18F series by the SPI bus

Exercise involves connecting two PIC's 18F4550 through SPI port. In my case the exercise is simple Master in case of receiving a logic 1 at the door RA0 send a signal to the Slave. This activates an LED long as it says the Master.


 By having two independent PICs we will need to have two codes. Empelo CCS C language to program the PIC's. The first thing is to program the Master. The teacher is aware of how the RA0 is if entry is a logical 1 this will account for 1 and writes it to the SPI. In the event that there is a logical 0 RA0 this account written in a 0.



Once we set a schedule Master Slave. The slave checks all the time if you have entered a value in the SPI. If you entered data enter thou read the data and stored in the variable number. If number is 1 turn out RA02 activating an LED.


Dowloar year:
https://sites.google.com/site/franbc0100/%5BComunicacionentrepics%5D.rar?attredirects=0&d=1

No hay comentarios:

Publicar un comentario