R/G Led with PWM on AVR128DA32

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

I have connected a R/G Led between two port pins (PD4,PD5) so that I choose between red/green color.
Now, I'd like to extend that with pwm so that the leds can show yellow/orange.

I haven't yet tried it, but it looks like using TCA in split mode with the second PWM output inverted would work.

However, it looks like it's only possible to use WO[n] + WO[n+3]. It would be possible to use PD2 (=WO2) and PD5 (=WO5), but not PD4 and PD5. Is it possible to use use channel2 und route WO2 to port PD4 with CCL? I have not yet used CCL and would appreciate some hints how this can be done (if it's possible at all).

 

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

I don't think CCL is needed for this. Just take an event channel and route the signal directly to the other pin. Then use the port config to invert the output.

Hmm, or maybe I am thinking of an XMega only feature. I don't have the datasheet nearby at the moment.

 

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

Use WO4 and WO5, and set one to the inverted output.