Hi John,
resodad wrote:How can I send a 16 bit number to port B
In the blockset current version, this is a pain to do as you will have to decompose each bytes of your 16 bits number to feed a write block.
I should probably write another digital write function for this! Anyway, waiting for it, I would recommend to use the C call function block! The C function is quite straight here.
resodad wrote:Also, please clarify the use of "Exact Simultaneous Write" in the digital output block.
In the case that you are writing more than 1 bit,
Actions when exact Simultaneous Write is checked:
- Read port value (on LATx register) and store the value in intermediate variable
- Modify the variable that depends on the values of the the simulink block input.
- Write the resulting variable back to LATx register.
Actions when exact Simultaneous Write is NOT checked:
- Modify the LATx register depending on the values of the simulink block input.
With this last method, bits are modified one by one thus bit change "is not simultaneous".
I hope I make it clear.