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

 找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

搜索
查看: 2938|回復(fù): 0
打印 上一主題 下一主題
收起左側(cè)

Using USART1 on the STM32F4Discovery

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:104126 發(fā)表于 2016-1-23 02:48 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
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.


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 青青草精品| 欧美日韩国 | 青娱乐99 | 俺去俺来也在线www色官网 | 中文字幕高清在线 | 午夜视频免费 | 免费黄色一级 | 日韩成人中文字幕 | 成人精品免费视频 | 日韩精品一区二区三区中文在线 | 日韩亚洲一区二区 | 国产精品国产精品国产专区不卡 | 久久久久久网站 | 久久在线精品 | 亚洲一级在线 | 精品福利一区 | 国产美女自拍视频 | 国产一区欧美 | 五月天视频 | 精品一二三区 | 91网站免费看 | 国产精品视频久久 | 亚洲精品色 | 日韩一级大片 | 精品毛片一区二区三区 | 天堂免费av | 黄视频网站在线观看 | 国产精品久久久久久中文字 | 成人免费毛片入口 | 亚洲狠狠| 日韩在线免费视频 | 四虎久久 | 国产女人高潮视频 | 精品综合网 | 亚洲视频在线一区 | 国产成人a亚洲精品 | 久久综合爱 | 国产视频一区二区在线 | 欧美在线观看一区二区 | 亚洲黄色av | 天天操天天干天天 |