How to generate an interrupt from comparator's output without using any DigBuf module? Can I get two interrupts using the same transition before & after routing to a DigBuf ? I read related stuff on cypress documentation but wasn't able to figure out anything conclusive.
I did include pragma interrupt_handler in the beginning. I tried incorporating ljmp _Comp1 (taking Comp1 as the name) in boot.tpl file & then to begin with, in my ISR, which I'm coding in C, I tried to change an LED's status everytime an interrupt occurs but couldn't succeed. Tell me the correct sequence and/or example code for the same.
Thanks a lot.
Solved! Go to Solution.
i too was facing the same problem when trying to use an interrupt directly from a comparator bus but i could'nt achieve that. the most i could do was to route it to a digbuf module and use its interrupt for my application. i would be glad if someone from the cypress community can help us out.
I cannot see any pitfalls with the comparator so far: Depending on the analog column the appropiate interrupt in Boot.tpl has to be changed (Interrupt #2 to 5) and the interrupt has to be enabled for the comparator via the API.
I think, I'll test that.
I had an activity in college where I'd to learn a bit of german. Not even an amateur. You're a gentleman - sticking to english even when triggered 😛
A little madness from my side - just got this thought ; I configured SC block as a comparator - I got a nearly digital o/p. i.e the edges are not as sharp as it would be if a comparator is made using a CT block BUT with LESSER noise.. Can these raw transitions from 0-5 V, when directly routed to pins, trigger GPIO Interrupts ?
Instead of routing the SCBLOCK based comparator output to a pin and then generating interrupt, you can route the comparator output directly to a comparator bus present in every analog column. You can then enable the comparator bus interrupt.
You can refer AN2108 - Implementing Hysteresis Comparator -
I'm using an SC block as a comparator. & I've routed the o/p to the Comparator's bus - Is that what you mean by enabling the comparator bus or there are any specific instructions to accomplish this ?
Thanks but what's not clear to me is different - I'm asking how to use the o/p of ComparatorBus_0 as an interrupt ?
(Note - I dont want routing using DigBuf as that makes my o/p noisy ; I'm NOT using a CT comparator user module but an SC block's analog transition on CompBus)
And don't forget to modify boot.tpl, root directory of project, with ljmp ISR name
for that column -
org 08h ;Analog Column 0 Interrupt Vector
org 0Ch ;Analog Column 1 Interrupt Vector
org 10h ;Analog Column 2 Interrupt Vector
org 14h ;Analog Column 3 Interrupt Vector
You replace the "`@INTERRUPT_n`" contruct with -
"ljmp ISRname" ( if ISR is a C solution, say COMPisr, then use as its name, "ljmp _COMPisr"