12-01-2009 09:28 AM
Hi all !
So after some try, I don't succeded to implement an interrupt.
I already implement a ARM_SPI_IRQ.h and ARM_SPI_IRQ.c for my interrupt.
But I don't know what I have to put inside of my fonction IRQ (SPI_Slave0IRQ) ? The point is I'd like to use a VI (few step after this, in manage interrupt )
After that I'm a bit lost,what I have to do ? I saw a Interrupt wizard, (Tools -> ARM Module -> Interrupt configuration wizard). But It's just for generate the xml file.
Sorry, my post is maybe a bit confusing, butin short, have you some clear step with how add an interrupt ?
Thanks !
12-01-2009 01:11 PM
hello
I explained what needs to be changed in the XML and the individual interrupt source code (i.e. ARM_SPI_IRQ.c) in the this thread. I suggest you take a look at it if you haven't already, but ignore the posts that talk about manually editting the XML file, this should all be taken care of automatically with the interrupt editor wizard. I also suggest using the MCB2300 as an example for interrupts. You can look at the compiled code when you enable an interrupt to get a better idea.
If you haven't already - because you are working on a new target, in addition to creating the source files and the XML, you must implement the interrupt API which consists of several functions that the interrupt manager will automatically call. Using the MCB2300 target as an example, you must implement arm_irq.c located at <LabVIEW>\Targets\Keil\Embedded\RealView\MCB2300\Template\Drivers\Interrupt.
12-02-2009 09:32 AM
Hi Joscha,
I threw together a quick example that uses external interrupt 0 (the blue button on the MCB2300).
Download this zip file and extract it over your Keil\Embedded\RealView folder. Once the files are in the proper location, you will need to create a new MCB2300 target in your project to see the changes.
A short explanation of the files...
ExtInt0.c and ExtInt0.h
- used for initializing the interrupt and clearing the interrupt once it fires
LV_RV_ExtInt_config.vi
- this is the dialogue that pops up when you click "Configure..." on the manager interrupts page (in build spec) and allows you to specify level vs edge triggering and polarity
LPC2378_Append_Initialization.vi
- i had to change this to add a case for the new interrupt, such that the initialization function is called properly
interrupt.xml
- this is the file that ties the whole thing together, if you scroll to the bottom you can see where I added the new interrupt. The XML format is standard to LabVIEW structures.
thanks
edit: Also, you probably want to avoid using P2.10 for anything else while you are using this interrupt.
RealView.zip (28 kb) |
It's what you said in the other post.
Ok, I understand what you do, I just need a detail more.
With the .c and .h, you "Init" the interrupt, you use the postinterrupt to clear/reset the interrupt. But where is the link between those file and my "manage interrupt" panel. Where I can see that ?
Do you understand what I mean ?
Thanks
12-03-2009 01:59 PM
These files are all linked together using the interrupt.xml file (which is generated by the interrupt editor wizard).
When you launch the interrupt manager (i.e. build specification dialog), the interrupt.xml file tells the interrupt manager what interrupts to populate as well as what VI to launch when the user clicks the "Config" button. Once you perform a build, the interrupt.xml file is used to generate code that will call into the specified interrupt init function as well as call into the interrupt API (arm_irq.c) to register/enable the interrupt. Also, any pre/post function will be passed to the interrupt API to handle.
I suggest taking a look at the generated code for the MCB2300:
1 ) Create an application with an interrupt enabled. I suggest a non-threaded interrupt, as the generated code is easier to interpret.
2 ) Build the application
3 ) Open Microvision (right click on target) and navigate to the "Interrupt" group in the project explorer.
You should see LVCGenIntInit.c as well as the source file associated with the interrupt.
This LVCGenIntinit file is generated code, which (as mentioned aboved) will call the interrupt init function, register the interrupt with the VI handler and any post/pre func, then enable the interrupt.