I'am working with at91sam7x256 and in my program the usart interrupt dosen't work correctly ! I communicatinon with atmel but it isn't fix yet.
thise is my program...pleas help me
www.4shared.com/.../usart16__2_.html
my mail :salehi.elc@gmail.com
in second time when rx interrupt occur program doesn't go to the irq_handler
this can happen if your MCU gets aborted (data, prefetch, undefined...) during/after IRQ handling.
have you tried a non-interrupt driven variant? thus, polling the UART instead...?
i cant understand your question . can you explain more? the send and receive of my program without interrupt is good and correctly!!!
in similator of keil when i chek registry i see that the other interrupt goto the the pending mode!!! why??
I think the phrase "There are no stupid questions" has once and for all been proven false.
I think you are a little too harsh. The OP must, however, carefully read the user manual and study the multitude of examples that exist to address this problem exactly - some provided by Keil themselves.
Ali,
Let's understand this part of your post, bit by bit...
"the exact problem with this chip is with it's usart RX interrupt that only happens once."
(1) The RX interrupt is only happening once. This means that on power up prior to invoking a test of the uart, all the uart registers are setup properly for RX interrupts to occur (else you would NOT get any). Check the peripheral registers window to see how they are setup, before and after the RX interrupt occurs.
"I set all the registors related to resetting vectors in different approaches,but the problem still goes on !!"
(2) I don't know what this means. You vector to your uart interrupt handler that is located in the IVT. There is one per peripheral. If you are vectoring to your uart interrupt handler, then the vector is properly setup. No need to play with this again.
"In Atmel's sampale transmitting data is performed by interrupt timer..."
(3) OK, so you don't want to use the timer to send data. If there is no data to send and the timer is still running and loading the UART TX data register you will get garbage (whatever it's sending to the uart) out.
(4) Do not assume that is is NOT your code FIRST, regardless of how long you have worked on the problem. There are some REALLY nasty bugs that can happen (memory leaks for starters) that can take FOREVER to track down.
The simplest reason for a interrupt not firing again, if it fired correctly the first time, is because you did not clear/reset the interrupt on exit from the interrupt handler.
...is very often the most likely reason.
If it fired once, then didn't fire again, then that almost certainly means that you didn't put it back into the correct state to fire again.
thanks alot for your reply .
but i have a question about it : you say "..The simplest reason for a interrupt not firing again, if it fired correctly the first time, is because you did not clear/reset the interrupt on exit from the interrupt handler...."
Ok ... if i want reset the interrupt on exit from the irq_handler what work should I do ????what registry should write in or read from it for do it ??? do you now!!! I think that i was SET the all of registry i suggest that they are reset and clear interrupt in end of irq_handler like AIC_EIOC interrupt estatuse and etc that you can see in my code !!
Come on man, how about actually opening the user manual of your processor. Why are you so helpless? Work the problem!
"if i want reset the interrupt on exit from the irq_handler what work should I do ?"
That is really basic stuff - absolutely fundamental to any use of the interrupts!
Do you mean to say that you've been working on this for (over?) 2 months, and you haven't carefully studied that in the datasheet and/or "user manual" and any other documentation you can lay your hands on?!
And with all of this, how could you think it is a buge in the compiler?
NO! I read carefully the datasheet and all user manual about at91sam7x and usart and etc.
if you see my code you see that I do all thing's you say to me for reset interrupt and do that: "...any use of the interrupts!,..." but I have that bug yet...
my problem doesn't basically problem!!
because I search in all of internet and doesn't find any correct sample or example for usart interrupt!!
the all of them had bug and doesn't work correctly
dear tamir...are you think in 2 month what i do ?? I read all of the user manual and data sheet and all see all of the usart sample!!!
but I have that problem yet!!! I don't know why you think that this is a normal bug ?? whay realy??? are you work with usart interrupt hitherto?? realy you can run it witout any bug???
OK, so go right back to basics.
Write a really simple "Hello, world" program that just transmits characters using the UART and interrupts.
When you have that working, add interrupt-driven serial receive.
And so on, step by step...
ok.. thans Mr.neil I doesn't have any problem in send and receive data (without work with interrupt) ...the all of my problem is in interrupt mode .. my usart is realy correct..my RXRDY usart interrupt in basic step doesn't work correctly !!
i doesn't want a big thing from you !!! I only want a one realy basically sample!!only one that work without any bug!!!is in all of the word exist one correct program for it??? if yes pleas send me to rationalization!! but it not exist any correct sample for it what is meaning of that??