Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: RX62N RSK

$
0
0
Hello I am doing a simple program on the RSKRS62NS.  Taking an input from SW1 on PORT0 BitO pin C1.  It is connected to VCC through an R and SW1.  When SW1 is press it drives Port00 low. I am trying to set up a simple interrupt from this SW1 on Port00.  My interrupt subroutine turns off  PORTD0 which at this time is on and connected to an LED. When SW1 is pressed,  The PORTD0 LED should go off. I step though each line of my code and monitor the addresses of each register and watch them change appropriately. The issue I have is when I get to where I am setting the IPR of PORT00 pin.  I set it as a 12 just make it a high priority.  As I step into and then past this line, ICU.IPR[28].BIT.IPR register or address remains set to 0.  This is the same as IPL in my PSW so it looks like the CPU will not allow the interrupt. I looked at my PORT reg for PORT00 and it is driven low, my IR[72].IR status flag goes high, so everything seems to be working properly.  For some reason my code is not changing the IPR[28].  I am sure I am doing something wrong but can seem to track it down. Any help is appreciated. Here is the block of code for my interrupt set up of this PORT00. ICU.IER[9].BIT.IEN0=0; /* Disabling the interrupt request.*/ PORT0.DDR.BIT.B0 = 0; // setting Port 0 bit1 as input from SW1 (0= input).// PORT0.ICR.BIT.B0 = 1; // setting Port0 input buffer enabled. IOPORT.PF8IRQ.BIT.ITS8 = 0; // Since PORT0 has 3 potential capabilities need to make sure it is                             //setup as input for IRQ8-A ICU.IRQCR[8].BIT.IRQMD = 0; /* Making IRQ8 a level detect that needs to be driven low*/ ICU.IR[72].BIT.IR= 0; /*Making sure the Interrupt Flag of vector 72 is cleared. Clear this at the begging of your program just in case it has been enabled from running previously.*/ ICU.IPR[28].BIT.IPR = 12;  /*Setting the pins IPR level to 12.*/ ICU.IER[9].BIT.IEN0 = 1; /* Now turning the interrupt source back on */

Viewing all articles
Browse latest Browse all 59170