Unexpected behavior in TCC frequency gen mode - Reality check.

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

I've scoured the data sheet(s) as well as a few app notes on the xmega timer counters but none explain the behavior I'm seeing but I think its probably right. (though a little useless in my opinion)  I'd be grateful if anyone could confirm what's going on here or point to an explanation.

 

I have an Xmega32E5.  I set TCx5 (I have used both C & D) up to freq gen mode and then enable both CCA and CCB channels for output compare.

I also set TCx5.CCA to set the desired frequency. (top value in Freq Gen mode)

 

At this point I'm expecting both CCA & B outputs to toggle with 50% duty at the half period set by TCx5.CCA.

 

The CCB channel does in fact do this but the CCA channel outputs a narrow pulse instead at the beginning (or end?) of each period. (at the correct frequency)

The width of this narrow pulse appears to be a single TCC clock width.

 

Is there any reason the A channel does not operate at 50% (ie, toggle at the compare match) as documented?

 

Thanks,

Steve

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

No takers? Well that's fair enough really.

 

Turns out the piezo beeper I had connected to the output is responsible for the strange waveform I was seeing.

Once removed the output does indeed generate 50% D.C.

Doesn't help that i was also looking at it with a logic analyser rather than a scope. blush

 

Well I did say a reality check was required.