Subversion Repositories svnkaklik

Rev

Rev 495 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 495 Rev 496
Line 8... Line 8...
8
* Chip type           : ATMEGA644
8
* Chip type           : ATMEGA644
9
* Clock frequency     : Internal clock 1 Mhz (factory default)
9
* Clock frequency     : Internal clock 1 Mhz (factory default)
10
*********************************************/
10
*********************************************/
11
#include <avr/io.h>
11
#include <avr/io.h>
12
#include <inttypes.h>
12
#include <inttypes.h>
13
#define F_CPU 8000000UL  // 8 MHz
13
#define F_CPU 11059200UL  // 8 MHz
14
#include <util/delay.h>
14
#include <util/delay.h>
15
 
15
 
16
#define LED PINC5
16
#define LED PINC5
17
void cekej(int ms)
17
void cekej(int ms)
18
{
18
{
Line 36... Line 36...
36
          /* PC5 is 5 (see file include/avr/iom8.h) and 1<<PC5 is 00100000 
36
          /* PC5 is 5 (see file include/avr/iom8.h) and 1<<PC5 is 00100000 
37
	   * This can also be written as _BV(PC5)*/
37
	   * This can also be written as _BV(PC5)*/
38
          while (1) {
38
          while (1) {
39
                      /* led on, pin=0 */
39
                      /* led on, pin=0 */
40
                      PORTC|= (1<<LED);
40
                      PORTC|= (1<<LED);
41
                      cekej(100);
41
                      cekej(1000);
42
                      /* set output to 5V, LED off */
42
                      /* set output to 5V, LED off */
43
                      PORTC &= ~(1<<LED);
43
                      PORTC &= ~(1<<LED);
44
                      cekej(1000);
44
                      cekej(1000);
45
	}
45
	}
46
	  return(0);
46
	  return(0);