I am using ATMEL studio 6 for programming and novice in embedded systems.At present, I have read the theory working of SPI. I understand that I have to set particular bits to one in the control register for defining master or salve mode of operation and clock polarities, phase etc.
Problem:1) How to configure MOSI, clock and select_line as output pin from the master and MISO as the input pin to the master?.
2) Master and slave both are micro controllers,I just need to transfer and receive data to and from slave. So should the master code be dumped in the master mc and slave code should be dumped in slave mc? or both mc's must have the entire code into them?.
3) What are the main factors and key points should consider while SPI programming?.
Any help, suggestion and directions regarding this would be appreciated.Thanks.