久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

標題: Using USART1 on the STM32F4Discovery [打印本頁]

作者: 51heisex    時間: 2016-1-23 02:48
標題: Using USART1 on the STM32F4Discovery
While it was very good of ST to make the fantastically inexpensiveand versatile STM32F4Discovery board, they have made things alittle difficult in the choice of peripherals in places.

I use the board as a test bed for my micromouse code. All themicromouse peripherals are wired up to some perfboard that alsoholds the STM32F4Discovery. The drivers for everything on the mousecan easily be tested and I can experiment with different userinterfaces, motor PWM schemes and sensor combinations. All withoutputting my mouse board at risk.

Generally, this works fine but, for compatibility with my STM32F103code, I chose to use USART1 as the main serial terminal on themouse. The STM32f4Discovery schematic shows that the default pinfor serial TX on this USART is PA9. That is connected to an LED anda 4.7uF capacitor (C49). The pin is used for the VBUS line on theUSB OTG port. The capacitor means that the pin is essentiallyincapable fo doing any useful serial speed at all.

Since I have no interest in using the USB OTG functions, I simplydesoldered the capacitor. Actually, I stood it up on one end sothat I could put it back if ever I had a change of heart.

A further look at the schematic shows that pin PC0 is used toenable the STMPS2141 power switch. This will place 5V on the PA9serial line whenever PC0 is set low. A zero Ohm resistor connectsPC0 to the enable line of this switch so I stood that on end aswell.

Finally, the LED (LD7) is lit when PA9 is high. However, the baseof the driver transistor is not held low so the LED does not turnoff reliably. There are pads available on the board to fit asuitable resistor as R57. I chose a 22k resistor so that 3V on PA9would be enough to turn on the LED but anything less than about 2Vwould not.

Now I get good serial data out of USART1 and I don’t have to worryabout 5V appearing on the line when PC0 is changed. As a bonus, Iget the LED (LD7 at the bottom of the board) telling me when thereis activity on the PA9 line. The TX line will idle high so the LEDis on most of the time.







歡迎光臨 (http://m.zg4o1577.cn/bbs/) Powered by Discuz! X3.1
主站蜘蛛池模板: 国产主播精品 | 久久免费国产 | 在线视频日韩 | 亚洲国产日韩在线 | 一级特黄妇女高潮 | 欧美一级欧美三级 | 双性呜呜宫交受不住了h | 在线观看视频一区二区 | 午夜xxx| 日韩不卡av| 婷婷av在线 | 国产欧美综合一区二区三区 | 中文字幕一二区 | 成人欧美视频 | 国产精品一区二区免费 | 久久精品国产77777蜜臀 | 涩五月婷婷| 日韩一区在线播放 | 中文在线一区二区 | 免费黄色片网站 | 亚洲永久免费 | 国产精品成人一区二区 | 国产综合一区二区 | 黄色片毛片 | 黑人系列合集h | 日本亚洲欧美 | 久久神马| 亚洲综合国产 | 国产网友自拍 | 色婷婷一区 | 99热免费| 国产色视频一区二区三区qq号 | 国产小视频在线观看 | 三级视频在线 | 国语对白做受欧美 | 欧美理伦| 黄色成人毛片 | 视频一区二区在线播放 | 在线观看福利影院 | 亚洲精品久久久久 | 不卡视频在线 |