Xmeage128A1 xplained ADC to DAC help needed!

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

Hi ProAvr peeps,

I am a newbie on avr programming.
I previously posted a topic to seek help for generating a sinewave with xmega128A1 xplained. Got that done, thank you guys.

I need one more favour here, the scenario is this :

This sine wave that I have generated from xmega128A1 xplained(device A) needs to be sent into another xmega128A1 xplained(device B) as an input, to act as a trigger to trigger device B to send a sinewave out from portB2. Please help.. Thank you all.

*I understand that the ADC ports act as an input and can trigger stuffs, but I dont really know how can I use them to trigger this portB2.

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

Oh and I am working on C programming. Thank you.

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

More information would be helpful, as there are probably several ways to accomplish your goal.

How far apart are the two micros?, (Same PCB, 10 meters, 1000 meters?)

Is the trigger event fixed? If so, what is it?
The presence of the sin wave?
A zero crossing on the sin wave?
A specific amplitude on the sin wave?
etc.

If the first micro, that generates the first sin wave, knows what the trigger point will be that is used by the second micro, then the solution is easy.

Don't transmit the sin wave at all. Just use a single bit and set it high at the trigger point. On the second micro just read a single bit, watching for it to go high, (Polled or Interrupt driven).

To answer your original question, the ADC is used to read an analog voltage. It converts the analog voltage into a stream of digital values.

Use the Search for ADC within the Xmega Forum for Threads on this subject.

JC

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

Hi JC,

Yea I am using both the same micro, sending the same sinewave of the same frequency. I just need to send a sine wave from device A to trigger device B to send a sinewave back. I am stuck with the triggering part.

The amplitude of the sinewave I am using is 3V peak to peak. Using the same frequency of 25kHZ.

My main objection is to have device B receive the sinewave, and sends back another sinewave generated by device B itself. which means I need device B to be idle until I receive a signal from device A. Then device B communicates back by sending a signal.