Other HI-TECH Compilers & Products >> Other HI-TECH Compilers & Products

Pages: 1
C haron
stranger


Reged: May 18 2009
Posts: 2
hi-tech c51-lite code request with interrupts preferably
      #112212 - Mon May 18 2009 03:02 AM

Hello,
I'm using hi-tech c51-lite v9.60 in NI Multisim, and it seems that interrupts are not working.
the syntax is different, i cant write

void externalInter0() interrupt 0
{} and writing

interrupt void ISR(){ } like for a pic doesnt seem to do anything.

Please help.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Dan HenryModerator
Guru
****

Reged: Oct 16 2003
Posts: 3873
Loc: Colorado
Re: hi-tech c51-lite code request with interrupts preferably [Re: C haron]
      #112262 - Mon May 18 2009 08:03 AM

Quote:

I'm using hi-tech c51-lite v9.60 in NI Multisim, and it seems that interrupts are not working.
the syntax is different ...



Different than what? Different than what is described in the compiler manual?


Post Extras: Print Post   Remind Me!   Notify Moderator  
C haron
stranger


Reged: May 18 2009
Posts: 2
Re: hi-tech c51-lite code request with interrupts preferably [Re: Dan Henry]
      #116532 - Thu Jun 11 2009 09:16 AM

hi, im back, thought I got past this issue, but it's still here.
I have the lite version, and in the manual I cant find how a simple interrupt example.

this is a small example from keil, and it's how i'm used to write an interrupt
can someone write this to work for hi-tech C51 lite

#include

unsigned char ex0_isr_counter = 0;

void ex0_isr (void) interrupt 0
{
ex0_isr_counter++;
}
void main (void)
{
IT0 = 1;
EX0 = 1;
EA = 1;


while (1)
{
}
}

this is what I wrote for C51 lite.
I'm using Nation Instruments Multisim. I have a clock generator connected to pin P32 and I have a osciloscope conected to P32 and to P10 to see.
The clock is ok, pin P10 is allways high.

#include
void main(){
IT0 = 1;
EX0 = 1;
EA = 1;
}

interrupt void
external0_intr(void){
if(P10==0)
P10=1;
if(P10==1)
P10=0;
}


please help



Edited by C haron (Thu Jun 11 2009 02:29 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 0 anonymous users are browsing this forum.

Moderator:  jtemples, Dan Henry, Andrew L, mikerj 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 2079

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5