본문 바로가기

STM32-64_Ardu

(12)
[STM32-64 Ardu] STM32F732 Arduino - BNO055 9축 IMU 센서 테스트 STM32F732 Arduino I2C 테스트를 참고 해서 9축 IMU센서 BNO055 센서 모듈을 테스트 해보자. 우선 BNO055 센서 라이브러리를 설치 한다 https://github.com/adafruit/Adafruit_BNO055 BNO055 기본 예제 #include #include #include #include /* Set the delay between fresh samples */ #define BNO055_SAMPLERATE_DELAY_MS (100) // Check I2C device address and correct line below (by default address is 0x29 or 0x28) // id, address Adafruit_BNO055 bno = Adafru..
[STM32-64 Ardu] STM32F732 Arduino I2C 테스트 - TMP100 온도 센서 테스트 STM32F732 보드에서 Arduino I2C 테스트를 진행 해보자. 가장 간단하게 테스트 할 수 있는 SSM 확장 보드를 이용해서 I2C 온도 센서 모듈 TMP100 을 이용하여 온도 값을 읽어오는 예제를 테스트 해 보자. 우선 가장 간단히 I2C로 온도 센서 값을 읽어 올 수 있는 코드를 작성해서 테스트 해보자 #include #define TMP100_ADDR 0x4c float read_temp(unsigned char address) { byte temp_reg = 0; byte a, b; float temp=.0; Wire.beginTransmission(address); // Start transmission Wire.write((byte)temp_reg); // 온도 레지스터 Wire.e..
[STM32-64 Ardu] STM32F732 Arduino Serial 추가 하기 - Bluetooth 모듈 테스트 STM32-64 Ardu Board의 UART는 PA2(TXD), PA3(RXD)에 할당되어 있다. STM32-64 Ardu Board에는 [xBee EVM] 모듈을 연결 할 수 있는 커넥터가 있어 Bluetooth 모듈이나 WiFi 모듈을 테스트 할 수 있다. SM-Type EVM 모듈 커넥터에도 Serial 테스가 가능하다. STM32-64 Ardu Board에서 UART는 USART1, USART2, USART3, UART4, USART6 에 할당 가능하다. STM32F7 Arduino 설정 파일에서 UART로 사용할 수 있는 핀맵을 확인하고 원하는 시리포트를 사용 할 수 있다. #ifdef HAL_UART_MODULE_ENABLED WEAK const PinMap PinMap_UART_TX[] =..
[STM32-64 Ardu] STM32F732 ST7789 TFT LCD 모듈 테스트 (TFT_eSP) [STM32-64 Ardu] 보드에서 ST7789 TFT LCD 모듈은 SSM Type 모듈 커넥터에 연결해서 테스트 가능하다. CS핀은 PB0, DC핀 PC4에 할당되어 있다. 먼저 [STM32-64 Ardu] 보드용으로 셋업 파일을 생성한다. Arduino\libraries\TFT_eSPI_Setups\Setup_ST7789_stm32f7_ardu.h #define TFT_CS PB0 // Define as not used #define TFT_DC PC4 // Data Command control pin #define TFT_RST -1 // TFT reset pin (could connect to NodeMCU RST, see next line) TFT_eSP 기본 예제중 간단한것 하나 테스트 해..
[STM32-64 Ardu] STM32F732 W5500 웹서버 테스트 - 웹서버 기본 뼈대 코드 만들기 STM32F732와 W5500을 이용하여 가장 간단한 웹서버를 만들어 보자. 우선 WebServer구현을 위해 라이브러리를 다운 받는다. https://github.com/khoih-prog/EthernetWebServer 앞으로 사용할 가장 기본이 되는 Webserver 관련 뼈대 코드를 작성해 보자 byte mac[] = {0x00, 0x08, 0xDC, 0x00, 0x00, 0x00}; #include #include "Ethernet_Generic.h" #include #define W5500_CS_PIN PB0 #define LED1_PIN PB2 #define Led1On() digitalWrite(LED1_PIN, 1) #define Led1Off() digitalWrite(LED1_PIN,..
[STM32-64 Ardu] STM32F732 Arduino SPI 속도 테스트 [STM32-64 Ardu] 보드에서 STM32F732의 SPI 클럭 속도를 측정해 보자. Arduino 호환 핀맵의 SPI핀은 SPI1에 할당되어 있다. STM32F7의 클럭최대 속도는 216Mhz이고 SPI로 입력되는 APB2클럭은 108Mhz 이다. SPI 최대 클럭는 APB/2 이므로 54Mhz가 최대 설정값이 된다. SPI초기화 하고 클럭 설정을 하면 SPI.setClockDivider(SPI_CLOCK_DIV2) 54Mhz가 출력 되는 것을 확인 할 수 있다. #include void setup() { Serial.begin(115200); Serial.println("SPI tst.."); delay(1000); SPI.begin(); //SPI.beginTransaction(SPISetti..
[STM32-64 Ardu] STM32F732 Arduino GPIO 테스트 - switch debounce [STM32-64 Ardu] 보드의 내부 LED 및 스위치로 GPIO를 테스트 할 수 있다. arduino-button-library 라이브러리를 이용하여 switch debounce 노이즈 제거 테스트를 해 보자. https://arduinogetstarted.com/tutorials/arduino-button-library STM32F732 Switch Devounce 테스트 Arduino 코드 #include #define LED_PIN1 PB2 #define LED_PIN2 PB6 #define PIN_SW1 PA15 ezButton button(PIN_SW1); // create ezButton object void setup() { pinMode(LED_PIN1, OUTPUT); pinMode..
[STM32-64 Ardu] STM32F405 - Arduino에서 W5500 iperf 네트웍 전송율 테스트 [STM32-64 Ardu] STM32F405에서 W5500 DHCP 테스트 예제를 이용하여 iperf로 W5500의 네트웍 전송율 테스트를 해 보자 우선 W5500 Arduino 라이브러리 파일에서 클럭 속도를 최대치로 설정 한다. \Arduino\libraries\Ethernet2\src\utility\w5500.cpp SPISettings wiznet_SPI_settings(42000000, MSBFIRST, SPI_MODE0); Arduino 에서 iperf 를 이용한 네트웍 전송율 테스트를 하기 위해 TCP Server를 구현 하면 된다. #include #include #define USE_THIS_SS_PIN PB0 byte mac[] = {0x00, 0x08, 0xDC, 0x00, 0x00..

반응형