- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all.
I am fairly new to NIOS II development, although I have been working with Altera FPGA's for some time. I need to implement serial ports and have been fighting with the NIOS II UART IP for several days. I have finally determined that the Altera provided UART does not seem to have a proper interrupt handler or is not smart enough to keep from overwriting the TX buffer on the UART. The behavior is that any data sent from the NIOS II to the UART only arrives back in Hyperterminal if I put a usleep() call after writing each byte. If I don't, bytes get corrupted. So, I decided to switch to the FIFO'ed Avalon UART from this site. When I run my NIOS II code in the debugger, it never even hits the first breakpoint in my mian() routine. If I then pause execution, the processor is always looping either in the FIFOed UART's interrupt handler (fifoed_avalon_uart.c), or in the system source that checks for any active interrupts (alt_irq_handler.c). I am not using an OS - just straight up NIOS C/C++ code. Is this the problem? I've done a lot of embedded code over the years, and you should not need an OS to implement an IRQ handler, unless I don't understand something fundamental about how the NIOS works. Any advice is appreciated. I am running Quatus 9.0 sp1. Thanks! JimLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As an update to my posting, I regenerated the SOPC again, recompiled and downloaded the FPGA design, then went back and rebuild the system library. Now I hit my first few breakpoints, but no serial data seems to go through the FIFO'ed UART, and any time I break the code is in the UART interrupt handler....
Jim- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jim,
Unfortunately a huge number of threads about UARTs from the last 2 years has been wiped from this forum along with everything else. As an embedded programmer you should be pleased to know that the NIOS UART can be handled exactly like the UARTs you know and love. I and many others use the standard UART extensively with no OS, no HAL drivers, just good old Receiver Full/Transmitter Empty interrupts. It should work exactly as you'd expect. Cheers Sharkybaba
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page