Searching \ for 'Interrupt level problem?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ints.htm?key=interrupt
Search entire site for: 'Interrupt level problem?'.

Truncated match.
PICList Thread
'Interrupt level problem?'
1998\08\18@085035 by Sylvain Bilanger

picon face
Hi again everybody,
I'm trying to use the RCIF interrupt to receive data from another PIC,
but the interrupt never occures i find that bizarre. The only thing that
i got is infinite loop in my main.. and when there's an interrupt i want
to service it... but nothing works. If someone could help it would be
appreciated.  Here is a sample of my source:

void main()
{initialise();
while(1){}}

void initialise()
{
GIE = 0;   /* Disable les interruptions */
TRISA = 0x00;     // 0000 0000 porta en output
TRISB = 0x00;     // 0000 0000 portb en output.
TRISC = 0xC0;     // 1100 0000 portc en 7:6 TX/RX
/* configuration du USART pour un master asynchrone */
SPBRG = BaudRate;
TXSTA = 0x82;     // 1000 0010 ... Mode Master, USART asynchrone,
Baudrate asynchrone
RCSTA = 0x90;     // 1001 0000 ... Enable le Port serie
TXIE = 0;         // Disable the USART transmit interrupt
RCIE = 1;         // Enable reception interrupt
GIE = 1;          // Enable interruptions
compte = 1;
}

void interrupt receive(void)
{
if(RCIF == 1)
{
 switch(compte)
 {
  case 1: temp1 = RCREG;
          compte++;
          RA0 = 1;
          break;

  case 2: temp2 = RCREG;
          if(temp1 == temp2) compte++;
          else temp1 = temp2;
          RA0 = 0;
          RA1 = 1;
          break;

  case 3: temp3 = RCREG;
          if(temp1==temp2==temp3)
          {
           PORTB = temp3;
           compte = 1;
          }
          else
          {
           temp1 = temp3;
           compte = 2;
          }
          RA1 = 0;
          RA2 = 1;
          break;
  default:RA4 = 1;
  }
}
}

if anyone as an idea why it never goes to the interrupt routine please
help!!

Sylvain

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

1998\08\18@164817 by Clyde Smith-Stubbs

flavicon
face
On Tue, Aug 18, 1998 at 05:48:20AM -0700, Sylvain Bilanger wrote:
> Hi again everybody,
> I'm trying to use the RCIF interrupt to receive data from another PIC,
> but the interrupt never occures i find that bizarre. The only thing that

You didn't say which device you're using, but the usual reason for this is
that you have not set PEIE. Read the data sheet section on interrupts, and
especially look at the logic diagram that shows the various interrupt sources.
Many of the "non-core" interrupts are gated with PEIE as well as GIE.

Cheers, Clyde

--
Clyde Smith-Stubbs               |            HI-TECH Software
Email: spam_OUTclydeTakeThisOuTspamhtsoft.com          |          Phone            Fax
WWW:   http://www.htsoft.com/    | USA: (408) 490 2885  (408) 490 2885
PGP:   finger .....clydeKILLspamspam@spam@htsoft.com   | AUS: +61 7 3354 2411 +61 7 3354 2422
---------------------------------------------------------------------------
HI-TECH C: compiling the real world.

1998\08\19@023320 by Dr. Imre Bartfai

flavicon
face
Hi,
in the initialise() you should set the PEIE also, I guess.

Imre


On Tue, 18 Aug 1998, Sylvain Bilanger wrote:

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...