Altera_Forum
Honored Contributor
21 years agoMultiple serial port misbehavior
Quartus 4.1, Nios1.01:
The NiosII system has 2 uarts, a primary debug terminal@115K baud, and a secondary half-duplex slave device@19.2K baud. During operation lots of printf output (from many uCos tasks) goes out to the terminal (a PC running hyperterm) to be logged. There is no input on this uart. A dedicated task talks to a 2nd serial slave device. You send this device a short ascii string, and it returns 100 or so ascii chars terminated with cr. When tested directly with hyperterm, the device works OK. When tested on the NiosII system, I am losing chars both on input and output for the 2nd uart. There appears to be a dependancy between the uarts such that as long as the primary uart is sending out chars, the secondary uart is getting partially or fully blocked. Changing the uart assignments ie. 1st uart is for slave device, 2nd uart is for terminal, did not fix the lost char issue with the slave device. Currently I am using fopen(),fgetc(), fputc() for this uart, and will try switching to open(),read(),write() to see if it makes a difference. Any ideas? thanks