Embed lets you access most of the resources available on a target. Managed resources include timer counters, GPIO pins, DMA, CAN, PWM, QEP, CAP, UART, SCI (serial), I2C, SPI, ADC, watchdog, and power reset.
Embed installs an interrupt handler that executes the main body of the C code from your diagram. You can select the source of the interrupt in the corresponding Target Config dialog box. If you are using the debug diagram the sample rate set in the Target Interface block is transmitted to the target via the HotLink interface. This allows easy experimentation with the base sampling rate of your algorithm on the target.
Peripheral devices like analog and digital ports on the target can be accessed by simply dragging the corresponding block off the Embedded menu. The blocks can access their corresponding ports immediately without target code generation and will also access the ports when compiled as part of a target system downloaded to execute on the target. For the PC32 board, there is no muxing logic for analog I/O channels, and thus interrupts are enabled across analog I/O ports accessed by Embed.
During a simulation run, data is continuously sent from the host to the target and target data is continuously sent back to the host via the HotLink interface. This data movement between host and target is managed during the target idle time between timer interrupt processing. As the timer interrupt rate increases, less time is available to the idle process to update the host, and the host will see less frequent updates. However, since priority is given to the timer interrupt task, the algorithm running on the target will manage analog and digital I/O with no interruption.