## Example Summary
Note: The use of "Master" and "Slave", along with "MOSI/MISO" terminology is being considered obsolete. These terms will be replaced with "Controller" and "Peripheral", and "PICO/POCI" respectively.
The following example configures the SPI as a Controller.
This example uses the CD/CS3 line as a signal to distinguish between Command and Data information.
- C/D level low: command information
- C/D level high: data information
When a value is written into the CTL1.CDMODE bits the C/D line will go low for the given numbers of byte which
are sent by the SPI, starting with the next value to be transmitted. After the number of bytes are transmitted the
C/D will be set to high automatically.
After all transmits have been performed, the LED will toggle to indicate completion.
## Peripherals & Pin Assignments
| Peripheral | Pin | Function |
| --- | --- | --- |
| GPIOA | PA0 | Open-Drain Output |
| SYSCTL | | |
| SPI1 | PB9 | SPI SCLK (Clock) |
| SPI1 | PB8 | SPI PICO (Peripheral In, Controller Out) |
| SPI1 | PB7 | SPI POCI (Peripheral Out, Controller In) |
| SPI1 | PB6 | SPI CS0 (Chip Select 0) |
| SPI1 | PB1 | SPI CS3/CD (Chip Select 3/Command Data) |
| EVENT | | |
| DEBUGSS | PA20 | Debug Clock |
| DEBUGSS | PA19 | Debug Data In Out |
## BoosterPacks, Board Resources & Jumper Settings
Visit [LP_MSPM0G3507](https://www.ti.com/tool/LP-MSPM0G3507) for LaunchPad information, including user guide and hardware files.
| Pin | Peripheral | Function | LaunchPad Pin | LaunchPad Settings |
| --- | --- | --- | --- | --- |
| PA0 | GPIOA | PA0 | J27_9 | <ul><li>PA0 is 5V tolerant open-drain so it requires pull-up<br><ul><li>`J19 1:2` Use 3.3V pull-up<br><li>`J19 2:3` Use 5V pull-up</ul><br><li>PA0 can be connected to LED1<br><ul><li>`J4 ON` Connect to LED1<br><li>`J4 OFF` Disconnect from LED1</ul></ul> |
| PB9 | SPI1 | SCLK | J1_7 | N/A |
| PB8 | SPI1 | MOSI | J2_15 | N/A |
| PB7 | SPI1 | MISO | J2_14 | N/A |
| PB6 | SPI1 | CS0 | J2_13 | N/A |
| PB1 | SPI1 | CS3_CD_MISO3 | J4_39 | N/A |
| PA20 | DEBUGSS | SWCLK | N/A | <ul><li>PA20 is used by SWD during debugging<br><ul><li>`J101 15:16 ON` Connect to XDS-110 SWCLK while debugging<br><li>`J101 15:16 OFF` Disconnect from XDS-110 SWCLK if using pin in application</ul></ul> |
| PA19 | DEBUGSS | SWDIO | N/A | <ul><li>PA19 is used by SWD during debugging<br><ul><li>`J101 13:14 ON` Connect to XDS-110 SWDIO while debugging<br><li>`J101 13:14 OFF` Disconnect from XDS-110 SWDIO if using pin in application</ul></ul> |
### Device Migration Recommendations
This project was developed for a superset device included in the LP_MSPM0G3507 LaunchPad. Please
visit the [CCS User's Guide](https://software-dl.ti.com/msp430/esd/MSPM0-SDK/latest/docs/english/tools/ccs_ide_guide/doc_guide/doc_guide-srcs/ccs_ide_guide.html#sysconfig-project-migration)
for information about migrating to other MSPM0 devices.
### Low-Power Recommendations
TI recommends to terminate unused pins by setting the corresponding functions to
GPIO and configure the pins to output low or input with internal
pullup/pulldown resistor.
SysConfig allows developers to easily configure unused pins by selecting **Board**→**Configure Unused Pins**.
For more information about jumper configuration to achieve low-power using the
MSPM0 LaunchPad, please visit the [LP-MSPM0G3507 User's Guide](https://www.ti.com/lit/slau873).
## Example Usage
Make the following connections between the SPI Controller and SPI Peripheral:
- Controller SCLK -> Peripheral SCLK
- Controller PICO -> Peripheral PICO
- Controller POCI <- Peripheral POCI
- Controller CS -> Peripheral CS
- Controller CD -> Peripheral CD
Compile, load and run the example. The SPI will automatically start
to transmit and receive data.
## Application Design Details
The SPI is initialized with the following configuration:
- SPI Controller
- Motorola 4 Wire with Polarity 0, Phase 0
- No parity
- 8 bits per transfer
- MSB first
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
测试_共享_1.54英寸_纸_带_MSP_纸_1_54_mspm0_Testing_the_waveshare_1.54inch_epaper_with_the_MSP_epaper_1_54_mspm0.zip (41个子文件)
epaper_1_54_mspm0-main
.cproject 16KB
.settings
org.eclipse.cdt.codan.core.prefs 59B
org.eclipse.core.resources.prefs 202B
org.eclipse.cdt.debug.core.prefs 121B
.ccsproject 1KB
LICENSE.txt 1KB
LICENSE 1KB
epaper_1_54_testing.syscfg 1KB
.launches
epaper_1_54_testing.launch 5KB
spi_controller_command_data_control_LP_MSPM0G3507_nortos_gcc.launch 5KB
epd1in54_V2.c 14KB
targetConfigs
MSPM0G3507.ccxml 2KB
readme.txt 798B
README.html 71KB
epd1in54_V2.h 3KB
epaper_1_54_testing.c 5KB
.project 822B
Debug
makefile 4KB
device.opt 17B
epaper_1_54_testing.o 56KB
ti_msp_dl_config.o 64KB
spi_controller_command_data_control.d 10KB
epaper_1_54_testing.out 209KB
device_linker.lds 5KB
ti_msp_dl_config.c 5KB
sources.mk 2KB
ti_msp_dl_config.d 10KB
spi_controller_command_data_control_LP_MSPM0G3507_nortos_gcc.map 35KB
spi_controller_command_data_control_LP_MSPM0G3507_nortos_gcc.out 209KB
epaper_1_54_testing.map 35KB
subdir_rules.mk 3KB
Event.dot 1KB
startup_mspm0g350x_gcc.d 141B
epaper_1_54_testing.d 10KB
subdir_vars.mk 1KB
objects.mk 278B
ccsObjs.opt 153B
device.lds.genlibs 3KB
ti_msp_dl_config.h 5KB
startup_mspm0g350x_gcc.o 7KB
README.md 4KB
共 41 条
- 1
资源评论
好家伙VCC
- 粉丝: 2041
- 资源: 9145
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功