关于arduino uno 0, 1, 13管脚无法使用的问题

1、关于0和1管脚 io正常使用的问题

 0和1管脚主要是用于串口通信的,已经被板子本身用了,如果我们去用的话,会导致usb无法往板子下载程序。会报类似以下错误:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

 

2、关于13管脚无法用像其它io正常使用的问题,参见以下说明,主要还是被板子是bootloader使用了。

参见:https://arduino.stackexchange.com/questions/1448/whats-the-deal-with-unos-pin-13-led

 

The LED on pin 13 is used by the optiboot loader (the one used on UNO):

  • at Arduino boot time (the LED blinks a few times)
  • when uploading a sketch to Arduino

I haven't checked other bootloaders, they may provide the same behavior as the optiboot.

For optiboot, there are optional defines (at compile time) to modify this behavior:

  • LED_START_FLASHES defines the number of flashes of pin 13 LED at boot time (can be set to 0)
  • LED_DATA_FLASH will use pin 13 LED during sketch upload if defined at compile-time

These defines are explained in hardware/arduino/bootloaders/optiboot/optiboot.c from within your Arduino IDE install directory.

If you want to change these, you will have to recompile the optiboot loader first and then burn it to your Arduino through an ISP programmer.

I guess one other reason for the LED on pin 13 was to simplify the demonstration of the "Hello World" sketch for Arduino, namely the Blink sketch, without the need for any extra component.

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值