---
title: "[W7500,W7500P] SPI 어떻게 사용해야하나요?"
url: "https://maker.wiznet.io/forum/12849"
markdown_url: "https://maker.wiznet.io/forum/12849/md"
type: "Forum topic"
category: "General"
author: "irina"
created: "2018-04-12T00:55:30+09:00"
last_activity: "2018-04-12T00:55:30+09:00"
language: "en"
views: 1190
replies: 0
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# [W7500,W7500P] SPI 어떻게 사용해야하나요?

## Question

Asked by irina on 2018-04-12 in General.

SPI를 어떤식으로 사용할것인지를 정해야합니다.
SPI Frame format은Motorola, TI, Microwire 를 지원합니다.

| SPI | description |
| --- | --- |
| Frame format | Motorola, TI, Microwire |
| Data frame size | 4 ~ 16 bits |
| Mode | Master, Slave |
| nSS Control | Software, hardware |

기본적으로 SPI는 표준 프레임인 Motorola 를 사용합니다.

아래는 SPI 기본구성입니다(자세한 사항은 - [W7500 Library Example](https://github.com/Wiznet/W7500) 참조)

```
SSP_InitStruct->SSP_SerialClockRate = 0x00;
/* initialize the SSP_FrameFormat member */
SSP_InitStruct->SSP_FrameFormat = SSP_FrameFormat_MO;
/* Initialize the SSP_CPHA member */
SSP_InitStruct->SSP_CPHA = SSP_CPHA_1Edge;
/* Initialize the SSP_CPOL member */
SSP_InitStruct->SSP_CPOL = SSP_CPOL_Low;
/* initialize the SSP_DataSize member */
SSP_InitStruct->SSP_DataSize = SSP_DataSize_8b;
/* Initialize the SSP_SerialOutputDisable member */
SSP_InitStruct->SSP_SOD = SSP_SOD_RESET;
/* initialize the SSP_Mode member */
SSP_InitStruct->SSP_Mode = SSP_Mode_Master;
/* Initialize the SSP_NSS member */
SSP_InitStruct->SSP_NSS = SSP_NSS_Hard;
/* Initialize the SSP_Synchoronous Serial port member */
SSP_InitStruct->SSP_SSE = SSP_SSE_SET;
/* Initialize the SSP_LoopBackMode member */
SSP_InitStruct->SSP_LBM = SSP_LBM_RESET;
/* Initialize the SSP_BaudRatePrescaler member */
SSP_InitStruct->SSP_BaudRatePrescaler = SSP_BaudRatePrescaler_4;
```

Datasheet를 보고 원하는 기본 세팅을 완료 후 사용하시면 됩니다.
단,
**SSP_Mode = SSP_Mode_Master;SSP_NSS = SSP_NSS_Hard;**
Data만 전송하게 되면, FrameFormat에 따라 데이터가 전송된다.
(nSS 컨트롤 하지 않아도됨)

---

Source: https://maker.wiznet.io/forum/12849
