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

Fast Interruption

Hello!

I have configured PORT 2 to have eight fast interruptions. In Keil I can simulate them because I have created different buttons to simulate fast interruptions


define button "ppoAvisoAI",		"PORT2 |=0x0100"
define button "finAvisoAI",		"PORT2 &=0xFEFF"


So I can simulate the fast interruptions and all go on.

But my problem is the following:

I have connected my PC to my starter kit and I want to simulate the fast interruption, but I have problems.

My code id the following:

	while (1)
	{
		printf(menu);
		select=input();

		switch (select)
		{
			case '1': P2_P8=1; break;
			case '2': P2_P8=0; break;
			case '3': break;
		}
	}
So when P2_P8 = 1 is executed the fast interruption doesn't go on.

What can I do?

  • I think you're going to have to toggle the input signal to the port pin (with a wire).

    That's basically what the simulation button you have do.

    Just writing to the ports changes the state of the output latch.

    Jon

  • What you are doing I don't know. If you are going to capture on a pin then it needs to be an input since it is assumed you are on the receiving end of the signal. But if you are felling lucky then you can set the data direction register so the port pin is an output. Then you should get the interrupt when you write to the output latch. Read the XC167CI user's manual under parallel ports to see the diagram for a port configuration.

    You do know that you should not have more than one output driving (push-pull) on the same pin? You run the risk of serious damage to your system.