久久久久久久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://www.zg4o1577.cn/bbs/) Powered by Discuz! X3.1
主站蜘蛛池模板: 国产亚洲一区二区精品 | 久久精品超碰 | 亚洲精品久久久久中文字幕欢迎你 | 亚洲男人的天堂网站 | 国产7777 | 黄色a三级 | 国产精品一区二区久久精品爱微奶 | 99视频网站 | 91色啪| 国产精品日日做人人爱 | 欧美一区二区小视频 | 亚洲综合无码一区二区 | 亚洲国产一区二区三区在线观看 | 四虎影院新地址 | 欧美男人天堂 | 久久合久久 | 91精品国产麻豆 | 日本一区二区三区视频在线 | 日韩欧美国产一区二区 | 日本高清中文字幕 | av激情影院 | 九色一区 | 亚洲美女一区二区三区 | 精品一区二区久久久久久久网精 | 91高清在线观看 | 国产区在线看 | 久久精品99| 91免费视频 | 亚欧洲精品在线视频免费观看 | 99re在线播放| 一级片在线视频 | 在线免费观看欧美 | 久久久久久国产精品 | 久久亚洲一区二区三区四区 | 久热国产精品视频 | 久久久久久久亚洲精品 | 99re热这里只有精品视频 | 国产97色| 亚洲精品一区二区三区中文字幕 | av资源网站 | 羞羞色视频 |