cancel
Showing results for 
Search instead for 
Did you mean: 

external interrupt

kingspy
Associate
Posted on June 01, 2004 at 10:28

external interrupt

4 REPLIES 4
kingspy
Associate
Posted on May 10, 2004 at 11:14

Hello i program a ST7321J9T3.

The base program fonctions but the interrupt extern doesn't fonction or do anything.

I would create a interrupt at rise edge on PortF ( interupt 3: ei1)

This interrupt scans a keyboard matric and finds the key pushed.

(don't fonction but pass on assembly program)

In my init:

sim();

PFDDR = 0xF0;

PFOR = 0xFF;

EICR=0x08;

...

rim();

and my interruption :

pragma TRAP_PROC SAVE_REGS

void interrupt 3 clav_interrupt()

{...scan keyboard...}

where is the problem please

[ This message was edited by: thespy on 10-05-2004 15:39 ]

jatin
Associate II
Posted on May 12, 2004 at 12:42

Your configuration seems ok. Try the ISR function like:

#ifdef _HIWARE_ /* test for HIWARE Compiler */

#pragma TRAP_PROC SAVE_REGS /* additional registers will be saved */

#else

#ifdef _COSMIC_ /* test for Cosmic Compiler */

@interrupt /* Cosmic interrupt handling */

#else

#error''Unsupported Compiler!'' /* Compiler Defines not found! */

#endif

#endif

void EI2_IT_Routine ()

{

}

[ This message was edited by: Jatin on 12-05-2004 16:13 ]
jbenjamin9
Associate
Posted on May 20, 2004 at 10:29

Quote:

On 2004-05-12 16:12, Jatin wrote:

Your configuration seems ok. Try the ISR function like:

#ifdef _HIWARE_ /* test for HIWARE Compiler */

#pragma TRAP_PROC SAVE_REGS /* additional registers will be saved */

#else

#ifdef _COSMIC_ /* test for Cosmic Compiler */

@interrupt /* Cosmic interrupt handling */

#else

#error''Unsupported Compiler!'' /* Compiler Defines not found! */

#endif

#endif

void EI2_IT_Routine ()

{

}

[ This message was edited by: Jatin on 12-05-2004 16:13 ]

Hi,

I am also stuck up with the same. //To disbale DTC function on Port C

My init goes like this

MISCR2 |= 0x10;

//To enable the interrupt for Port C

MISCR3 |= 0x08;

PCR |= 0x01;

//To configure the PortsB0- PortsB7 as output(for LED)

PBDDR |= 0xFF;

PBDR = 0x00;

PBDR |= 0x3F;

//Configure PortC outputs as Interrupt Enable and inputs

PCDDR = 0x00;

PCOR |= 0x3F;

I am using Port C external Interrupt

#pragma TRAP_PROC SAVE_REGS

void interrupt 9 Keyboard_Interrupt( void)

{

//Test 1 column value

PBDR &= 0x00;

asm iret;

}

can u guide me?

Thanks and regrds,

S.Vidhya

juhee
Associate II
Posted on June 01, 2004 at 10:28

One Point on your configuration VIdhya for ST72F65 external interrupts:

- The DTC controlled pins can not be supplied with a voltage greater than VDDF. In your case you have enabled the Internal Voltage regulator (PCR |= 0x01), so VDDF will be between 2.6 to 3.5 depending upon the configuratio of PCR register. Thus if you are giving more than this voltage on the PortC, then Pins could get damaged.

Thus

1. Either you should switch off the internal regulator and supply VDDF with 5V

2. Or do not supply the port pins with more than 3.3 V.

Also you can try using Non-DTC ports and Set the priortiy of your interrupt at highest in ISPRx register