This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

dose atmel micro hase buge?

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

Parents
  • 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.

Reply
  • 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.

Children