초보의 아웅다웅 설계하기/STM32 94

STM32F0 PF0(OSC_IN), PF1(OSC_OUT) 사용

PF0, PF1을 사용하기 위해 RCC_DeInit함수 사용 /* For PF0, PF1 */ RCC_DeInit(); GPIO_InitTypeDef GPIO_InitStruct; // AFIO_REMAP_ENABLE(AFIO_MAPR_PD01_REMAP); /* Enable GPIOF clock */ RCC_AHBPeriphClockCmd(PERI_BUTTON, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); GPIO_InitStruct.GPIO_Pin = PIN_BUTTON_0 | PIN_BUTTON_1; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStruct.GPIO_PuPd = GPI..

STM --cpp 옵션으로 인한 에러

C로 컴파일 할 때는 이상없이 되다가 --cpp 옵션을 넣을 경우 에러가 발생 error: #167: argument of type "void *" is incompatible with parameter of type "xxxxxxxxxxxxxxxxx *" void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd) { USBH_LL_IncTimer(hhcd->pData); /* void USBH_LL_IncTimer(USBH_HandleTypeDef *phost); */ } => void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd) { USBH_LL_IncTimer((USBH_HandleTypeDef *)(hhcd->pData)); }

NTC(10k) 수식

NTC의 특성 값이나 회로 부분은 변경하여 사용하여야 합니다. #define REF_RESIST 10000 #define VREF 3.3f /******************************************************************************* * Function Name : * Parameters : None * Return : None * Description : 3.3 : 4096 = x : ADC Vout= (x/(x+10000)) * 3.3 *******************************************************************************/ float Calculation_Vout(u16 a_nhADCValue, ..

ADC128S102, DAC128S085

ADC128S102는 첫 데이터가 들어가고 다음 데이터에서 값이 나오는 것 같습니다. 때문에 값을 받을때는 한 채널씩 뒤로 밀리네요. #if 0 /* datalength 8bit */ #if 0 /* Enable SPI and GPIO clocks */ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); /* Configure SPI pins: SCK, MISO and MOSI */ GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_SPI2); GPIO_PinAFConfig(GPIOB, GPIO_PinSource14, GPIO_AF_SPI2); GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, G..

No section matches selector - no section to be FIRST/LAST. 에러

CubeMX로 프로젝트를 생성 후 나오는 에러 start-up 파일(예 - startup_stm32h743xx.s)이 링크되어 있지 않을 경우 발생 XXX.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST. Not enough information to list image symbols. Not enough information to list load addresses in the image map. Finished: 2 information, 0 warning and 1 error messages. "XXX.axf" - 1 Error(s), 0 Warning(s).

STM32F 자이로 가속센서 MPU6050

Reset 시에 어떤 부분이 틀어져서인지 모르지만 Reset 후 타이밍이 안 맞으면 전원을 완전 제거 후 다시 인가해줘야 하네요.(제가 잘못한 걸수도 있구요.) IC의 전원을 Reset 해주도록 설계 해주는게 맞는거 아닌가 싶긴하네요.(IC 전원만 Load 스위치를 사용하여 다시 Turn-on 시키는게 편할 것 같습니다.) 너무 여기저기 소스를 긁어다 쓰다보니 어디꺼를 가져왔는지도 모르겠네요. ... https://ddtxrx.tistory.com/entry/STM32-LL%EB%93%9C%EB%9D%BC%EC%9D%B4%EB%B2%84-I2C-DMA-MPU6050-%EC%83%81%EB%B3%B4%ED%95%84%ED%84%B0 [STM32] LL 드라이버 - I2C DMA로 작성한 MPU6050 상보..

STM32F DAC, Digital POT

MCP4251 MCP4716 웹에서 돌아다니는 아두이노 코드와 구글링한 코드를 수정하였습니다. https://www.arduino.cc/reference/en/libraries/mcp4251/ MCP4251 - Arduino Reference Reference > Libraries > Mcp4251 MCP4251 Signal Input/Output MCP4251 Digital Pot Control MCP4251 digital potentiometer can be controlled over SPI interface to have resistance range as per the model number. The number of steps can be 128 or 256 depends upon www.ar..