SAM C21 analog comparator

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hey,

 

I've got a SAM C21 Xplained Pro board. I want to use the analog comparator.

I have two external voltages which I want to compare. At first I want to try the example code, but my question is:

 

Which pins should I use, which connections should be done?

 

Thanks for help and sorry for the question. I just startet with the Atmel Board a few weeks ago.

 

Greetings,

 

Joe

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, you can read the datasheet for SAM C20/21. Chapter 6 shows which pins can be connected to the comparator. Chapter 28 explains how to configure the pins. Refer to chapter 40 to learn how to configure the AC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey, thank you for your answer.

 

I still don't get it...

I have two inputs from an analog sensor which I want to compare.

 

To get familiar with the AC at the SAM C21 board I tried to use the example project and did the quick unit test of the AC component.

For that I should connect PA02 (DAC VOUT) with PA04 (AIN0). I ran the application but the test stops without a message at this spot:  "Testing Analog Comparator Module Initialization"

 

I know that I have to use the pin PA04 of the VREF-Header for my first signal. But which pin should I use for the second one? Chapter 6 shows me that AIN1 is the PIN PA05 but my board hasn't a pin PA05...

 

Sorry for this question, but could you please help me again and explain me, how to do it...

 

Thank you in advance!