--- Quote Start ---
originally posted by freezy2000@Aug 11 2005, 11:37 PM
iowr_altera_avalon_uart_control(gsm_uart_base, altera_avalon_uart_status_rrdy_msk);
...
iowr_altera_avalon_uart_status(gsm_uart_base, 0); --- Quote End ---
Is this a custom UART or a modified Avalon UART? If it is custom, this is NOT the line you want to use. You want to use something like IOWR(base, registerNum, value). If it is modified, then you need to fill us in on what modifications you made and why you need them.
Something you should check is that your component's slave port's addressing mode is "registers" and not "memory." IORD() and IOWR() assume they're talking to slaves with register addressing.
Also, the offsets given to IORD and IOWR are 32-bit register offsets; this can get confusing if you haven't messed with it before. Say that there's a device named "foo" in your SOPC design at memory address 0x12000. In system.h, you'll get a definition of FOO_BASE equal to 0x12000. IORD(FOO_BASE, 0) will read the 32-bit value (prepending zeroes if the device's data bus width is less than 32 bits) at 0x12000. IORD(FOO_BASE, 1) will read the 32-bit value at 0x12004. it's easier to think of the register number fed to IORD/IOWR as the index into an array of (unsigned?) ints that has its base address at your device's base address.
This 32-bits-per-register thing extends to the register addressing in the SOPC builder. If your data ports are 16 bits wide, they'll ignore the high 16 bits of IOWR's value, and the high 16 bits of IORD's return value will be all 0. The address offset between registers will still be 32 bits.
As for ISRs in general, you should do as little as possible in them, generally only setting flags that will be checked later in the main program. System library funtions (like printf(), malloc, free, read, write, etc.) should not be called from an ISR, because these routines are generally not reentrant.
Hope this helps.