4.6.14. Analogue and digital outputs

The blockset library provides the mechanism for Simulink I/O blocks to access real hardware pins. There are a variety of general output blocks:

as well as a way to control the overall status of the output drivers:

and a way to diagnose the status of the electrical connections of some ECU loads:

4.6.14.1. Hardware effects on signals

The functions work at the level of the micro-processor pin but the input and output circuitry of the ECU may change the characteristics of the signal. For instance, the input circuitry may include filtering or inversion. See the technical specification in Section 1.1, “ECU hardware reference documentation” for a description of how the input and output circuitry works for an ECU.

4.6.14.2. External devices

There are two types of I/O on OpenECU hardware: direct and indirect I/O.

Figure 4.13. Signal update rates

Signal update rates

Direct I/O

Direct I/O takes place on demand. The application calls the necessary function and the function takes a measurement or sets a driver accordingly.

Indirect I/O

Indirect I/O is delayed. The application calls the necessary function but the data to be read or set is actioned some time after the function returns.

Indirect I/O always occurs when there is an device between the processor and the pin. The device communicates to the processor across a serial link and it is this communication which introduces the delay. Only I/O channels noted as serial in the technical specification (see Section 1.1, “ECU hardware reference documentation”) are affected.

4.6.14.3. Monitors

Each target ECU provides some measure of feedback for a subset of the output pins. For instance, measuring the reference voltage for A/D conversions to determine if the reference voltage generator has failed. A complete list of the monitors can be found in the technical specifications (see Section 1.1, “ECU hardware reference documentation”). Each monitor is read by using one of the OpenECU blocks to read the monitoring state of an output. For instance, using the pdx_DigitalInput block to read one of the digital state monitors, or the pai_BasicAnalogInput block to read one of the voltage monitors.