P1220主板串口2问题
还是主板串口2问题,请问有没没有P1220可用的串口调试程序,现在用自己写的程序串口2始终无法使用,我把89,90两管脚直接短接了,让他自收自发,不管我怎么设置都只有串口1是好用的,串口2无法使用……………… 使用之前需要先调用 uart2_init(); [b]回复 [url=http://www.study-bbs.com/redirect.php?goto=findpost&pid=100922&ptid=34633]2#[/url] [i]tomsu[/i] [/b]调用了,是在串口1初始化函数里面把端口都改成了端口2 我的意思是这个[code]
void uart2_init(void)
{
GPIO_ModeSetup(gpio_48_utxd2, 1);
GPIO_ModeSetup(gpio_47_urxd2, 1);
}
[/code]使用之前先把uart2的两个pin设置为串口模式。 [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' huayu_init.c 里有这个函数,直接调用就行了。 谢谢tomsu版主,问题已经解决 不错 :victory:好! 好,要用到串口的,都过来看看
页:
[1]