This repository contains an example of MCC generated source code for SPI as described in TBxxxx - Getting Started with SPI using MSSP on PIC18 document from Microchip.
In this demo, the SPI will be configured as slave and it will be used to receive data from a master device.
The PIC18F47Q10 Curiosity Nano Development Board is used as the test platform.
The following configurations must be made for this project:
Clock
MSSP1:
Watchdog Timer: disabled
Low-voltage Programming: enabled
Pin | Configuration |
---|---|
RA5 (SS) | Digital Input |
RC3 (SCK) | Digital Input |
RC4 (SDI) | Digital Input |
RC5 (SDO) | Digital Output |
Connect the board to the PC.
Open the pic18f47q10-cnano-spi-slave-receive-mcc.X project in MPLAB® X IDE.
Set pic18f47q10-cnano-spi-slave-receive-mcc.X project as main project. Right click on the project in the Projects tab and click Set as Main Project.
Select the PIC18F47Q10 Curiosity Nano in the Hardware Tool section of the project settings:
Result:
This project is an illustration for a basic use case based around MSSP1 in SPI mode.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。