Copy pins at ATmega16

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

Hello All,

 

Does anyone has a code to copy pins from an atmega16 in C.

 

I want to define PortD pin 5 the same as PortD pin 4. to use 2 outputs to drive two servo motors with PWM.

 

Thanks in advance,

 

Nick.

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

meganickkk wrote:
I want to define PortD pin 5 the same as PortD pin 4.

Surely, that's simply a matter of reading PortD pin 5 and then writing whatever value you read (which can only ever be 0 or 1) to PortD pin 4 ?

 

How is that difficult?

 

to use 2 outputs to drive two servo motors with PWM

That is an entirely different question!

 

How is that related to the first question - or to the title of the thread??

 

EDIT

 

typo

 

Last Edited: Wed. Sep 20, 2017 - 06:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think the OP has missed out some important information.

 

On a mega16, PD5 is OC1A and PD4 is OC1B. I wonder if they have some code using OC1A to drive a PWM motor and want to do something.......................(I trail off here as I have no idea what they want to do).

 

Perhaps the OP would like to explain what they want to do and why.

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

Last Edited: Wed. Sep 20, 2017 - 08:02 AM