timer interrupt delay

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

timer interrupt delay

2,596 Views
SBK_SBK_SBK_SBK
Contributor I

Hi,

can anyone share the timer interrupt delay program for led blink using processor expert

 

Tags (1)
0 Kudos
Reply
9 Replies

2,587 Views
vicentegomez
NXP TechSupport
NXP TechSupport

can you tell me the part number that you are using?

 

0 Kudos
Reply

2,579 Views
SBK_SBK_SBK_SBK
Contributor I

for eg: in a normal way we use we set pin as input or output . then we use it to give values

for example: PTA_PTA3 |=(1<<3);

                    PTA_PTA3 &=(1<<3);

to blink led we manupulate this . even for switch 

if(switch bit&(1<<4)){  //not pressed

led on

}

how can i relate these things in this code

0 Kudos
Reply

2,564 Views
vicentegomez
NXP TechSupport
NXP TechSupport

you can find some PE sample on the installation folder normally on

 

C:\Freescale\CW MCU v11.1\MCU\CodeWarrior_Examples\Processor_Expert\HCS08

 

But also please help the help on component under PE

vicentegomez_0-1680214483913.png

 

 

On this feature you can see some use case and sample code 

 

I hope this will help you.

 

0 Kudos
Reply

2,556 Views
SBK_SBK_SBK_SBK
Contributor I

thanks.

but i used this help on component and generated code. but i am not getting how to use this to implement my code. example: to blink led how to define pin, and how to call interrupt from the event.c

0 Kudos
Reply

2,582 Views
SBK_SBK_SBK_SBK
Contributor I

MC9S08PT8.

When i use processor expert to generate code it will produce code like this in Bit.c 

how to use it to blink led and if i want to interfce switch how i will give the condition to blink led as i am not getting the code flow

bool Bit1_GetDir(void)
{
return (bool)((getReg8(PORT_PTAOE) & 0x02U)); /* Return pin direction, 0==GPI, nonzero==GPO */
}

/*
** ===================================================================
** Method : Bit1_SetDir (component BitIO)
** Description :
** This method sets direction of the component.
** Parameters :
** NAME - DESCRIPTION
** Dir - Direction to set (FALSE or TRUE)
** FALSE = Input, TRUE = Output
** Returns : Nothing
** ===================================================================
*/
void Bit1_SetDir(bool Dir)
{
if (Dir) {
setReg8(PORT_PTAD, (getReg8(PORT_PTAD) & (byte)(~(byte)0x02U)) | (Shadow_PTA & 0x02U)); /* PTAD1=Shadow_PTA[bit 1] */
setReg8Bits(PORT_PTAOE, 0x02U); /* PTAOE1=0x01U */
clrReg8Bits(PORT_PTAIE, 0x02U); /* PTAIE1=0x00U */
} else { /* !Dir */
clrReg8Bits(PORT_PTAOE, 0x02U); /* PTAOE1=0x00U */
setReg8Bits(PORT_PTAIE, 0x02U); /* PTAIE1=0x01U */
} /* !Dir */
}

/*
** ===================================================================
** Method : Bit1_SetOutput (component BitIO)
** Description :
** This method sets direction of the component to output.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void Bit1_SetOutput(void)
{
setReg8(PORT_PTAD, (getReg8(PORT_PTAD) & (byte)(~(byte)0x02U)) | (Shadow_PTA & 0x02U)); /* PTAD1=Shadow_PTA[bit 1] */
setReg8Bits(PORT_PTAOE, 0x02U); /* PTAOE1=0x01U */
clrReg8Bits(PORT_PTAIE, 0x02U); /* PTAIE1=0x00U */
}

 

0 Kudos
Reply

2,558 Views
TomE
Specialist II

You've posted various versions of this in four different forums in the last few days. Of all of them, this is the least appropriate one. This is a forum for ColdFire (32 bit 68k chips). You're using an MC9S08, which is an 8 bit chip.

I have no idea from your question what you're trying to do. It doesn't seem to have anything to do with interrupts. If you want help you have to detail what you know, what you don't know, what you're trying to do and what you want help with.

Tom

 

0 Kudos
Reply

2,446 Views
SBK_SBK_SBK_SBK
Contributor I

okay. Let me form some good statements.

we used processor expert method to generate basic code for input/output, timer delay, interrupt as per the suggestion of support team.

when we used processor expert, and generate code. it creates files such as main.c, Bit1.c, Timer.c files.

As we are unaware of this method, we don't understand how to combine these things.

In Bit1.c it creates some functions, in Timer.c it creates some functions and give space to write code .

My question is how to take input from Bit1.c to ON/OFF LED using timer delay of Timer.c.

0 Kudos
Reply

2,425 Views
TomE
Specialist II

Wrong group for this question as that's a different processor and you're having software problems.

The one-line answer is that CodeWarrior should know how to compile those files in a "Project" and create the output file that you can load into the device. So practice with CodeWarrior. But ask questions in a CodeWarrior and/or 8-bit group forum please.

Tom

 

0 Kudos
Reply

2,423 Views
SBK_SBK_SBK_SBK
Contributor I

Thanks for the suggestion and guidance.

0 Kudos
Reply