The attempt is to produce a phase correct PWM signal on PB0 that will drive a MOSFET that will drive a motor using the ADC input and a pot to control the speed.
Here is what I have so far. All of the control bit setting is causing me confusion.
; ;======================================================== ; SETUP THE TIMER COUNTER FOR PHASE CORRECT PWM MODE ;======================================================== ; ; ldi temp, 0b11111111 out OCR0A, temp ;set TOP ldi temp, 0b10000001 out TCCR0A, temp ldi temp, 0b00001001 out TCCR0B, temp rcall DELAY ; I assume the DELAY function would use the ADC port pin and the pot to set the time delay (speed of the motor) or do I have to load a value into OCR0A to do this? Is there anything I need to add to the above code to get the PWM output part of the project working? I have read (over and over) the "Using AVR Counter" document and the "AT Tiny Data Sheet" but just can't seem to multitask between all of the bit settings and acronyms used to create a coherent mental picture of how all of this goes together. Please help.