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

PEC problem

I have recently changed my interrupt routines to use the 'using RB_LEVELx' format. This seems to have caused a problem which crashes the I2C module. I have tracked the source to a line of code executed in the EOP interrupt routine. I use the ADC with PEC and at the end of each full conversion cycle the PEC control register needs to be reloaded for the next cycle. Its that line of code which seems to crash the I2C module!

As i say this only became apparent after all interrupts where modified to use reg banks. If i comment out the PEC reload code the problem is solved!

Has anyone had any experience with PEC problems or anything that may help.

Parents
  • Once, I ported a project from Tasking to Keil, register banks were used so I kept using them in the Keil project. There were several interrupts all using their own register bank. Sporadic crashes would ensue, I don't remember all the details but I came to the conclusion that it had something to do with mixing up PEC and reg banking.

    I noticed that if I removed, say exactly 2 register banks, no matter in which interrupt, then the problem would go away.

    Being not very familiar with register banks, I just proved that register banking was not necessary, removed all of them, and that "solved" the problem.

    Let us know if you find the root cause of your problem!

    -Stephane

Reply
  • Once, I ported a project from Tasking to Keil, register banks were used so I kept using them in the Keil project. There were several interrupts all using their own register bank. Sporadic crashes would ensue, I don't remember all the details but I came to the conclusion that it had something to do with mixing up PEC and reg banking.

    I noticed that if I removed, say exactly 2 register banks, no matter in which interrupt, then the problem would go away.

    Being not very familiar with register banks, I just proved that register banking was not necessary, removed all of them, and that "solved" the problem.

    Let us know if you find the root cause of your problem!

    -Stephane

Children