- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Guys,
I want to use the Conversion Ready Interrupt of the ADCINC Modul.
I write this small code (see Attachnment) to test this Function. I think the ADC should increase the Counter-Variable each Conversion and every Second the Counter should be displayed on my LCD.
But it doesn´t work 😞
Can you please tell me my misstake?
Thank you very much!
Greetings
Daniel
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To complete the interrupt setup you must modify the jmp vector in
boot.tpl, which resides in root project directory.
http://www.cypress.com/?id=4&rID=36720
http://www.planetpsoc.com/component/content/article/43-writing-a-c-isr.html
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
thank you for an answer. I have tried it, but i doesn´t get any Numbers on my Display.
I have added
org 20h ;PSoC Block DBB00 Interrupt Vector
ljmp _ADC_Int
;`@INTERRUPT_8`
reti
to the boot.tpl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The interrupt vector should be DCB02, if it is for the 16
bit timer.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey,
thanks for this Application Note.
But I don´t need the Timer Interrupt. I need the Conversion Ready Interrupt for that ADC (I only want to know why it doesn´t work 😞 )
Greetings
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might want to file a CASE on this. Looking at DS I do not see any enable/disable
over the interrupt, or a setting in global properties. Also seems to state, albeit sparsely,
that single stage modulator does not have any interrupt latency, does that mean there is
no interrupt ? And it discusses this as if < 12 bits also means no interrupt.
I am stumped.
To create a technical case at Cypress -
“Support”
“Technical Support”
“Create a Case”
You have to be registered on Cypress web site first.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, the solution is quite straightforward
1st: Do not modify the .tpl. In the boot.asm the correct interrupt for the ADC is already inserted.
2nd: Modify ADCINT.c- file and insert an lcall to your handler (NOT an LJMP!!!) into the marked place
3rd: Do NOT declare your handler to be an interrupt routine!!!
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correction: Of course not the .c-file. Modifications have to be made in ADCINCINT.asm
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why cannot one use a C interrupt handler implementation ?
ADCINC is generated by 8 bit PWM, in this case placed in
DBB00. In order to do this boot.tpl would be changed and
an ljmp used.
http://www.cypress.com/?id=4&rID=36720
http://www.planetpsoc.com/component/content/article/43-writing-a-c-isr.html
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the LCD module properties window your LCD is set
to bargraph enable, but your writes look like you want
the display for alpha-numeric display. If latter is true
set it to disable.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Dana
Boot.asm already shows an entry for DBB00 with an LJMP to _ADCINC_ADConversion_ISR which was automatically inserted by the module. The interrupt does NOT fire at end-of-conversion, but several interrupts are needed to form the result.
An end-of-conversion stub exists, clearly marked a bit down in the .asm-file (near line 150) where an LCALL should be placed.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Obviously getting anonymusly...
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Guys,
I have talked to the Support and they write this:
Greetings Daniel,
We have analysed the project FFT.zip you had attached.
Please use "lcall" (without interrupt_handler pragma directive) instead of "ljmp"(with interrupt_handler pragma directive) for jumping to "_ADC_Int" ISR routine in the ADCINCINT.asm file.
The reason is "ljmp" with interrupt_handler pragma directive results in an "reti"(return from interrupt) instruction being executed after the C ISR, and hence the code following the "ljmp" instruction would not be executed. So, in files such as ADCINCINT.asm, where there is still some other code to be executed after the User custom code banner, "ljmp" technique should not be used. Instead, "lcall" can be used.
Please refer the below linked KB article which explains both "ljmp" and "lcall" techniques, and also a more advanced technique to overcome the "No Return to Assembly issue(but you may find that using lcall may be more simpler than the advanced technique mentioned there):
Implementing an Interrupt Service Routine in C on the PSoC1
As seen in above link, when using "lcall", the interrupt_handler pragma directive should not be used. Rather, the lcall should be made as below in the custom user code banner:
PRESERVE_CPU_CONTEXT
lcall _foo
RESTORE_CPU_CONTEXT
We have made the above changes in your project(and have attached this), and verified on CY3210 kit that the LCD displays the expected correct data now. You can download the attached project by logging in to www.cypress.com->MyCases.
Please let us know if this resolves your query.
Thank you very much !
Best Regards,
Prem
I have tested it few minutes ago and it works 🙂
Thank you for your help! Now I try to implement my DFT Algorithm 🙂
Greetings
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad to see that it works!
...and glad to see that my advice was right, I only thought that the CPU context already has been saved, but that was not quite right.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting, so a C routine could also have been used with the module in
the note per below.
Please refer the below linked KB article which explains both "ljmp" and "lcall" techniques, and also a more advanced technique to overcome the "No Return to Assembly issue(but you may find that using lcall may be more simpler than the advanced technique mentioned there):
Implementing an Interrupt Service Routine in C on the PSoC1
Regards, Dana.