Time problem, delay_us function
Posted: 22 Nov 2009 13:29
Hi, I have problem with delay_us function. I was connect to port B led diode. In my program I light on diode for 10000 ms and light off diode for 10000ms. If my clock is 1 Mhz led will be on for 10 second and off for 10 second. If my clock is 2 Mhz led will be on for 5 second and off for 5 second. Why clock affect on delay_ms function?
My main problem is to create signal which is on high level for 1.8 ms and on low level for 20 ms. Can I be sure that if I use function delay_us(1800) and delay_us(20000) with clock of 1 Mhz that my signal will lock as I want?
I use bigavr2 board with ATmega 128 microcontroler.
My main problem is to create signal which is on high level for 1.8 ms and on low level for 20 ms. Can I be sure that if I use function delay_us(1800) and delay_us(20000) with clock of 1 Mhz that my signal will lock as I want?
I use bigavr2 board with ATmega 128 microcontroler.