The blockset library provides the mechanism for Simulink I/O blocks to access real hardware pins. There are a variety of general output blocks:
Section 5.1.84, “PWM output — fixed frequency (pdx_PWMOutput)”
Section 5.1.107, “PWM output — variable frequency, synchronised (pdx_PWMSynchronisedOutput)”
Section 5.1.85, “PWM output — variable frequency (pdx_PWMVariableFrequencyOutput)”
Section 5.1.73, “Peak and hold injector output (pdx_PeakHoldInjectorOutput)”
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:
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.
There are two types of I/O on OpenECU hardware: direct and indirect 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 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.
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.