Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Help setting OC1A,B HI on ATMega644p, please.

2009-10-06 by Cat C

Hello,

I need to generate a pulse of some length and plan to use Timer 1 on a ATMega644p in normal mode (0).

So I set 

 TCCR1A = 0b10100000; //This sets PD5/4 do be OC1A/B, to be cleared on Compare-Match
//                ||||||||
//                ||||||--WGM11, WGM10 (00) Normal Mode. Also set WGM13:2 in TCCRnB to 00
//                ||||--   Reserved, must be 0
//                ||--    COM1B1, COM1B0: 10 = Clear OC1B on Compare Match. Set at Pulse Start
//                --       COM1A1, COM1A0: 10 = Clear OC1A on Compare Match. Set at Pulse Start

    PORTD |= _BV(PD4) | _BV(PD5);    //OC1B, OC1A as  outputs 

The plan is to set OC1A/B (PD5/4) High before I start the timer and have the timer clear them on Compare Match.

My problem is: How do I set OC1A/B to High, as they no longer "respond" to commands sent to Port D?
I tried:
PORTD |= _BV(PD4) | _BV(PD5); to no avail.

Any help appreciated, thanks.

Cat
 		 	   		  

[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.