Dear colleagues,
I am trying to generate two clock signals for my detector via PWM generators on Atmega 328.
I managed to toggle the OC0A output pin, giving me a desired 40 kHz square wave with duty cycle 50 %.
Next thing I wanted to do was to generate a sparse pulse train of short 2us pulses using OC1B output.
After setting all necessary registers, I don't get the output to change.
I tried to bypass the PWM generator and toggle the PORTB2 pin by periodically changing its value in a while loop (blinky), still without success. In the Atmel datasheet I found that the PB2 pin shares its functionality with SPI controller. According to the datasheet, I tried to set it to MASTER mode to be able to output a logical value to the pin. However, nothing has changed.
Does anyone have an experience with a similar problem?
I am looking forward to your early reply.
Ivan