Thanks Bad Omen. The code snippet shown actually works. If I change the index for data from data[0] to data[j] and uncomment the j++ line, i.e., filling an array, the code stops working.
The got_out_data is a flag set somewhere else either the main or an interrupt.
I don't want to waste your time or anyone else's by beating a dead horse. I appreciate the input from you and at least the confirmation that there's nothing glaringly wrong with the bit of code. Perhaps the problem lies somewhere else...
I've managed to get the debugger/breakpoints running, sw breakpoint (
http://forum.niosforum.com/forum/index.php?showtopic=6677), and can hopefully do some detailed debugging rather than changing code and seeing what happens. If I find the cause, I'll gladly post it here.
Thanks.
steve