1 Star 0 Fork 0

microchip-pic-avr-examples / pic18f47q10-cnano-spi-slave-receive-mcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

MCHP

PIC18F47Q10 Receiving Data as a Slave SPI Device

Objective

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.

Related Documentation

Software Used

Hardware Used

Setup

The PIC18F47Q10 Curiosity Nano Development Board is used as the test platform.


The following configurations must be made for this project:

  • Clock

    • Oscillator Select: HFINTOSC
    • HF Internal Clock: 64 MHz
    • Clock Divider: 1
  • MSSP1:

    • MSSP1 Enabled
    • Serial Protocol: SPI
    • Mode: Slave
    • Data Mode: 0
  • 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

Operation

  1. Connect the board to the PC.

  2. Open the pic18f47q10-cnano-spi-slave-receive-mcc.X project in MPLAB® X IDE.

  3. 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.

  4. Select the PIC18F47Q10 Curiosity Nano in the Hardware Tool section of the project settings:

  • Right click on the project and click Properties;
  • Select the PIC18F47Q10 Curiosity Nano (click on the SN) in the Hardware Tool tab and then click OK:
  1. Program the project to the board: right click on the project and click Make and Program Device.

Result:

  • Channel 0 -> SCK
  • Channel 1 -> Slave SDI/Master SDO
  • Channel 2 -> Slave SDO/Master SDI
  • Channel 3 -> SS1
  • Channel 4 -> SS2 (for other slave device)

Summary

This project is an illustration for a basic use case based around MSSP1 in SPI mode.

空文件

简介

The PIC18F47Q10 features two MSSP modules, which can be configured in SPI mode. In this demo, the SPI is configured as slave and it is used receive data from a master device. The repository contains the MCC Generated code for the application. 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/microchip-pic-avr-examples/pic18f47q10-cnano-spi-slave-receive-mcc.git
git@gitee.com:microchip-pic-avr-examples/pic18f47q10-cnano-spi-slave-receive-mcc.git
microchip-pic-avr-examples
pic18f47q10-cnano-spi-slave-receive-mcc
pic18f47q10-cnano-spi-slave-receive-mcc
master

搜索帮助