2004-06-01 01:28 AM
2004-05-10 02:14 AM
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 ]2004-05-12 03:42 AM
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 ]2004-05-20 01:29 AM
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.Vidhya2004-06-01 01:28 AM
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