OpenCores

External Interrupt doesn't work properly

Back to bugtracker overview.

Information:
Type :: BUG
Status :: OPENED
Assigned to ::

Description:
After a succesful interrupt, the INTE flag is set back. So no more external Interrupt ist possible anymore. So the INTE status has to be saved and set back to the old status before returning from the inerrupt routine.

Comments:

Radu, Ben Jan 23, 2007
I think the reason is that any access on the INTCON register (in an interrupt you access it to check the flags) actually writes that reg. It is because of a missing condition on File_Wr in P16F84.vhd file.
Solution:
Replace the line
"if to_integer(unsigned(File_Addr_r(6 downto 0))) = 11 then"
with
"if to_integer(unsigned(File_Addr_r(6 downto 0))) = 11 and File_Wr='1' then"
Be aware that the OPTION register implementation suffer from the same problem. To fix it replace
"to_integer(unsigned(File_Addr_r(7 downto 0))) = 129 then"
with
"(to_integer(unsigned(File_Addr_r(7 downto 0))) = 129 and File_Wr='1') then"

Good luck.
Radu, Ben Jan 23, 2007
I think the reason is that any access on the INTCON register (in an interrupt you access it to check the flags) actually writes that reg. It is because of a missing condition on File_Wr in P16F84.vhd file.
Solution:
Replace the line
if to_integer(unsigned(File_Addr_r(6 downto 0))) = 11 then
with
if to_integer(unsigned(File_Addr_r(6 downto 0))) = 11 and File_Wr='1' then
Be aware that the OPTION register implementation suffer from the same problem. To fix it replace
to_integer(unsigned(File_Addr_r(7 downto 0))) = 129 then
with
(to_integer(unsigned(File_Addr_r(7 downto 0))) = 129 and File_Wr='1') then
Good luck.
Radu, Ben Jan 23, 2007
I think the reason is that any access on the INTCON register (in an interrupt you access it to check the flags) actually writes that reg. It is because of a missing condition on File_Wr in P16F84.vhd file.
Solution:
Replace the line
if to_integer(unsigned(File_Addr_r(6 downto 0))) = 11 then
with
if to_integer(unsigned(File_Addr_r(6 downto 0))) = 11 and File_Wr='1' then
Be aware that the OPTION register implementation suffer from the same problem. To fix it replace
to_integer(unsigned(File_Addr_r(7 downto 0))) = 129 then
with
(to_integer(unsigned(File_Addr_r(7 downto 0))) = 129 and File_Wr='1') then
Good luck.

Post a comment:
Login to post comments!

Back to bugtracker overview.

© copyright 1999-2012 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.