初始運作只需三個外圍器件 , 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 . VDD , VDDA –> 3.3V (VDDA must >= VDD) VSS –> GND BOOT0 –> R —> GND SWDIO –> 10K –> adaptor SWCLK –> 10K –> adaptor diy a breakout board ?
20181022_002532.jpg (54.94 KB, 下載次數: 49)
下載附件
2018-11-1 12:51 上傳
hardiest part is soldering mcu chip onto pcb (for me) , need a little practice ..
easiest way to download sketch is stlink-v2, so simplest HAL in cubeMX looks like this :
2018-10-24_2121.png (90.33 KB, 下載次數: 39)
下載附件
2018-11-1 12:51 上傳
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 !
2018-10-24_2125.png (31.25 KB, 下載次數: 42)
下載附件
2018-11-1 12:51 上傳
if encounter any problem when flash program , in sw4stm32 check project debug option . project -> properties -> debug/run setting-> edit (or new)
2018-10-24_2157.png (33.9 KB, 下載次數: 50)
下載附件
2018-11-1 12:51 上傳
2018-10-24_2203.png (66.06 KB, 下載次數: 48)
下載附件
2018-11-1 12:51 上傳
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 .
2018-10-24_2135.png (40.37 KB, 下載次數: 37)
下載附件
2018-11-1 12:51 上傳
2018-10-24_2138.png (28.74 KB, 下載次數: 42)
下載附件
2018-11-1 12:51 上傳
2018-10-24_2140.png (22.43 KB, 下載次數: 36)
下載附件
2018-11-1 12:51 上傳
done ! now can try to upload 1st program .
Using OLED 1306 :- driver : https://github.com/4ilo/ssd1306-stm32HAL
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
|