Hi everyone.
I have recently been delving into some avr-c using avr-gcc on linux in order to gain a better understanding of what is under the hood of arduino.
I have been following a tutorial series on youtube by HumanHardriveDrive, i have been getting a good feel for how registers work but im kinda stuck on a PWM example, i can get it working but when it comes to trying it on a different pin i cant seem to get it to work. im trying to get it to run on pin PB3 of the atmega328p which is also a PWM pin, so i have tried changing the code to DDRB |= 0x08; when that didn’t work i tried changing things like OCR0A to OCR2A.
I cant see any further reference to the pin in the code so I'm not quite understanding how this works, i have looked in datasheet and only see reference to OCR0A, TCCR0A an not variations for different pins. the led did light up after changing a few zeroes into 2's but its no longer changing its brightness. Any help would be much appreciated.
Thank-you very much for going to such trouble cattledog. that example has helped me understand much more clearly, I would never of guessed so much needed to be changed just to change from one pin to another, i didn’t find the datasheet to be too clear on this but then I haven’t read it back to back yet, seems I must take Delta_g's advice an do just that.