Reading the Comparator Output in XMC4400

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

cross mob
Not applicable
Hi I was wondering if it is possible to read the comparator output when using the XMC4400. I've found no mention of any register in the user manual and the only way I can think of is by making use of the clamping system, unfortunately the explanation for implementing the comparator clamp is not very clear and I cannot seem to get it to change states. I was hoping someone could provide me with any assistance on this matter.

Thanks for your help
0 Likes
2 Replies
sich_4729076
Employee
Employee
Hi,

You could read the comparator output (rising or falling ) through CSG service request.
Here is the procedure
1. Set the comparator interrupt service enable in the SFR CSGySRE register. You could set the comparator rise and/or comparator fall interrupt enable.
2. Set the interrupt line selection, SFR CSGySRS
3. Read the status, SFR CSGyISTAT and clear the status after read, SFR CSGySWC
4. Or you could setup Interrupt service events.

Best regards,
Siew Lee
0 Likes
Not applicable
Thank you for your reply.

I had been hoping to not make use of the interrupt service but i'll implement it how you said so as to keep track of the output state.

Kind Regards

Joe
0 Likes