OC Pins [ATmega32, ATmega32L]

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

Hey Guys,

 

I have a short question, because I could not find an answer in the datasheet (it is probably somewhere in the datasheet but I could not find it).

 

Where do I find (address in IO-Space) the OC Pin ? I could not find the OC Pin in the register summary of the IO memory.

 

And is it possible to configure the OC Pin so that instead another pin toggles when matching with OCR ? (probably not).

 

By the way: I am talking about the 8-bit timer (timer0) of the ATmega32(L).

 

Thank you.

This topic has a solution.
Last Edited: Thu. Oct 15, 2020 - 10:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I found the answer. It seems to be PINB3 for the 8-bit timer0.

 

Now there is only question left :) Is it possible to switch to another pin or is it always PINB3 for timer0 ?

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

Is it possible to switch to another pin or is it always PINB3 for timer0

AFAIK, all the "older" AVRs have single unchangeable outputs for the time OCxy outputs.  It's not until the xMega and Mega0 that you start to see multiple options.

 

 

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

0x21 wrote:
Is it possible to switch to another pin or is it always PINB3 for timer0 ?
The OC pins are all fixed but if you want the output elsewhere do "soft PWM"...

 

https://www.avrfreaks.net/commen...

Last Edited: Thu. Oct 15, 2020 - 08:23 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


0x21 wrote:
Where do I find (address in IO-Space) the OC Pin ?

It'll be in the appropriate PORT register

 

0x21 wrote:
I found the answer. It seems to be PINB3 for the 8-bit timer0.

Indeed:

 

 

Please mark the solution - see Tip #5 in my signature, below:

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...