stm32F030F4P6 — 不到NT 8元的32位元單片機

初始運作只需三個外圍器件 , SWDIO跟  SWCLK 要接 10K 電阻(手上沒有10K,我用8.2K 運作也是OK的),Boot0接560R接地即可運作。VDDA,VDD,VSS(GND) ,Boot0(GND) 都要適當接好,不要懸空。 如果要使用 I2C , SPI ,畫板時記得給上 pull-up R ,並預先考慮兩個以上I2C 或 SPI  devices的狀況,預留線路,應該就能使用愉快。唯一的困難是像我這樣的新手,要手焊 tssop20 有點難,需要練習一下。 ram看起來不大,不過一般應用應該是夠了,除非遇到像需要點陣字表這類的東西,很耗費存儲的,那就看情況是否需要加外部存儲。

32位元  mcu   , 32 !! 32 !! 32 !!   up to 48MHZ 

16kB of flash and 4kB of SRAM  , I2C x1  , SPI x 1 , USART x 2 , tssop20 package , with internal clock (HSI) 

cheap , stable , easy to use . 

參考 

https://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

VDD , VDDA –> 3.3V (VDDA  must  >=  VDD)

VSS –> GND

BOOT0 –> R —> GND

SWDIO –> 10K –> adaptor

SWCLK –> 10K –> adaptor

diy a breakout board ? 

hardiest part is soldering mcu chip onto pcb  (for me) , need a little practice .. 

easiest way to download sketch is   stlink-v2, HAL in cubeMX looks like this :

here , we use cubeMx + sw4stm32  as development tool . 

1. in sw4stm32 , create a workspace 

2. in cubeMx ,  assign project location in  that workspace , and check  “Generate Under Root “

3. after generating code , click “open” , then  sw4stm32 start !  enjoy ! 

if encounter any problem when flash  program , in sw4stm32  check  project debug  option . 

project -> properties -> debug/run setting-> edit (or new) 

here , make sure Interface = SWD , Reset = Software , and Frequency must equal to adaptor’s frequency 。 

if we want to use I2C device , ex:  I2C oled , in cubeMx must configure it  right . 

done !   now can try to  upload 1st   program . 

Using OLED 1306  :

copy  inc/ssd1306.h  &  inc/font.h  to   inc/

copy  src/ssd1306.c  &  src/font.c  to   src/

modify  all   stm32fXXX_hal.h   to ur   _hal.h 

done !


if u want to use UART to upload firmware :


VDDA should be connected to power, otherwise chip is in reset state. If package has VSSA – it also should be connected (to GND).

To enter boot mode it is sufficient to connect BOOT0 to power during reset. Do not get confused with absent BOOT1 pin – it is in proper state internally. 设计的时候,就直接把CPU的BOOT1引脚接地(始终为0),就没有BOOT1引脚了

  • pin 16 (VDD) to +3.3
  • pin 5 (VDDA) to +3.3
  • pin 15 (GND) to GND
  • pin 1 (BOOT0) to +3.3
  • pin 4 (RESET) to GND, temporarily
  • pin 17 (USART1_TX) to RX of the FTDI-cable
  • pin 18 (USART1_RX) to TX of the FTDI-cable

Leave a comment

Your email address will not be published. Required fields are marked *