error implementing a timer

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

i have used a timer 32 bit to generate a timer of 1 sec .
i have kept interrupt type as terminal count.
set vc1 to 8 ,vc2 to 3 ,cpu clock as vc2 giving me clock of 1 Mhz
i have set the period to 1000000 which means it should generate an interrupt every 1 sec.
i have given the output of terminal count to port 0_0 and connected an led to pin 0 of port 0.
the following is the code i have written

my psoc designer uses hi tech compiler

#include          // part specific constants and macros     
#include "PSoCAPI.h" // PSoC API definitions for all User Modules     
#include "timer32.h"     
void interrupt timer32_isr(void);     
void main()     
{     
TIMER32_WritePeriod(0xf4240); //equivalent hex of 1000000     
TIMER32_WriteCompareValue(0);     
TIMER32_EnableInt();     
M8C_EnableGInt;     
TIMER32_Start();     
}     
     
     
void interrupt timer32_isr(void) @0x00 //as i have hitech compiler so used this way instead of using pragma directive     
{     
int count=0; //i have connected port 2 pin 0 to an led so it should glow whenever an interrupt gets generated     
count++;     
PRT2DR=count;     
}     
     
      I have added
ljmp _timer32_isr
in the file timer32int.asm at the appropriate place
      these are the messages of error i get when i build the program     
: 0: (500) undefined symbols: (error)     
_TIMER32_EnableInt(output\timer2.obj) _TIMER32_WritePeriod(output\timer2.obj) _TIMER32_Start(output\timer2.obj) _TIMER32_WriteCompareValue(output\timer2.obj)     
HI-TECH C PRO compiler averages 40% less code than this Lite mode     
PRO may reduce your program size by 51 bytes     
           
C:\PROGRA~1\CYPRES~1\PSOCDE~1\tools\make: *** [output/timer2.hex] Error 1     
     
timer2 - 1 error(s) 0 warning(s) 05:13:52     
     
     
     
i have referred many app notes as well as user module example projects but cant figure out whats wrong .     
if any one can help??    

0 Likes
5 Replies