As you can tell from the title I am working to connect a 877A to a DAC (an MCP4922). The 877A is the SPI master and the MCP4922 is the slave. Also as the title hints they are going to be connected through SPI. I have never delt with SPI before so I have a few basic questions.
First of let me mention that I through a search on this forum I found a fantastic presentation on SPI:
ww1.microchip.com/downloads/en/devicedoc/spi.pdf
The section showing the coding was great but there are a few questions that I could use some help with.
FOSC/16 (or 4 • TCY)
FOSC/64 (or 16 • TCY)
Timer2 output/2
I used the SPI presentation to write code for the 877A, I feel pretty confident in it but...
Thank you all, take care.
First of let me mention that I through a search on this forum I found a fantastic presentation on SPI:
ww1.microchip.com/downloads/en/devicedoc/spi.pdf
The section showing the coding was great but there are a few questions that I could use some help with.
- What is FOSC and TCY? How can I tell which one of the setting below to use for 877A to MCP4922?
FOSC/16 (or 4 • TCY)
FOSC/64 (or 16 • TCY)
Timer2 output/2
- Looking at the MCP4922 data sheet I noticed that it reads on the rising edge of the SCK. So I believe that the 877A would need to send its bits on the falling edge of SCK... am I right?
- Is there something that I need to set to let the PIC know that it should send bits on the falling edge of the SCK or is that just how SPI works?
I used the SPI presentation to write code for the 877A, I feel pretty confident in it but...
- The only other thing is if someone want they could take a look at the MCP4922 data sheet and see if there are any things that I may have overlooked that could cause me problems.
Thank you all, take care.