Originally authored by Bruce McKenny
Definition in file main.c.
#include <stdio.h>
#include <inavr.h>
#include <iom64.h>
#include "icp.h"
Include dependency graph for main.c:
Go to the source code of this file.
Defines | |
#define | CLI() asm("CLI") |
#define | ENABLE_BIT_DEFINITIONS |
#define | LED_DEBUG_DDR DDRC |
#define | LED_DEBUG_PORT PORTC |
#define | SEI() asm("SEI") |
#define | SLEEP() asm("SLEEP") |
Functions | |
void | hb_init (void) |
int | main (void) |
void | pwm_init (void) |
__interrupt void | TIMER0_OVF (void) |
Variables | |
unsigned char | hb_count |
|
|
|
|
|
Definition at line 83 of file main.c. Referenced by main(). |
|
Definition at line 84 of file main.c. Referenced by main(). |
|
Definition at line 72 of file main.c. Referenced by main(). |
|
Definition at line 74 of file main.c. Referenced by main(). |
|
Start up heartbeat timer. It updates the duty cycle for the PWM train being Demodulated. Using the STK500's 3.6864MHz clock, and a /1024 prescale, the (8-bit) timer overflows at about 14Hz. A counter [0:4) in the ISR slows this down by 4, so the duty cycle changes apx. 3.5Hz. This isn't very precise -- it just needs to be slow enough to be visible on the LEDs. Definition at line 129 of file main.c. Referenced by main(). |
|
Demonstration main program. Definition at line 171 of file main.c. References hb_init(), icp_init(), icp_rx(), LED_DEBUG_DDR, LED_DEBUG_PORT, pwm_init(), SEI, and SLEEP. |
|
Start up PWM (timer2) for demonstration purposes. It drives a non-inverted PWM train on the OC2 pin, which will be Demodulated by the ICP1 ISR (icp.c). A patch wire should be used to connect OC2 (PB7) with ICP1 (PD4). Definition at line 151 of file main.c. Referenced by main(). |
|
Definition at line 97 of file main.c. References hb_count. |
|
Overflow ISR for timer0. Updates the PWM duty cycle (timer2). Definition at line 92 of file main.c. Referenced by TIMER0_OVF(). |