46 portc(this, "C", false, 7),
48 assr_reg(&coreTraceGroup, "ASSR"),
49 sfior_reg(&coreTraceGroup, "SFIOR"),
50 prescaler01(this, "01", &sfior_reg, 0),
51 prescaler2(this, "2",
PinAtPort(&portb, 6), &assr_reg, 3, &sfior_reg, 1),
52 premux0(&prescaler01,
PinAtPort(&portd, 4)),
53 premux1(&prescaler01,
PinAtPort(&portd, 5)),
56 fuses->SetFuseConfiguration(16, 0xd9e1);
57 fuses->SetBootloaderConfig(0xc00, 0x400, 9, 8);
59 eeprom =
new HWEeprom(
this, irqSystem, 512, 15);
68 admux =
new HWAdmuxM8(
this, &portc.GetPin(0),
107 extirq->registerIrq(1,
111 extirq->registerIrq(2,
127 timer012irq->registerLine(0,
IRQLine(
"TOV0", 9));
128 timer012irq->registerLine(2,
IRQLine(
"TOV1", 8));
129 timer012irq->registerLine(3,
IRQLine(
"OCF1B", 7));
130 timer012irq->registerLine(4,
IRQLine(
"OCF1A", 6));
131 timer012irq->registerLine(5,
IRQLine(
"ICF1", 5));
132 timer012irq->registerLine(6,
IRQLine(
"TOV2", 4));
133 timer012irq->registerLine(7,
IRQLine(
"OCF2", 3));
138 timer012irq->getLine(
"TOV0"));
145 timer012irq->getLine(
"TOV1"),
146 timer012irq->getLine(
"OCF1A"),
148 timer012irq->getLine(
"OCF1B"),
150 timer012irq->getLine(
"ICF1"),
151 inputCapture1,
false);
156 timer012irq->getLine(
"TOV2"),
157 timer012irq->getLine(
"OCF2"),
162 rw[0x5f] = statusRegister;
168 rw[0x59] = &timer012irq->timsk_reg;
169 rw[0x58] = &timer012irq->tifr_reg;
170 rw[0x57] = &spmRegister->spmcr_reg;
172 rw[0x55] = mcucr_reg;
173 rw[0x54] = mcucsr_reg;
174 rw[0x53] = &timer0->tccr_reg;
175 rw[0x52] = &timer0->tcnt_reg;
176 rw[0x51] = osccal_reg;
177 rw[0x50] = &sfior_reg;
178 rw[0x4f] = &timer1->tccra_reg;
179 rw[0x4e] = &timer1->tccrb_reg;
180 rw[0x4d] = &timer1->tcnt_h_reg;
181 rw[0x4c] = &timer1->tcnt_l_reg;
182 rw[0x4b] = &timer1->ocra_h_reg;
183 rw[0x4a] = &timer1->ocra_l_reg;
184 rw[0x49] = &timer1->ocrb_h_reg;
185 rw[0x48] = &timer1->ocrb_l_reg;
186 rw[0x47] = &timer1->icr_h_reg;
187 rw[0x46] = &timer1->icr_l_reg;
188 rw[0x45] = &timer2->tccr_reg;
189 rw[0x44] = &timer2->tcnt_reg;
190 rw[0x43] = &timer2->ocra_reg;
191 rw[0x42] = &assr_reg;
192 rw[0x41] = &wado->wdtcr_reg;
193 rw[0x40] = &usart->ucsrc_ubrrh_reg;
194 rw[0x3f] = &eeprom->eearh_reg;
195 rw[0x3e] = &eeprom->eearl_reg;
196 rw[0x3d] = &eeprom->eedr_reg;
197 rw[0x3c] = &eeprom->eecr_reg;
201 rw[0x38] = &portb.port_reg;
202 rw[0x37] = &portb.ddr_reg;
203 rw[0x36] = &portb.pin_reg;
204 rw[0x35] = &portc.port_reg;
205 rw[0x34] = &portc.ddr_reg;
206 rw[0x33] = &portc.pin_reg;
207 rw[0x32] = &portd.port_reg;
208 rw[0x31] = &portd.ddr_reg;
209 rw[0x30] = &portd.pin_reg;
210 rw[0x2f] = &spi->spdr_reg;
211 rw[0x2e] = &spi->spsr_reg;
212 rw[0x2d] = &spi->spcr_reg;
213 rw[0x2c] = &usart->udr_reg;
214 rw[0x2b] = &usart->ucsra_reg;
215 rw[0x2a] = &usart->ucsrb_reg;
216 rw[0x29] = &usart->ubrr_reg;
217 rw[0x28] = &acomp->acsr_reg;
218 rw[0x27] = &ad->admux_reg;
219 rw[0x26] = &ad->adcsra_reg;
220 rw[0x25] = &ad->adch_reg;
221 rw[0x24] = &ad->adcl_reg;
oscillator version 3.x and older, 8bit, one range
ADC reference is selected on 3 or 4 different sources: Vcc, aref pin, bandgap or 2.56V reference.
Basic AVR device, contains the core functionality.
0:aref, 1:vcc, 2:-, 3:2.56V
IOSpecialReg * gicr_reg
GICR IO register.
HWAcomp * acomp
analog compare unit
Implements a stack with stack register using RAM as stackarea.
Timer unit with 8Bit counter and one output compare unit.
Handler for external IRQ's to communicate with IRQ system and mask/flag registers.
Represents a timer interrupt line, Frontend for timer interrupts.
IOSpecialReg * mcucsr_reg
MCUCSR IO register.
Implements the I/O hardware necessary to do USART transfers.
HWTimer16_2C2 * timer1
timer 1 unit
HWTimer8_0C * timer0
timer 0 unit
ADC type M8: ADC on atmega8.
OSCCALRegister * osccal_reg
OSCCAL IO register.
IOSpecialReg * gifr_reg
GIFR IO register.
Timer unit with 16Bit counter and 2 output compare units and 2 config registers.
virtual ~AvrDevice_atmega8()
IOSpecialReg * mcucr_reg
MCUCR IO register.
HWUsart * usart
USART unit.
Provices flag and mask register for timer interrupts and connects irq lines to irqsystem.
HWAdmux * admux
ADC multiplexer unit.
HWTimer8_1C * timer2
timer 2 unit
#define AVR_REGISTER(name, class)
TimerIRQRegister * timer012irq
timer interrupt unit for timer 0 to 2
HWARef * aref
ADC reference unit.
ExternalIRQHandler * extirq
external interrupt support
Timer unit with 8Bit counter and no output compare unit.
AVRDevice class for ATMega8.
Provides the programming engine for flash self programming.
ICaptureSource * inputCapture1
input capture source for timer1
Class, which provides input capture source for 16bit timers.
FlashProgramming * spmRegister
Analog comparator peripheral.
Implement OSCCAL register.
External interrupt (INT0, INT1...) on a single pin, one and 2 bit configuration.