달력

62024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

'펌웨어'에 해당되는 글 2건

  1. 2020.06.18 STM32 SPI 핀 용어설명
  2. 2020.05.20 stm32 GPIO 설정

SPI ( serial Peripheral Interface ) 시리얼 직렬 통신

 - 1 : N 통신을 지원하는 동기식 통식

 - 하나의 마스터와 하나 이상의 슬레이브 기기가 존재해야 한다.

 

Pin

 - MOSI ( Master Out, Slave In ) - 마스터에서 슬레이브로 데이터 출력하는 Pin

 - MISO ( Master In, Slave Out ) - 슬레이브에서 마스터로 데이터 출력하는 Pin

 - SCK ( Serial Clock ) - Clock 신호 Pin

 - SS ( Slave Select ) - 데이터 송수신할 슬레이브르 선택하기 위한 Pin

   - 다른 이름 ( NCS, CS, NSS, STE, CE( Chip Enable )

 

 

참고 자료 및 사이트

https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi

 

Serial Peripheral Interface (SPI) - learn.sparkfun.com

Introduction Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between microcontrollers and small peripherals such as shift registers, sensors, and SD cards. It uses separate clock and data lines, along with a select line to

learn.sparkfun.com

 

'하드웨어' 카테고리의 다른 글

stm32 GPIO 설정  (0) 2020.05.20
임베디드란 ? (What is Embedded system?)  (0) 2019.11.20
하드 웨어 기초 - 전원, 그라운드  (0) 2019.10.11
Posted by JakeGD
|

stm32 GPIO 설정

하드웨어 2020. 5. 20. 11:51

// include 

#include "stm32f10x_gpio.h"

 

{

// 지역 변수 선언.

GPIO_InitTypeDef GPIO_InitStructure;

 

RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);

 

// 사용할 GPIO Enable 설정
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE);

 

// GPIO 속도 설정

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

 

// Input, Output 설정.

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

 

// INPUT 모드 설정시

//GPIO_Mode_IN_FLOATING -> 버튼, 센서 등등..

//GPIO_Mode_IPU -> 캔통신...

 

// OUTPUT 모드 설정시

//GPIO_Mode_Out_PP -> Lamp, LED 등 사용시.

//GPIO_Mode_AF_PP -> Uart, Can 등 사용시.

 

// input output 은 회로도에 따라 바뀔 가능성 있음.

 

// 핀 설정.

GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_0;

 

// GPIO INIT

GPIO_Init(GPIOD, &GPIO_InitStructure);

 

}

'하드웨어' 카테고리의 다른 글

STM32 SPI 핀 용어설명  (0) 2020.06.18
임베디드란 ? (What is Embedded system?)  (0) 2019.11.20
하드 웨어 기초 - 전원, 그라운드  (0) 2019.10.11
Posted by JakeGD
|