NIOS: alternative to IOWR

NIOS II programming is easy with the default include files and functions. An alternative to write to registers using simple C programming can be the following:


IOWR() uses the ‘stio’ instruction in order to bypass the data cache.

int *sensor_reg0 = (int)*SENSOR_BASE;
*(sensor_reg0) =0xAA;

SENSOR_BASE, which is an address in this example, should have its 31th bit set in order to bypass the data cache.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.