Interrupt CW Assembly Language - AW60 Demo Board

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

Interrupt CW Assembly Language - AW60 Demo Board

2,079 Views
mnemonic
Contributor III
Hi all!
 
I try to start using Interrupts in my assembly projects. I am using the AW60 Demo Board and CW 5.9.0. I looked around to get the information i need on freescale and other internet sites. But it is not enought information for me.
 
What can you tell me about my screenshot? I get always the same error message. But it seems to me that I am on the right way.
 
best regards
 
Ingo
 
 
Added p/n to subject.



Message Edited by NLFSJ on 2009-01-27 08:12 AM

 

Interupt_CW_Error_Message.doc

Message Edited by t.dowe on 2009-10-27 11:53 AM
Labels (1)
0 Kudos
3 Replies

265 Views
bigmac
Specialist III
Hello Ingo,

The 'AW60 device has a total of 26 interrupt vectors allocated (0 - 25).  The SCI1RX vector is at position 17 ($FFDC), and the Reset vector is at position 0 ($FFFE).  At least these two vectors should be correctly filled.  You also seem to be confusing the label name for the start of the ISR code with the label to identify the vector location.  Within the include file for the device, the label Vsci1rx actually refers to the vector location, so the ISR name will need to be altered to avoid conflict; say SCI1RX_ISR.  The minimum code for the vector table would be -

  ORG   Vsci1rx    ; $FFDC vector location
  DC.W  SCI1RX_ISR ; Start of ISR code

  ORG   Vreset     ; $FFFE vector location
  DC.W  _Startup   ; Start of code


However, if you also wish to direct all unused interrupts to the handler spurious, you will need a table entry for each of the 26 interrupts.  The following shows the alternative -

  ORG   Vrti       ; Start of interrupt vectors for device
  DC.W  spurious   ; 25  RTI
  DC.W  spurious   ; 24  IIC1
  DC.W  spurious   ; 23  ADC1
  DC.W  spurious   ; 22  KEYBOARD1
  DC.W  spurious   ; 21  SCI2TX
  DC.W  spurious   ; 20  SCI2RX
  DC.W  spurious   ; 19  SCI2ERR
  DC.W  spurious   ; 18  SCI1TX
  DC.W  SCI1RX_ISR ; 17  SCI1RX
  DC.W  spurious   ; 16  SCI1ERR
  DC.W  spurious   ; 15  SPI1
  DC.W  spurious   ; 14  TPM2OVF
  DC.W  spurious   ; 13  TPM2CH1
  DC.W  spurious   ; 12  TPM2CH0
  DC.W  spurious   ; 11  TPM1OVF
  DC.W  spurious   ; 10  TPM1CH5
  DC.W  spurious   ; 9   TPM1CH4
  DC.W  spurious   ; 8   TPM1CH3
  DC.W  spurious   ; 7   TPM1CH2
  DC.W  spurious   ; 6   TPM1CH1
  DC.W  spurious   ; 5   TPM1CH0
  DC.W  spurious   ; 4   ICG
  DC.W  spurious   ; 3   LVD
  DC.W  spurious   ; 2   IRQ
  DC.W  spurious   ; 1   SWI
  DC.W  _Startup   ; 0   RESET

During your initial experimentation, assuming SCI1 receive interrupt is enabled, the contents of SCI1RX_ISR should minimally clear the RDRF flag.  Otherwise the ISR may be perpetually re-entered.  Refer to the datasheet for the flag clearing mechanism required.

Regards,
Mac

0 Kudos

265 Views
mnemonic
Contributor III
Hello Mac!
 
I am really happy about this informations you give me! Thank you very much! At my search, I found more C Code as assembly code. I startet with freescale devices two years ago. I had no experience with Microcontrollers before. Reading datasheets in english language was also hard for me.
 
I see what you are mean is that the Vsci1rx is allready defined as an (equ) Vector Address and so I can not use this as a sub. The ORG Vrti ist the Vector Table with the 26 interrupt vectors. Each line is able to point on a user defined ISR Subroutine. Example KBI1_ISR.
 
Am I right?
 
best regrds,
 
Ingo
0 Kudos

265 Views
bigmac
Specialist III
Hello Ingo,

Your understanding is correct.

Regards,
Mac

0 Kudos