Altera_Forum
Honored Contributor
10 years agoUart status false receive after clear
hello everyone,
i built a nios cpu with qsys in quartus 13 , i added to the qsys the uart of altera. i open the eclipse and write a code that wait for 256 byte that suppose to incoming throw the uart from the computer. the code is : mask status register with 0x80 and all of this ( i did it before at quarture 9 and the old nios ide - work well). anyway , the comuter send me the 256 bytes i receive all of them perfectly, the problelm is when i done to receive 256 bytes and go back to the for loop and waiting to the first byte of the next 256 , the check of the status with 0x80 return immediately true and the comuter didnt send anything he send only one frame of 256. when i pass the if the return true in the status register i get the byte to see what it is and the byte that found in the register is the last byte of the frame that i received perfectly, its mean if i have an array1 of 256 (0-255) the frame found in this array - in array1[255] i have the last byte , and i start waiting to another frame and i get immediately to array2[0] the last byte of the first frame again ,even if i read it already. i don't get it , there some init that i need to do to some registers and i don't know about this? how it possible that i take the last byte from the register and this byte stay there and the rrdy in the status register say there another byte even if i take hime already and clear the status bit. for sure the comuter doesn't send another frame only one, i even changed the frame and always the last byte of the frame receive again. please help