学者之家电子论坛--打造电子工程师共同致富的平台's Archiver

huleide1982 发表于 2010-4-9 09:32

P1220主板串口2问题

还是主板串口2问题,请问有没没有P1220可用的串口调试程序,现在用自己写的程序串口2始终无法使用,我把89,90两管脚直接短接了,让他自收自发,不管我怎么设置都只有串口1是好用的,串口2无法使用………………

tomsu 发表于 2010-4-9 10:55

使用之前需要先调用 uart2_init();

huleide1982 发表于 2010-4-9 11:22

[b]回复 [url=http://www.study-bbs.com/redirect.php?goto=findpost&pid=100922&ptid=34633]2#[/url] [i]tomsu[/i] [/b]


    调用了,是在串口1初始化函数里面把端口都改成了端口2

tomsu 发表于 2010-4-9 11:24

我的意思是这个[code]
void uart2_init(void)
{
        GPIO_ModeSetup(gpio_48_utxd2, 1);
        GPIO_ModeSetup(gpio_47_urxd2, 1);
}
[/code]使用之前先把uart2的两个pin设置为串口模式。

菜鸟学习 发表于 2010-4-9 11:45

[b]回复 [url=http://www.study-bbs.com/redirect.php?goto=findpost&pid=100940&ptid=34633]4#[/url] [i]tomsu[/i] [/b]


我是在串口1初始化函数里面把端口都改成了端口2,然后加这两句
        GPIO_ModeSetup(gpio_48_utxd2, 1);
        GPIO_ModeSetup(gpio_47_urxd2, 1);
make remake出错
        Error: C2456E: undeclared name, inventing 'extern int gpio_48_utxd2'
        Error: C2456E: undeclared name, inventing 'extern int gpio_47_urxd2'

tomsu 发表于 2010-4-9 11:52

huayu_init.c 里有这个函数,直接调用就行了。

huleide1982 发表于 2010-4-9 14:02

谢谢tomsu版主,问题已经解决

woshichuanqi 发表于 2010-4-9 19:36

不错

chenhe 发表于 2010-4-10 14:12

:victory:好!

chuangyi 发表于 2010-4-10 21:49

好,要用到串口的,都过来看看

页: [1]

Powered by Discuz! Archiver 7.1  © 2001-2009 Comsenz Inc.

302 Found

302 Found


nginx/1.8.0