Home - Search - Members
Full Version: regarding butterfly's atmega169
nuRuL
Apr 24 2008, 7:41 AM
hi
im now trying to generate a pwm signal (10kHz squarewave signal) using timer/counter0 provided on atmega169.
however, the output compare match will generate the waveform on OC0A pin, which is in this case, PB4
so in order to let the signal visible on the pin (output), i put this line in

DDRB = 0x10;

but i kinda have a situation here, cos im attaching the butterfly on my school's development board and it does not give any access to portB
so my question is, how do i write the code to let, say Port D Pin 0 (PD0) to output whats on PB4?
many thanks in advance

Ajay
Apr 24 2008, 8:39 AM
i think i already gave a thought on this...

while in fastPWM avr count up and down and both time when compare occurs state of Output compare pin changes. If you enable the compare interrupt then you can change the state of PortD0 pin in that service routine. try it..
nuRuL
Apr 24 2008, 8:40 PM
yes but i dont really understand
but this one is more clear i guess
i'll try to do it first and see what happens
thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Rickey's World © 2003 - 2007