|
本帖最后由 超級狗 于 2013-6-5 10:17 编辑 # v5 z. Y n% G; l! f; @. z0 v4 c
风吹摇摆 发表于 2013-6-5 09:02 % f2 @9 N7 M+ g( Q* q
不是上拉电阻的问题是输出电路的问题,都是推挽输出但是一种是TTL电平一种是CMOS电平。TTL电路的速度快, ... 6 @4 d% ]; m. O" K" F, d- Y( g( N
S- n, o9 [) [
Push-Pull 不一定是 TTL,CMOS 也有 Push-Pull。
8 M9 \2 M3 E: h/ V p. \7 u2 N+ `6 ^; K+ b& C
樓主說換了 AT89S51 後就推不動 LED,照文字敘述應該是什麼都沒變只換 CPU。所以我排除是軟件設定的問題,即便是 AT89C51 和 AT89S51 I/O Port 也可以設定成 Push-Pull 輸出,但他們設錯了。
$ m( c/ {% }% Y) Y6 p' j
( b& i! N, D4 t% Z% T但你仔細看芯片資料,Port 0 他直接跟你講是 Open Drain。Port 1 ~ 3 示意圖看起來也都是 Open Drain,差別只在於 Port 2 內部的上拉電阻可以被控制。! G: h9 i3 C7 J2 L1 S( f9 ~/ g
( P9 O( X* @ i* K$ i3 f" b
我知道有些 8051 的 I/O Pin 可以被設為好幾種模式(Push-Pull 是其中一種),但它們會被畫成像最後一張圖那樣(節錄自 新唐電子 NuvoTon 8051 芯片資料)。對於 ATMEL 這兩個系列,我從 I/O Port 結構圖看不出他們可以被設為 Push-Pull。但我也說過,芯片資料內容少得可憐,除非他們有不能說的秘密沒講出來。0 S" ?6 W2 j! m/ @
' C, A! P( c2 z# t2 G# A0 T# s
Port 0:5 e, x+ X/ q% O% [ r1 m& m
Is an 8-bit open drain bi-directional I/O port. Port 0 pins that have 1’s written to them float, and in this state can be used as high-impedance inputs. Port 0 is also the multiplexed low-order address and data bus during accesses to external Program and Data Memory. In this application it uses strong internal pull-ups when emitting 1’s. Port 0 also outputs the code Bytes during program validation. External pull-ups are required during program verification.
% ~1 i5 ]% c. I! H- S8 w7 a; i. P/ `0 d% q! b4 t/ T8 z! P
{:soso_e113:}
* ^8 a4 X g4 o1 v" F' ^6 D
0 }. [: Z# u) v0 z. ~) f; J- ^; t; a |
|