Microchip® Advanced Software Framework

mega_clock_example.c File Reference

megaAVR STK600 Clock Example

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "conf_clock.h"
#include <util/delay.h>

Macros

#define MAX_MS_DELAY   (262.14 / (F_CPU / 1000000UL))
 Maximum possible delay is 262.14 ms / F_CPU in MHz. More...
 
#define MAX_US_DELAY   (768 / (F_CPU / 1000000UL))
 Maximum possible delay is 768 us / F_CPU in MHz. More...
 

Functions

int main (void)
 Example application on how to use the libc delay functions. More...
 

#define MAX_MS_DELAY   (262.14 / (F_CPU / 1000000UL))

Maximum possible delay is 262.14 ms / F_CPU in MHz.

Please refer to libc for more information.

Referenced by main().

#define MAX_US_DELAY   (768 / (F_CPU / 1000000UL))

Maximum possible delay is 768 us / F_CPU in MHz.

Please refer to libc for more information.

Referenced by main().

int main ( void  )

Example application on how to use the libc delay functions.

This application shows the basic usage of the delay functions from the avr libc library.

Note
The delay functions will not operate correctly if compiled without optimization.

References MAX_MS_DELAY, and MAX_US_DELAY.