标题: Lattice芯片ICE40UL1K的RGB脚使用问题 [打印本页] 作者: liuchengyun 时间: 2018-1-9 17:48 标题: Lattice芯片ICE40UL1K的RGB脚使用问题 在使用Lattice的芯片iCE40UL1K的RGB0、RGB1、RGB2做普通IO使用时,在板子上量不到信号,后加上拉电阻300R可以输出信号,加2K以上的上拉电阻就又量不到信号了,各位用过的路过的大神,有知道咋回事的还请指导一下,个人感觉上拉电阻加300R太费电了,请不吝赐教,谢谢。 ' Z& F$ J- G+ y! W2 i; L作者: 超級狗 时间: 2018-1-10 07:57 High Current LED Drive I/O Pins / C% y0 m/ |1 y( K" D+ wThe iCE40 UltraLite family devices offer multiple high current LED drive outputs in each device in the family to allow the iCE40 UltraLite product to drive LED signals directly on mobile applications. There are three outputs on each device that can sink up to 24 mA current. These outputs are open-drain outputs, and provides sinking current to an LED connecting to the positive supply. These three outputs are designed to drive the RBG LEDs, such as the service LED found in a lot of mobile devices. An embedded RGB PWM IP is also offered in the family. This RGB drive current is user programmable from 4 mA to 24 mA, in increments of 4 mA in full current mode or from 2 mA to 12 mA, in increments of 2 mA in half current mode. This output functions as General Purpose I/O with open-drain when the high current drive is not needed. 7 p3 d$ N+ A& o5 r9 I4 d% k9 Z' f {; [8 ~3 g5 n; R5 y
* B% [* ]; x L; y6 m ) E. o! I9 p& C* j作者: 超級狗 时间: 2018-1-10 08:07
User Guide 是這麼說的: 3 w2 T7 A0 `$ t; u8 B/ `+ r H- n+ ^% m" M* s3 y4 `9 c2 T! N Appendix B. Using RGB and IR Pins as User IO, E1 d% D8 @* j6 U+ b: O. s% Y
To use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:( s$ ^; j1 g8 D
* H3 a% O% v3 B9 m: G( v; dmodule top(a,o1);5 ]4 S, Y8 u: r8 _$ w8 \
input a; - U# ]4 q: d2 Q- t: B' c- X: \& t$ Moutput o1;: Q9 S/ @7 b, \# O9 p1 d: P' J: M" g
wire o1i;; O/ H/ E" |" @1 }; q
assign o1i = a;: D% G; v4 o. A" q5 X
SB_IO_OD OpenDrainInst0 5 v0 B: v5 ?- }6 J7 t4 Q" g( ) U/ |: W+ Q1 J9 M2 }; j.PACKAGEPIN (o1), // User’s Pin signal name0 m1 a! V6 [5 H, E
.LATCHINPUTVALUE (), // Latches/holds the Input value 5 v2 h* ~$ a: k# o% j" C( P.CLOCKENABLE (), // Clock Enable common to input and // output clock & R0 X3 D7 N6 W7 z# r' ]3 x.INPUTCLK (), // Clock for the input registers + j5 I2 K y0 Z0 i* l7 q.OUTPUTCLK (), // Clock for the output registers 8 e [0 J1 F' N4 F# L% U* S.OUTPUTENABLE (), // Output Pin Tristate/Enable // control- I" G5 _2 g/ U8 M0 e, j
.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk 5 ^# A; w5 h m/ c( w- _7 Y+ T// edge 1 F' v" j, t7 `2 E. l' V.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge 0 a2 W5 b2 ?6 Y: k# H$ \* C.DIN0 (), // Data 0 - Pin input/Rising clk H3 `- L1 q3 M; ~% {8 g6 E% Y8 R
// edge0 u9 K2 k2 O S7 |' l
.DIN1 () // Data 1 – Pin input/Falling clk // edge y3 ]) F8 I" C
); 9 g# z0 i4 l- p, Q0 f6 Vdefparam OpenDrainInst0.PIN_TYPE = 6'b011001; " s7 ~( `, ^. w- w. L. m! `defparam OpenDrainInst0.NEG_TRIGGER = 1'b0; ( A1 x2 I6 T% ~3 A1 F; Cendmodule& s: d5 `) \& r* n! u0 D% G
( G% W. Z# y2 h% F9 Z0 m* l! |" C' b( { k
5 O9 V; R% Y" [) X5 x 作者: liuchengyun 时间: 2018-1-10 15:35
超級狗 发表于 2018-1-10 08:07 / ?" S3 |5 a, c F6 ?6 {8 i4 w1 mUser Guide 是這麼說的: ( f& p. o0 Q, [+ Z1 W9 Y: H4 M/ ?; c- J' M, D. f2 h
Appendix B. Using RGB and IR Pins as User IO
4 ^: l D7 e' D! f
程序就是照这样写的,opendrain上拉电阻要加到200到300R,RGB脚上才有输出波形,可是这么小的上拉电阻,电流很大很费电,莫非RGB做普通IO时都是这样用的吗4 i* K/ k- Q% Y1 [% F0 E' s 作者: ykwym 时间: 2018-1-12 16:05
为什么要加那么小的电阻,4.7k足够了。作者: liuchengyun 时间: 2018-1-15 11:13