1. c8051f series single-chip microcomputer, Io configuration is as follows:
Push-pull output,Push-pullYou can directly drive an external chip without the need for an external driving circuit.
When pushing the output, the port output is high,NMOSDeadline,PMOsTurn onIoPort height; port output is low,PMOsDeadline,NMOSTurn onIoLow port pulling, suitable for driverTTLLoad,LEDOr used for data or clock transmission during communication;
Open drain,Open-Drain, Need to apply a resistor to the power supply.
When the output is exposedPMOsForbidden, only retainedNMOSWhen the port output is low,NMOSTurn onIoBut the output port is usually high,NMOSAs of now, the port has no high-impedance floating status output), IfAdd external pull-up ResistanceThe output is changed to a high level.1Suitable for wire and/or useI2CCommunication.
Analog input,Analog in
When the simulated input is enabledIoMethod will be disabled, and the analog signal goes through onePass GateSentMCUInternalADC;
Number input,Digital in
When a number is entered,IoThe output is forbidden. The digital signal goes throughSchmitt trigger(Schmidt trigger) Is sent to the internal logic.
Note that whenIoWhen the port is used as the input port:
There are two methods:
1),DisableIoOutput, which is a digital input. Note that allIoPort output methods are disabled.
2),ConfiguredOdMethod. At this time, the external high level will be maintained, and the low level willIoLow.
Normally, the input is interrupted and can be configured in this way during data input.
2.With the IO configuration of c8051f, we can see that the actual internal logic of the IC changes when different Io modes are configured. At the same time, we can understand the internal logic of the IC Io through actual understanding, some Questions about Io operations will be answered:
(1) Io input levels generally have a threshold. For example, if 0-1.8 V is regarded as low and-3.3v is regarded as high, who specifies this? If 2 V is input, is it true that some circuits are not working?
>As described above, when used as a digital input, the digital signal enters the internal logic through the Schmidt trigger. The Schmidt trigger is characterized by two thresholds, high and low, when the input level exceeds the high threshold, the trigger outputs high (VCC). When the input level is low or low, the trigger outputs Low (Gnd). Of course, this is a simple description, but it can be implemented, and there are many ways to implement the Schmidt trigger, with a high cost.
To be continued.