//128kuangjiaTimer.c : source file for the 128kuangjia Timers
//
#include "128kuangjia.h"
#include "128kuangjiaTimer.h"
/////////////////////////////////////////////////////////////////////////////
//128kuangjiaTimer
void timers_init(void)
{
//{{WIZARD_MAP(Timers)
// Timer/Counter0 Clock source: System Clock
// Timer/Counter0 Clock value: 230.400kHz
// Timer/Counter0 Mode: Normal
// Timer/Counter0 Output: Disconnected
ASSR = 0x00;
OCR0 = 0xe6;
TCNT0 = 0x1a;
TCCR0 = 0x03;
// Timer/Counter1 Clock source: System Clock
// Timer/Counter1 Clock value: 7372.800kHz
// Timer/Counter1 Mode: PWM, Phase Correct, 8-bit
// Timer/Counter1 Output: A: Normal, B: Disconnected, C: Disconnected
sbi(DDRB, 5);
OCR1A = 0x1ccc;
OCR1B = 0x1ccc;
OCR1C = 0x1ccc;
TCNT1 = 0xe334;
TCCR1A = 0x81;
TCCR1B = 0x01;
TCCR1C = 0x00;
// Timer/Counter2 Clock source: System Clock
// Timer/Counter2 Clock value: 115.200kHz
// Timer/Counter2 Mode: CTC, TOP=OCR2
// Timer/Counter2 Output: Disconnected
OCR2 = 0x73;
TCNT2 = 0x8d;
TCCR2 = 0x0b;
// Timer/Counter3 Clock source: System Clock
// Timer/Counter3 Clock value: 7372.800kHz
// Timer/Counter3 Mode: Normal
// Timer/Counter3 Output: A: Disconnected, B: Disconnected, C: Disconnected
OCR3A = 0x1ccc;
OCR3B = 0x1ccc;
OCR3C = 0x1ccc;
TCNT3 = 0xe334;
TCCR3A = 0x00;
TCCR3B = 0x01;
TCCR3C = 0x00;
TIMSK = 0xff;
ETIMSK = 0x3f;
//}}WIZARD_MAP(Timers)
}
ISR(SIG_OUTPUT_COMPARE0)
{
// TODO: Add your code here
}
ISR(SIG_OVERFLOW0)
{
// Reinitialize Timer0's value
TCNT0 = 0x1a;
// TODO: Add your code here
}
ISR(SIG_INPUT_CAPTURE1)
{
// TODO: Add your code here
}
ISR(SIG_OUTPUT_COMPARE1A)
{
// TODO: Add your code here
}
ISR(SIG_OUTPUT_COMPARE1B)
{
// TODO: Add your code here
}
ISR(SIG_OUTPUT_COMPARE1C)
{
// TODO: Add your code here
}
ISR(SIG_OVERFLOW1)
{
// Reinitialize Timer1's value
TCNT1 = 0xe334;
// TODO: Add your code here
}
ISR(SIG_OUTPUT_COMPARE2)
{
// TODO: Add your code here
}
ISR(SIG_OVERFLOW2)
{
// Reinitialize Timer2's value
TCNT2 = 0x8d;
// TODO: Add your code here
}
ISR(SIG_INPUT_CAPTURE3)
{
// TODO: Add your code here
}
ISR(SIG_OUTPUT_COMPARE3A)
{
// TODO: Add your code here
}
ISR(SIG_OUTPUT_COMPARE3B)
{
// TODO: Add your code here
}
ISR(SIG_OUTPUT_COMPARE3C)
{
// TODO: Add your code here
}
ISR(SIG_OVERFLOW3)
{
// Reinitialize Timer3's value
TCNT3 = 0xe334;
// TODO: Add your code here
}
没有合适的资源?快使用搜索试试~ 我知道了~
avr atmega128 程序框架
共185个文件
h:148个
o:9个
d:9个
需积分: 5 27 下载量 100 浏览量
2009-09-28
10:08:58
上传
评论
收藏 389KB RAR 举报
温馨提示
avr 单片机所有资源的配置,及程序基本框架,编译环境gcc avrstudio
资源推荐
资源详情
资源评论
收起资源包目录
avr atmega128 程序框架 (185个子文件)
atmega128.aps 4KB
atmega128.aws 974B
128kuangjiaTimer.c 3KB
128kuangjia.c 1KB
128kuangjiaExtINT.c 1KB
128kuangjiaADC.c 799B
128kuangjiaUART1.c 566B
128kuangjiaUART0.c 565B
128kuangjiaAnalogCmp.c 522B
128kuangjiaTWI.c 503B
128kuangjiaSPI.c 469B
128kuangjia.o.d 3KB
128kuangjiaAnalogCmp.o.d 2KB
128kuangjiaExtINT.o.d 2KB
128kuangjiaUART0.o.d 2KB
128kuangjiaUART1.o.d 2KB
128kuangjiaTimer.o.d 2KB
128kuangjiaSPI.o.d 2KB
128kuangjiaTWI.o.d 2KB
128kuangjiaADC.o.d 2KB
atmega128.eep 13B
atmega128.elf 12KB
iocanxx.h 49KB
stdio.h 41KB
io90pwmx.h 40KB
power.h 33KB
io90pwm1.h 31KB
iomxx0_1.h 31KB
iom64.h 30KB
iom128.h 29KB
boot.h 25KB
iousbxx6_7.h 24KB
stdlib.h 23KB
pgmspace.h 22KB
iom3290.h 21KB
iom6490.h 21KB
iom169.h 20KB
iom169p.h 19KB
iom329.h 18KB
iom649.h 18KB
iom162.h 18KB
iom3250.h 17KB
iom6450.h 17KB
iom8535.h 17KB
iomxx4.h 16KB
iom103.h 16KB
stdint.h 16KB
iom165p.h 15KB
iom325.h 15KB
iom165.h 15KB
iom406.h 15KB
iom645.h 15KB
iomx8.h 15KB
iousbxx2.h 15KB
iom8515.h 15KB
inttypes.h 15KB
iotn2313.h 14KB
ioat94k.h 14KB
eeprom.h 13KB
iom32.h 13KB
io8535.h 13KB
wdt.h 13KB
io4434.h 13KB
iom161.h 12KB
iom16.h 12KB
iom323.h 12KB
io8515.h 11KB
io4414.h 11KB
io.h 11KB
iom163.h 11KB
io43u32x.h 11KB
iom8.h 11KB
iotnx61.h 11KB
iomxxhva.h 11KB
io43u35x.h 11KB
io4433.h 11KB
io2333.h 10KB
iotn13.h 10KB
io76c711.h 10KB
iotnx4.h 10KB
sleep.h 10KB
crc16.h 9KB
sfr_defs.h 9KB
math.h 9KB
iotnx5.h 9KB
io2313.h 8KB
iotn26.h 7KB
io86r401.h 7KB
deprecated.h 7KB
portpins.h 7KB
iotn15.h 6KB
twi.h 6KB
interrupt.h 6KB
iomacros.h 6KB
string.h 5KB
iotn12.h 5KB
ctype.h 5KB
io1200.h 5KB
iotn28.h 5KB
setjmp.h 5KB
共 185 条
- 1
- 2
资源评论
时间效应
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功