8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
nuRuL
Thu Apr 24 2008, 07:41AM
 User Offline
Registered Member #6189
Joined: Thu Feb 21 2008, 05:53AM

Posts: 8
Thanked 0 times in 0 posts
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



Back to top


Ajay
Thu Apr 24 2008, 08:39AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3375
Thanked 616 times in 583 posts
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..

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top



This post has been thanked 1 time
 nuRuL 
nuRuL
Thu Apr 24 2008, 08:40PM
 User Offline
Registered Member #6189
Joined: Thu Feb 21 2008, 05:53AM

Posts: 8
Thanked 0 times in 0 posts
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!
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems