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
and if you want know more about my problem , in my program when the first interrupt occur program do all of inn irq_handler function. but in second time when rx interrupt occur program doesn't go to the irq_handler !!! like that the vector of the previous interrupt dosen't reset!!! i don't know why exactly?? but i think some one should help me because more than 2 month I work tray to solve problem but it's goes on yet!
have you noticed that you blame everyone and everything whilst this is most likely one of your glitches? to make matters worse, you have started this rampage of accusations before actually understanding what's going on.
if it's problem is for bud rate or my pc setting the all of byte receive must be wronge but if you see the image of my problem you can see that the some of bit have problem not all of them !!!
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??
oooh!! i only had a one question ..if you was in my chair and had my problem you was like me ! pleas help me :(!
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?