You are here

Does ISR for 16-bit PSoC 1 Timer have to be written in assembler? | Cypress Semiconductor

Does ISR for 16-bit PSoC 1 Timer have to be written in assembler?

Summary: 1 Reply, Latest post by Bob Marlowe on 14 Nov 2016 02:00 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
tonypayn902_1586141's picture
User
4 posts

The reason for this question is that the data sheet for the User Module says, in the example C code:

The same code in C is as follows. Note that the interrupt routine must be written in assembly.

I note however that the User Module comes with an example project, which uses an ISR written in C, so I am wondering it the statement in the User Module data sheet is simply incorrect.

My datasheet is version 2.6, Designer is version 5.4.

I note also that the Compiler Guide says:

To associate the interrupt handler with an interrupt, add ljmp _name at the interrupt vector in the boot.tpl file.

When I look in the boot.tpl file, it says:

    org   38h                      ;PSoC Block DCC12 Interrupt Vector
    `@INTERRUPT_14`
    reti

so I think the compiler guide is asking me to change this so that it reads:

    org   38h                      ;PSoC Block DCC12 Interrupt Vector
    ljmp _MyTimer16Interrupt
    reti

 

Would that be correct?  If I do this, it builds but with a warning "old-style function definition for `MyTimer16Interrupt'"

and it warns me that 'boot.asm' has been modified outside of the editor, do I want to reload it. (Words to that effect.)

I can't help thinking that, despite following the instructions, I'm not doing whatever it needs to make it entirely happy.  Any suggestions?

 

user_1377889's picture
User
9572 posts

You have to tell the compiler that "MyTimer16Interrupt" is an interrupt handler by declaring

#pragma interrupt_handler MyTimer16Interrupt

See "ImageCraft C Compiler Guide"

 

Bob

Log in to post new comments.