PSOC 4 how to get ISR to trigger on falling edge of the capsense comparator

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
deonc_3697476
Level 2
Level 2
First like given

For PSOC 4000s:

temp.PNG

I'm trying to get an isr to trigger on the falling edge of the comparator (not the low power one, the capsense one).

I'm getting an error of "Error: mpr.M0142: Invalid connection for output "\CSDCOMP:cy_psoc4_csd_v2_comp\:comp" connected to "isr_GPIO:interrupt". (App=cydsfit)"

So obviously I'm not doing it quite right. Would anyone know how to accomplish this task? The code is essentially taken from the example on interrupts.

I've tried following the example code and doing this:

temp2.PNG

but I don't see why the pin would be necessary, and the compiler seems to agree. Regardless of drive mode on the pin, you get:

"ADD: sdb.M0012: error: Terminals "CSDCOMP.CmpOut,Pin_Sw.external_0" connected to signal "Net_133" have mismatching types."

I'm assuming Net 133 is the net between the comparator and the pin. The error makes sense because the pin implies that you have an external input driving the pin, and the comparator is trying to drive it as well - not what we want.

Thanks.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The setting seems a bit complicated, but it works, See attached project (Don' heed the name)

Bob

View solution in original post

5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The setting seems a bit complicated, but it works, See attached project (Don' heed the name)

Bob

Thanks Bob,

The example you gave makes sense - we would want to drive something as well as read something, so both should be checked. However, I still get errors about "Net_133" requiring a connection (it is the wire between comparator and pin), as well as IO pin placement failed. At least the wire colors match now. Any ideas?

I recreated your example like this, but the compile errors are sticking around:

temp3.PNG

... And you can see the pile of errors.

The pin placement fail of Pin_Sw(0) is also odd - there are a good number of unused pins at this point, but it only allows pin B5 to be appointed - probably the pin tied to the comp output?

temp.PNG

Unfortunately, I'm at the point where the board has already been made, and something else assigned to that pin. There aren't any "software only" workarounds, are there?

Thanks again.

0 Likes

Comparator pins are usually not re-assignable and are fixed for comparator use. No idea for software hack.

Bob

0 Likes

I found a hardware workaround.

Any ideas about the "int_signal" requires connection when it is visible error?

temp2.PNG

I also tried removing the external pin on the right side of the pin block, didn't help:

temp3.PNG

Thanks!

0 Likes

Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use

Creator->File->Create Workspace Bundle (minimal)

and attach the resulting file.

Bob

0 Likes