通过两个PIC引脚驱动六只LED灯

  本设计实例展示了仅使用两条MCU的I/O口线驱动六只LED灯的新方法,这种方法尤其适用于任何引脚有限的芯片。这种方法使用了两条I/O口线以及一对互补双极型晶体管。通过多路复用的方法可点亮一只以上的LED灯。

  图1:测试选择PIC10F200,固件以两个独立、简单的汇编程序源代码的方式提供。

  注意:VDD必须在2V和3V之间。例如,如果LED2点亮(表1),那么在VDD过高的情况下,LED4和LED6也将被点亮。可以选择使用任何通用低功率晶体管,但如想使所有LED保持同样的亮度,则需选择低VCE(sat)的晶体管。

  表1:LED驱动逻辑表。避免(0,0)和(1,1)。

  测试选择了PIC10F200,因为PIC10F200是最小、最简单的六引脚MCU。出于示范目的,固件以两个独立、简单的汇编程序源代码的方式提供。

  注意:在任何一种模式下,每次仅采用最小电流(高亮度LED低至2mA)及周期性短脉冲突发模式驱动一只LED灯。汇编程序源代码做了完整注释,优化了长度,不超过256个字,让用户可选择其他任何引脚有限的PIC。

  参考文献:

  [1]Decoder lights the way (EDN | February 19, 2009)

  [2] Microcontroller drives logarithmic/linear dot/bar 20-LED display (EDN | January 18, 2007)

  [3]Squeeze extra outputs from a pin-limited microcontroller (EDN | August 4, 2005)

  [4]Microcontroller's single I/O-port line drives a bar-graph display (EDN | July 6, 2006)

  [5] Drive 12 LEDs with one I/O line (EDN | February 4, 2010)

0次
window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "24" }, "share": {}, "image": { "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "分享到:", "viewSize": "16" }, "selectShare": { "bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren", "weixin"] } }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];

Yidashun supplies Wall Socket and extension Socket for different countries. Power outlet is US, EU, UK, AUS, CN, Japan, and Korea optional. Standard grounding

Power Socket is with switch control and led indicator, and the switch contact is made of high quality silver alloy material, which has a good performance against

electric arc and melt weld. The on-off operations exceed 40000 times. 

Besides, the socket is made of phosphor bronze, which has the character of good electrical conductivity and lasting elasticity. The USB ports on the electrical outlet are 5V2.1A output which are compatible with APPLE ipad (all models), iphone, Android phones and tablet, cell phones, gaming systems, digital cameras, GPS devices and all USB devices. 


extension socket

usb wall socket

wall socket


Socket

USB Socket,USB Wall Socket,Power Socket,USB Power Socket

Shenzhen Yidashun Technology Co., Ltd. , https://www.ydsadapter.com